diff options
author | Jiri Olsa <jolsa@redhat.com> | 2014-02-03 06:44:41 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-02-18 07:34:46 -0500 |
commit | bc5290869d0a7f7abbde76ac95a7f7b6f5d7bb7b (patch) | |
tree | d24f4d177fdd40dafa62ce171c5d1c9e5f26bb7f /tools/perf/util/evsel.c | |
parent | 106395dfda0397a6a88cc309bb7beb1fdf2ed798 (diff) |
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 <jolsa@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1391427883-13443-1-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/evsel.c')
-rw-r--r-- | tools/perf/util/evsel.c | 2 |
1 files changed, 1 insertions, 1 deletions
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, | |||
1220 | memset(data, 0, sizeof(*data)); | 1220 | memset(data, 0, sizeof(*data)); |
1221 | data->cpu = data->pid = data->tid = -1; | 1221 | data->cpu = data->pid = data->tid = -1; |
1222 | data->stream_id = data->id = data->time = -1ULL; | 1222 | data->stream_id = data->id = data->time = -1ULL; |
1223 | data->period = 1; | 1223 | data->period = evsel->attr.sample_period; |
1224 | data->weight = 0; | 1224 | data->weight = 0; |
1225 | 1225 | ||
1226 | if (event->header.type != PERF_RECORD_SAMPLE) { | 1226 | if (event->header.type != PERF_RECORD_SAMPLE) { |