[PATCH 59/66] perf python: Init perf_event_attr::size in perf.evsel constructor

From: Arnaldo Carvalho de Melo
Date: Tue Jul 12 2016 - 18:56:12 EST


From: Jiri Olsa <jolsa@xxxxxxxxxx>

Currently 0 is passed as perf_event_attr::size, which could block usage
of new features.

Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Link: http://lkml.kernel.org/r/1468148882-10362-4-git-send-email-jolsa@xxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/util/python.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
index 65c6c73d28fe..d0c1267741ee 100644
--- a/tools/perf/util/python.c
+++ b/tools/perf/util/python.c
@@ -653,6 +653,7 @@ static int pyrf_evsel__init(struct pyrf_evsel *pevsel,
attr.precise_ip = precise_ip;
attr.mmap_data = mmap_data;
attr.sample_id_all = sample_id_all;
+ attr.size = sizeof(attr);

perf_evsel__init(&pevsel->evsel, &attr, idx);
return 0;
--
2.7.4