From ee4c75887d12bcd6ecd897291797d969256f39ca Mon Sep 17 00:00:00 2001 From: Jiri Olsa Date: Wed, 29 Jul 2015 05:42:11 -0400 Subject: perf tools: Force period term to overload global settings Currently the command line option settings beats the per event period settings: With no global settings, we get per-event configuration: $ perf record -e 'cpu/instructions,period=20000/' sleep 1 $ perf evlist -v ... { sample_period, sample_freq }: 20000 ... With 'c' option period setup, we get 'c' option value: $ perf record -e 'cpu/instructions,period=20000/' -c 1000 sleep 1 $ perf evlist -v ... { sample_period, sample_freq }: 1000 ... This patch makes the per-event settings overload the global 'c' option setup: $ perf record -e 'cpu/instructions,period=20000/' -c 1000 sleep 1 $ perf evlist -v ... { sample_period, sample_freq }: 20000 ... I think the making the per-event settings to overload any other config makes more sense than current state. However it breaks the current 'period' term handling, which might cause some noise.. so let's see ;-). Also fixing parse event tests with the new behaviour. Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Andi Kleen Cc: Kan Liang Cc: Namhyung Kim Link: http://lkml.kernel.org/r/1438162936-59698-3-git-send-email-kan.liang@intel.com Signed-off-by: Kan Liang Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/evsel.h | 1 + 1 file changed, 1 insertion(+) (limited to 'tools/perf/util/evsel.h') diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 0339819..a7d2175 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -38,6 +38,7 @@ struct cgroup_sel; * perf_evsel::config_terms list head. */ enum { + PERF_EVSEL__CONFIG_TERM_PERIOD, PERF_EVSEL__CONFIG_TERM_MAX, }; -- cgit v1.1