Skip to content

perf tool: Add PERF_SAMPLE_READ sample read support

Jiri Olsa lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11perf ui/hist: Add support to display whole group data for raw columnstools/perf/ui/hist.c+26 -272 replies
2/11perf: Add PERF_EVENT_IOC_ID ioctl to return event IDinclude/uapi/linux/perf_event.h kernel/events/core.c+10 -01 reply
3/11perf: Do not get values from disabled counters in group format readkernel/events/core.c+2 -11 reply
4/11perf tools: Use PERF_EVENT_IOC_ID perf ioctl to read event idtools/perf/util/evlist.c+15 -10 replies
5/11perf tools: Add support for parsing PERF_SAMPLE_READ sample typetools/perf/util/event.h tools/perf/util/evlist.c tools/perf/util/evlist.h +2 more+113 -20 replies
6/11perf tools: Fix event ID retrieval for group format read casetools/perf/util/evlist.c+9 -00 replies
7/11perf tools: Add perf_evlist__id2sid function to get event ID related datatools/perf/util/evlist.c tools/perf/util/evlist.h+18 -50 replies
8/11perf tools: Add PERF_SAMPLE_READ sample related processingtools/perf/util/evsel.h tools/perf/util/session.c+74 -10 replies
9/11perf tools: Add 'S' event/group modifier to read sample valuetools/perf/Documentation/perf-list.txt tools/perf/util/evsel.c tools/perf/util/evsel.h +2 more+39 -20 replies
10/11perf tests: Add attr record group sampling testtools/perf/tests/attr/test-record-group-sampling+36 -00 replies
11/11perf tests: Add parse events tests for leader samplingtools/perf/tests/parse-events.c+115 -00 replies

Reviews trailers per patch

3 of 11 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchNamhyung KimPeter Zijlstra
SeriesA-b
1/11A-b
2/11A-b
3/11A-b
4/11
5/11
6/11
7/11
8/11
9/11
10/11
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/11] perf tool: Add PERF_SAMPLE_READ sample read support

hi,
adding support to read sample values through the PERF_SAMPLE_READ sample type. It's now possible to specify 'S' modifier for an event and get its sample value by PERF_SAMPLE_READ.

For group the 'S' modifier will enable sampling only for the leader and read all the group member by PERF_SAMPLE_READ smple type with PERF_FORMAT_GROUP read format.

This was first introduced in here:
https://lkml.org/lkml/2012/10/20/75

Example:

  $ perf record -e '{cycles,cache-misses}:S' ls
  ...
  $ perf report --group --show-total-period --stdio
  ...
  # Samples: 36  of event 'anon group { cycles, cache-misses }'
  # Event count (approx.): 12585593
  #
  #         Overhead                    Period  Command      Shared Object                      Symbol
  # ................  ........................  .......  .................  ..........................
  #
      19.92%   1.20%       2505936          31       ls  [kernel.kallsyms]  [k] mark_held_locks
      13.74%   0.47%       1729327          12       ls  [kernel.kallsyms]  [k] sched_clock_local
      13.64%  23.72%       1716147         612       ls  ld-2.14.90.so      [.] check_match.10805
      13.12%  23.22%       1650778         599       ls  libc-2.14.90.so    [.] _nl_intern_locale_data
      11.24%  29.19%       1414554         753       ls  [kernel.kallsyms]  [k] sched_clock_cpu
       8.50%   0.35%       1070150           9       ls  [kernel.kallsyms]  [k] check_chain_key
  ...

The patchset is based on following fix:
http://lkml.org/lkml/2013/2/4/122

and is available also at:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/linux.git
perf/group6

TODO: add column names as suggested by Ingo in the original discussion.

thanks,
jirka

Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Corey Ashford <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Namhyung Kim <[email protected]>

---
Jiri Olsa (11):
perf ui/hist: Add support to display whole group data for raw columns
perf: Add PERF_EVENT_IOC_ID ioctl to return event ID
perf: Do not get values from disabled counters in group format read perf tools: Use PERF_EVENT_IOC_ID perf ioctl to read event id perf tools: Add support for parsing PERF_SAMPLE_READ sample type perf tools: Fix event ID retrieval for group format read case perf tools: Add perf_evlist__id2sid function to get event ID related data perf tools: Add PERF_SAMPLE_READ sample related processing perf tools: Add 'S' event/group modifier to read sample value perf tests: Add attr record group sampling test
perf tests: Add parse events tests for leader sampling

 include/uapi/linux/perf_event.h                  |   1 +
 kernel/events/core.c                             |  12 ++++++++-
 tools/perf/Documentation/perf-list.txt           |   1 +
 tools/perf/tests/attr/test-record-group-sampling |  36 ++++++++++++++++++++++++++
 tools/perf/tests/parse-events.c                  | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tools/perf/ui/hist.c                             |  53 +++++++++++++++++++-------------------
 tools/perf/util/event.h                          |  18 +++++++++++++
 tools/perf/util/evlist.c                         |  73 +++++++++++++++++++++++++++++++++++++++++++++++-----
 tools/perf/util/evlist.h                         |   4 +++
 tools/perf/util/evsel.c                          |  59 ++++++++++++++++++++++++++++++++++++++++--
 tools/perf/util/evsel.h                          |   4 +++
 tools/perf/util/parse-events.c                   |   8 +++++-
 tools/perf/util/parse-events.l                   |   2 +-
 tools/perf/util/session.c                        | 110 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 14 files changed, 457 insertions(+), 39 deletions(-)