From: Jiri Olsa Date: Mon, 3 Feb 2014 11:44:41 +0000 (+0100) Subject: perf tools: Put proper period for for samples without PERIOD sample_type X-Git-Tag: next-20140306~34^2~14^2~6^2~27 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=bc5290869d0a7f7abbde76ac95a7f7b6f5d7bb7b;p=karo-tx-linux.git perf tools: Put proper period for for samples without PERIOD sample_type We use PERF_SAMPLE_PERIOD sample type only for frequency setup -F (default) option. The -c does not need store period, because it's always the same. In -c case the report code uses '1' as period. Fixing it to perf_event_attr::sample_period. Signed-off-by: Jiri Olsa Cc: Adrian Hunter Cc: Andi Kleen Cc: Corey Ashford Cc: David Ahern Cc: Ingo Molnar Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1391427883-13443-1-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 55407c594b87..c6f8ce9972e7 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1220,7 +1220,7 @@ int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event, memset(data, 0, sizeof(*data)); data->cpu = data->pid = data->tid = -1; data->stream_id = data->id = data->time = -1ULL; - data->period = 1; + data->period = evsel->attr.sample_period; data->weight = 0; if (event->header.type != PERF_RECORD_SAMPLE) {