mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
perf stat: Keep the / modifier separator in fallback
The 'perf stat' fallback for EACCES error sets the exclude_kernel
perf_event_attr and tries perf_event_open() again with it. In addition,
it also changes the name of the event to reflect that change by adding
the 'u' modifier.
But it does not take into account the '/' separator, so the event name
can end up mangled, like: (note the '/:' characters)
$ perf stat -e cpu/cpu-cycles/ kill
...
386,832 cpu/cpu-cycles/:u
Adding the code to check on the '/' separator and set the following
correct event name:
$ perf stat -e cpu/cpu-cycles/ kill
...
388,548 cpu/cpu-cycles/u
Signed-off-by: Jiri Olsa <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
parent
b31a8cc1a5
commit
129193bb0c
1 changed files with 7 additions and 1 deletions
|
|
@ -2754,8 +2754,14 @@ bool perf_evsel__fallback(struct perf_evsel *evsel, int err,
|
|||
(paranoid = perf_event_paranoid()) > 1) {
|
||||
const char *name = perf_evsel__name(evsel);
|
||||
char *new_name;
|
||||
const char *sep = ":";
|
||||
|
||||
if (asprintf(&new_name, "%s%su", name, strchr(name, ':') ? "" : ":") < 0)
|
||||
/* Is there already the separator in the name. */
|
||||
if (strchr(name, '/') ||
|
||||
strchr(name, ':'))
|
||||
sep = "";
|
||||
|
||||
if (asprintf(&new_name, "%s%su", name, sep) < 0)
|
||||
return false;
|
||||
|
||||
if (evsel->name)
|
||||
|
|
|
|||
Loading…
Reference in a new issue