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>
This commit is contained in:
committed by
Arnaldo Carvalho de Melo
parent
6b01f2c4f6
commit
23a2f3ab46
@@ -264,6 +264,7 @@ static int test__open_syscall_event(void)
|
||||
int err = -1, fd;
|
||||
struct thread_map *threads;
|
||||
struct perf_evsel *evsel;
|
||||
struct perf_event_attr attr;
|
||||
unsigned int nr_open_calls = 111, i;
|
||||
int id = trace_event__id("sys_enter_open");
|
||||
|
||||
@@ -278,7 +279,10 @@ static int test__open_syscall_event(void)
|
||||
return -1;
|
||||
}
|
||||
|
||||
evsel = perf_evsel__new(PERF_TYPE_TRACEPOINT, id, 0);
|
||||
memset(&attr, 0, sizeof(attr));
|
||||
attr.type = PERF_TYPE_TRACEPOINT;
|
||||
attr.config = id;
|
||||
evsel = perf_evsel__new(&attr, 0);
|
||||
if (evsel == NULL) {
|
||||
pr_debug("perf_evsel__new\n");
|
||||
goto out_thread_map_delete;
|
||||
|
Reference in New Issue
Block a user