perf evsel: State in the default event name if attr.exclude_kernel is set
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 10 Jul 2017 19:19:25 +0000 (16:19 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 10 Jul 2017 19:19:25 +0000 (16:19 -0300)
commitede5626d303b721dd02246a3850380943c24e380
tree675a1d0c32fc5c5abba4bf423aa43b3092450a77
parentd37a369790774af66a4aee61a188384d21b17a43
perf evsel: State in the default event name if attr.exclude_kernel is set

When no event is specified perf will use the "cycles" hardware event
with the highest precision available in the processor, and excluding
kernel events for non-root users, so make that clear in the event name
by setting the "u" event modifier, i.e. "cycles:upp".

E.g.:

The default for root:

  # perf record usleep 1
  # perf evlist -v
  cycles:ppp: ..., precise_ip: 3, exclude_kernel: 0, ...
  #

And for !root:

  $ perf record usleep 1
  $ perf evlist -v
  cycles:uppp: ... , precise_ip: 3, exclude_kernel: 1, ...
  $

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-lf29zcdl422i9knrgde0uwy3@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/evsel.c