提交 ab35a7d0 编写于 作者: J Jiri Olsa 提交者: Arnaldo Carvalho de Melo

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: NJiri Olsa <jolsa@kernel.org>
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/20150808171210.GC17040@krava.brq.redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 a9710ba0
...@@ -598,6 +598,7 @@ static void apply_config_terms(struct perf_evsel *evsel) ...@@ -598,6 +598,7 @@ static void apply_config_terms(struct perf_evsel *evsel)
switch (term->type) { switch (term->type) {
case PERF_EVSEL__CONFIG_TERM_PERIOD: case PERF_EVSEL__CONFIG_TERM_PERIOD:
attr->sample_period = term->val.period; attr->sample_period = term->val.period;
attr->freq = 0;
break; break;
case PERF_EVSEL__CONFIG_TERM_TIME: case PERF_EVSEL__CONFIG_TERM_TIME:
if (term->val.time) if (term->val.time)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册