]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
perf record: Retirement latency cleanup in evsel__config
authorIan Rogers <irogers@google.com>
Mon, 14 Apr 2025 17:41:34 +0000 (10:41 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 25 Apr 2025 15:31:44 +0000 (12:31 -0300)
'perf record' will fail with retirement latency events as the open
doesn't do a perf_event_open system call.

Use evsel__config() to set up such events for recording by removing the
flag and enabling sample weights - the sample weights containing the
retirement latency.

Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Weilin Wang <weilin.wang@intel.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: Andreas Färber <afaerber@suse.de>
Cc: Caleb Biggers <caleb.biggers@intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Perry Taylor <perry.taylor@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Falcon <thomas.falcon@intel.com>
Link: https://lore.kernel.org/r/20250414174134.3095492-17-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/evsel.c

index 07a3a4e3b7a471c6b45d07f4b99c0d940935d074..1d79ffecd41f10ec339e079fe7838ad7e01c66c1 100644 (file)
@@ -1440,9 +1440,10 @@ void evsel__config(struct evsel *evsel, struct record_opts *opts,
                attr->branch_sample_type = opts->branch_stack;
        }
 
-       if (opts->sample_weight)
+       if (opts->sample_weight || evsel->retire_lat) {
                arch_evsel__set_sample_weight(evsel);
-
+               evsel->retire_lat = false;
+       }
        attr->task     = track;
        attr->mmap     = track;
        attr->mmap2    = track && !perf_missing_features.mmap2;