aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-test.c
diff options
context:
space:
mode:
authorLin Ming <ming.m.lin@intel.com>2011-01-06 22:11:09 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-01-06 22:44:36 -0500
commit23a2f3ab46596d9fd0b0e592d2101bea90970594 (patch)
tree6b3d9e3755a3e71bb0e6b47e62b269e50b6cf37d /tools/perf/builtin-test.c
parent6b01f2c4f6188da50d8fe094e369a9c0390424ab (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/builtin-test.c')
-rw-r--r--tools/perf/builtin-test.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c
index 1c984342a579..e12753f976a1 100644
--- a/tools/perf/builtin-test.c
+++ b/tools/perf/builtin-test.c
@@ -264,6 +264,7 @@ static int test__open_syscall_event(void)
264 int err = -1, fd; 264 int err = -1, fd;
265 struct thread_map *threads; 265 struct thread_map *threads;
266 struct perf_evsel *evsel; 266 struct perf_evsel *evsel;
267 struct perf_event_attr attr;
267 unsigned int nr_open_calls = 111, i; 268 unsigned int nr_open_calls = 111, i;
268 int id = trace_event__id("sys_enter_open"); 269 int id = trace_event__id("sys_enter_open");
269 270
@@ -278,7 +279,10 @@ static int test__open_syscall_event(void)
278 return -1; 279 return -1;
279 } 280 }
280 281
281 evsel = perf_evsel__new(PERF_TYPE_TRACEPOINT, id, 0); 282 memset(&attr, 0, sizeof(attr));
283 attr.type = PERF_TYPE_TRACEPOINT;
284 attr.config = id;
285 evsel = perf_evsel__new(&attr, 0);
282 if (evsel == NULL) { 286 if (evsel == NULL) {
283 pr_debug("perf_evsel__new\n"); 287 pr_debug("perf_evsel__new\n");
284 goto out_thread_map_delete; 288 goto out_thread_map_delete;