[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7df3ff63-a421-42cc-bcaa-b0254ff6a0e8@linux.intel.com>
Date: Fri, 19 Apr 2024 09:20:53 -0400
From: "Liang, Kan" <kan.liang@...ux.intel.com>
To: Ian Rogers <irogers@...gle.com>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>, Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>, Adrian Hunter <adrian.hunter@...el.com>,
James Clark <james.clark@....com>, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org, bpf@...r.kernel.org,
Atish Patra <atishp@...osinc.com>, linux-riscv@...ts.infradead.org,
Beeman Strong <beeman@...osinc.com>
Subject: Re: [PATCH v2 13/16] perf parse-events: Improvements to modifier
parsing
On 2024-04-19 2:22 a.m., Ian Rogers wrote:
>>> + /* Simple modifiers copied to the evsel. */
>>> + if (mod.precise) {
>>> + u8 precise = evsel->core.attr.precise_ip + mod.precise;
>>> + /*
>>> + * precise ip:
>>> + *
>>> + * 0 - SAMPLE_IP can have arbitrary skid
>>> + * 1 - SAMPLE_IP must have constant skid
>>> + * 2 - SAMPLE_IP requested to have 0 skid
>>> + * 3 - SAMPLE_IP must have 0 skid
>>> + *
>>> + * See also PERF_RECORD_MISC_EXACT_IP
>>> + */
>>> + if (precise > 3) {
>> The pmu_max_precise() should return the max precise the current kernel
>> supports. It checks the /sys/devices/cpu/caps/max_precise.
>>
>> I think we should use that value rather than hard code it to 3.
> I'll add an extra patch to do that. I'm a bit concerned it may break
> event parsing on platforms not supporting max_precise of 3.
The kernel already rejects the precise_ip > max_precise (using the same
x86_pmu_max_precise()). It should be fine to apply the same logic in the
tool.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/x86/events/core.c#n566
Will the extra patch be sent separately?
Thanks,
Kan
Powered by blists - more mailing lists