perf tools: Fix up /proc/PID/maps parsing
authorArnaldo Carvalho de Melo <[email protected]>
Mon, 28 Oct 2013 12:38:12 +0000 (09:38 -0300)
committerArnaldo Carvalho de Melo <[email protected]>
Mon, 28 Oct 2013 12:38:12 +0000 (09:38 -0300)
When introducing support for MMAP2 we considered more parts of each map
representation in /proc/PID/maps, and when disabling it we forgot to
reduce the number of expected parsed/assigned entries in the sscanf
call, fix it to expect the right number of desired fields, 5.

Reported-by: Markus Trippelsdorf <[email protected]>
Based-on-a-patch-by: Markus Trippelsdorf <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/util/event.c

index 63df031fc9c73868160305b7875d6e20eded09df..49096ea58a15dec22dc1e20b0de5d69bf2c2ac3a 100644 (file)
@@ -213,7 +213,7 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool,
                       &event->mmap.pgoff,
                       execname);
 
-               if (n != 8)
+               if (n != 5)
                        continue;
 
                if (prot[2] != 'x')