diff options
author | Don Zickus <dzickus@redhat.com> | 2013-11-13 15:32:06 -0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-04 11:05:10 -0800 |
commit | ca51a9cb5fbbec24c6fe15f4a5ff4a4c086bfcb1 (patch) | |
tree | d5c9a419d8fc7774ad850ac4daf3e6a3ae0504c3 /tools/perf | |
parent | d659ec28a6386ced8c3f4d074be0ce4d47e9fbc4 (diff) |
perf tools: Synthesize anon MMAP records again
commit 9d4ecc8893832337daf241236841db966fa53489 upstream.
When introducing the PERF_RECORD_MMAP2 in:
5c5e854bc760 perf tools: Add attr->mmap2 support
A check for the number of entries parsed by sscanf was introduced that
assumed all of the 8 fields needed to be correctly parsed so that
particular /proc/pid/maps line would be considered synthesizable.
That broke anon records synthesizing, as it doesn't have the 'execname'
field.
Fix it by keeping the sscanf return check, changing it to not require
that the 'execname' variable be parsed, so that the preexisting logic
can kick in and set it to '//anon'.
This should get things like JIT profiling working again.
Signed-off-by: Don Zickus <dzickus@redhat.com>
Cc: Bill Gray <bgray@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Cc: Richard Fowles <rfowles@redhat.com>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-bo4akalno7579shpz29u867j@git.kernel.org
[ commit log message is mine, dzickus reported the problem with a patch ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/event.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 49096ea58a1..1ae1b0826cd 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c @@ -212,8 +212,10 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool, &event->mmap.start, &event->mmap.len, prot, &event->mmap.pgoff, execname); - - if (n != 5) + /* + * Anon maps don't have the execname. + */ + if (n < 4) continue; if (prot[2] != 'x') |