mirror of
https://github.com/torvalds/linux.git
synced 2026-11-24 15:33:28 +00:00
perf record: Prevent override of attr->sample_period for libpfm4 events
Before: $ perf record -c 10000 --pfm-events=cycles:period=77777 Would yield a cycles event with period=10000, instead of 77777. the event string and perf record initializing the event. This was due to an ordering issue between libpfm4 parsing events with attr->sample_period != 0 by the time intent of the author. perf_evsel__config() is invoked. This seems to have been the This patch fixes the problem by preventing override for Signed-off-by: Stephane Eranian <[email protected]> Reviewed-by: Ian Rogers <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Andrii Nakryiko <[email protected]> Cc: Athira Jajeev <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: John Fastabend <[email protected]> Cc: KP Singh <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Martin KaFai Lau <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Song Liu <[email protected]> Cc: Yonghong Song <[email protected]> Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Ian Rogers <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
committed by
Arnaldo Carvalho de Melo
parent
ce4326d275
commit
ae5dcc8abe
@@ -976,8 +976,7 @@ void evsel__config(struct evsel *evsel, struct record_opts *opts,
|
||||
* We default some events to have a default interval. But keep
|
||||
* it a weak assumption overridable by the user.
|
||||
*/
|
||||
if (!attr->sample_period || (opts->user_freq != UINT_MAX ||
|
||||
opts->user_interval != ULLONG_MAX)) {
|
||||
if (!attr->sample_period) {
|
||||
if (opts->freq) {
|
||||
attr->freq = 1;
|
||||
attr->sample_freq = opts->freq;
|
||||
|
||||
Reference in New Issue
Block a user