Re: [PATCH v3 4/4] tools/perf: Allow inherit + inherit_stat + PERF_SAMPLE_READ when opening events

From: Ben Gainey
Date: Fri Mar 22 2024 - 10:19:37 EST


On Fri, 2024-03-22 at 13:04 +0000, Ben Gainey wrote:
> This change updates evsel to allow the combination of inherit
> and PERF_SAMPLE_READ.
>
> A fallback is implemented for kernel versions where this feature is
> not
> supported.
>
> The user must pass --stat option to perf record to opt into this new
> behaviour.
>
> Signed-off-by: Ben Gainey <ben.gainey@xxxxxxx>
> ---
> tools/perf/tests/attr/base-record | 2 +-
> tools/perf/tests/attr/base-stat | 2 +-
> tools/perf/tests/attr/system-wide-dummy | 2 +-
> tools/perf/tests/attr/test-record-dummy-C0 | 2 +-
> .../test-record-group-sampling-inherit-stat | 62 ++++++++++++++
> tools/perf/util/evsel.c | 82
> ++++++++++++++++++-
> tools/perf/util/evsel.h | 1 +
> 7 files changed, 147 insertions(+), 6 deletions(-)
> create mode 100644 tools/perf/tests/attr/test-record-group-sampling-
> inherit-stat
>
> diff --git a/tools/perf/tests/attr/base-record
> b/tools/perf/tests/attr/base-record
> index b44e4e6e4443..dd76fbdb628f 100644
> --- a/tools/perf/tests/attr/base-record
> +++ b/tools/perf/tests/attr/base-record
> @@ -5,7 +5,7 @@ group_fd=-1
> flags=0|8
> cpu=*
> type=0|1
> -size=136
> +size=144

Sigh... this one belongs elsewhere. Too many spinning plates.

I'll have to redo this one with the correct size= value.

Regards
Ben
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.