diff options
author | Jiri Olsa <jolsa@kernel.org> | 2015-07-29 05:42:11 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-07-29 15:18:21 -0400 |
commit | ee4c75887d12bcd6ecd897291797d969256f39ca (patch) | |
tree | 9615b63684b35e15608bc2f4d0515a6b28203d8f /tools/perf/util/parse-events.c | |
parent | 930a2e29758f865e3a7b34b8b3b37c08d40f0254 (diff) |
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 <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1438162936-59698-3-git-send-email-kan.liang@intel.com
Signed-off-by: Kan Liang <kan.liang@intel.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/parse-events.c')
-rw-r--r-- | tools/perf/util/parse-events.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 3271d134e8c1..09bee93fd0ec 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
@@ -596,7 +596,6 @@ do { \ | |||
596 | break; | 596 | break; |
597 | case PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD: | 597 | case PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD: |
598 | CHECK_TYPE_VAL(NUM); | 598 | CHECK_TYPE_VAL(NUM); |
599 | attr->sample_period = term->val.num; | ||
600 | break; | 599 | break; |
601 | case PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE: | 600 | case PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE: |
602 | /* | 601 | /* |
@@ -649,6 +648,8 @@ do { \ | |||
649 | 648 | ||
650 | list_for_each_entry(term, head_config, list) { | 649 | list_for_each_entry(term, head_config, list) { |
651 | switch (term->type_term) { | 650 | switch (term->type_term) { |
651 | case PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD: | ||
652 | ADD_CONFIG_TERM(PERIOD, period, term->val.num); | ||
652 | default: | 653 | default: |
653 | break; | 654 | break; |
654 | } | 655 | } |