Commit ca51a9cb authored by Don Zickus's avatar Don Zickus Committed by Greg Kroah-Hartman

perf tools: Synthesize anon MMAP records again

commit 9d4ecc88 upstream.

When introducing the PERF_RECORD_MMAP2 in:

5c5e854b 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: default avatarDon 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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d659ec28
...@@ -212,8 +212,10 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool, ...@@ -212,8 +212,10 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool,
&event->mmap.start, &event->mmap.len, prot, &event->mmap.start, &event->mmap.len, prot,
&event->mmap.pgoff, &event->mmap.pgoff,
execname); execname);
/*
if (n != 5) * Anon maps don't have the execname.
*/
if (n < 4)
continue; continue;
if (prot[2] != 'x') if (prot[2] != 'x')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment