[PATCH] Documentation/trace/postprocess/trace-pagealloc-postprocess.pl: fix the traceevent regex

From: vinayakm . list
Date: Sat Mar 01 2014 - 00:44:14 EST


From: Vinayak Menon <vinayakm.list@xxxxxxxxx>

The script fails, when irq, preempt and lockdep fields (field 3 below)
are printed in the trace output.

Example entry:
worker/0:0-4 [000] ...1 1155.972338: mm_page_alloc:

Signed-off-by: Vinayak Menon <vinayakm.list@xxxxxxxxx>
---
.../postprocess/trace-pagealloc-postprocess.pl | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Documentation/trace/postprocess/trace-pagealloc-postprocess.pl b/Documentation/trace/postprocess/trace-pagealloc-postprocess.pl
index 0a120aa..94efc7f 100644
--- a/Documentation/trace/postprocess/trace-pagealloc-postprocess.pl
+++ b/Documentation/trace/postprocess/trace-pagealloc-postprocess.pl
@@ -84,7 +84,7 @@ my $regex_fragdetails;

# Static regex used. Specified like this for readability and for use with /o
# (process_pid) (cpus ) ( time ) (tpoint ) (details)
-my $regex_traceevent = '\s*([a-zA-Z0-9-]*)\s*(\[[0-9]*\])\s*([0-9.]*):\s*([a-zA-Z_]*):\s*(.*)';
+my $regex_traceevent = '\s*([a-zA-Z0-9-]*)\s*(\[[0-9]*\])(\s*[dX.][Nnp.][Hhs.][0-9a-fA-F.]*|)\s*([0-9.]*):\s*([a-zA-Z_]*):\s*(.*)';
my $regex_statname = '[-0-9]*\s\((.*)\).*';
my $regex_statppid = '[-0-9]*\s\(.*\)\s[A-Za-z]\s([0-9]*).*';

@@ -195,7 +195,7 @@ EVENT_PROCESS:
while ($traceevent = <STDIN>) {
if ($traceevent =~ /$regex_traceevent/o) {
$process_pid = $1;
- $tracepoint = $4;
+ $tracepoint = $5;

if ($opt_read_procstat || $opt_prepend_parent) {
$process_pid =~ /(.*)-([0-9]*)$/;
@@ -215,7 +215,7 @@ EVENT_PROCESS:

# Unnecessary in this script. Uncomment if required
# $cpus = $2;
- # $timestamp = $3;
+ # $timestamp = $4;
} else {
next;
}
@@ -236,7 +236,7 @@ EVENT_PROCESS:
} elsif ($tracepoint eq "mm_page_alloc_extfrag") {

# Extract the details of the event now
- $details = $5;
+ $details = $6;

my ($page, $pfn);
my ($alloc_order, $fallback_order, $pageblock_order);
--
1.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/