From: Jiri Olsa Date: Sat, 8 Aug 2015 17:12:10 +0000 (+0200) Subject: perf tools: Unset perf_event_attr::freq when period term is set X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ab35a7d0ee59a36c9c567defe43c1adb72e9240c;p=linux-beck.git perf tools: Unset perf_event_attr::freq when period term is set We need to unset 'perf_event_attr::freq' bit (default 1) when 'period' term is specified within event definition like: -e 'cpu/cpu-cycles,call-graph=fp,time,period=100000' otherwise it will handle the period value as frequency (and fail if it crossed the maximum allowed frequency value). Signed-off-by: Jiri Olsa Cc: Andi Kleen Cc: Kan Liang Cc: Namhyung Kim Link: http://lkml.kernel.org/r/20150808171210.GC17040@krava.brq.redhat.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index f572f469a30d..a59710f88d8a 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -598,6 +598,7 @@ static void apply_config_terms(struct perf_evsel *evsel) switch (term->type) { case PERF_EVSEL__CONFIG_TERM_PERIOD: attr->sample_period = term->val.period; + attr->freq = 0; break; case PERF_EVSEL__CONFIG_TERM_TIME: if (term->val.time)