diff options
author | Lin Ming <ming.m.lin@intel.com> | 2011-01-06 22:11:09 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-01-06 22:44:36 -0500 |
commit | 23a2f3ab46596d9fd0b0e592d2101bea90970594 (patch) | |
tree | 6b3d9e3755a3e71bb0e6b47e62b269e50b6cf37d /tools/perf/util/parse-events.c | |
parent | 6b01f2c4f6188da50d8fe094e369a9c0390424ab (diff) |
perf tools: Pass whole attr to event selectors
Since commit 69aad6f1(perf tools: Introduce event selectors), only
perf_event_attr::type and ::config are passed to event selector, which
makes perf tool not work correctly.
For example, PEBS does not work because perf_event_attr::precise_ip is
not passed to the syscall.
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <1294369869.20563.19.camel@minggr.sh.intel.com>
Signed-off-by: Lin Ming <ming.m.lin@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 | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 917a0ca521c1..5cb6f4bde905 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
@@ -823,7 +823,7 @@ int parse_events(const struct option *opt __used, const char *str, int unset __u | |||
823 | 823 | ||
824 | if (ret != EVT_HANDLED_ALL) { | 824 | if (ret != EVT_HANDLED_ALL) { |
825 | struct perf_evsel *evsel; | 825 | struct perf_evsel *evsel; |
826 | evsel = perf_evsel__new(attr.type, attr.config, | 826 | evsel = perf_evsel__new(&attr, |
827 | nr_counters); | 827 | nr_counters); |
828 | if (evsel == NULL) | 828 | if (evsel == NULL) |
829 | return -1; | 829 | return -1; |
@@ -1013,8 +1013,15 @@ void print_events(void) | |||
1013 | 1013 | ||
1014 | int perf_evsel_list__create_default(void) | 1014 | int perf_evsel_list__create_default(void) |
1015 | { | 1015 | { |
1016 | struct perf_evsel *evsel = perf_evsel__new(PERF_TYPE_HARDWARE, | 1016 | struct perf_evsel *evsel; |
1017 | PERF_COUNT_HW_CPU_CYCLES, 0); | 1017 | struct perf_event_attr attr; |
1018 | |||
1019 | memset(&attr, 0, sizeof(attr)); | ||
1020 | attr.type = PERF_TYPE_HARDWARE; | ||
1021 | attr.config = PERF_COUNT_HW_CPU_CYCLES; | ||
1022 | |||
1023 | evsel = perf_evsel__new(&attr, 0); | ||
1024 | |||
1018 | if (evsel == NULL) | 1025 | if (evsel == NULL) |
1019 | return -ENOMEM; | 1026 | return -ENOMEM; |
1020 | 1027 | ||