]> git.baikalelectronics.ru Git - kernel.git/commit
libperf: Handle read format in perf_evsel__read()
authorNamhyung Kim <namhyung@kernel.org>
Fri, 19 Aug 2022 00:36:42 +0000 (17:36 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 19 Aug 2022 18:56:27 +0000 (15:56 -0300)
commita30fe7c1df32e2e537d53561c45dad23cb22a3a3
tree479a3e263e2c45941b75278480fa07d0c51e2938
parent52ed54007dbf23bc986aa674f729ff9e32ccd426
libperf: Handle read format in perf_evsel__read()

The perf_counts_values should be increased to read the new lost data.
Also adjust values after read according the read format.

This supports PERF_FORMAT_GROUP which has a different data format but
it's only available for leader events.  Currently it doesn't have an API
to read sibling (member) events in the group.  But users may read the
sibling event directly.

Also reading from mmap would be disabled when the read format has ID or
LOST bit as it's not exposed via mmap.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220819003644.508916-3-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/lib/perf/evsel.c
tools/lib/perf/include/perf/event.h
tools/lib/perf/include/perf/evsel.h