perf python: Init perf_event_attr::size in perf.evsel constructor
authorJiri Olsa <jolsa@kernel.org>
Sun, 10 Jul 2016 11:07:55 +0000 (13:07 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 12 Jul 2016 19:16:17 +0000 (16:16 -0300)
Currently 0 is passed as perf_event_attr::size, which could block usage
of new features.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1468148882-10362-4-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/python.c

index 65c6c73d28fe4094fac7a0df5a9773c7f3cab939..d0c1267741eecb70b7d94239b93db69e0815ccd1 100644 (file)
@@ -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;