aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/util.c
diff options
context:
space:
mode:
authorStephane Eranian <eranian@google.com>2012-02-09 10:12:38 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-02-13 20:35:04 -0500
commit7e1ccd3804281fc0755eb726b654469c40a96d89 (patch)
treedd262703dfc95983c4a8308b5f40fb41b404a1a6 /tools/perf/util/util.c
parentf1c67db7e351bf9fd328e368ba045cbeca11d513 (diff)
perf tools: cleanup initialization of attr->size
The perf_event_attr size needs to be initialized in all cases because it captures the ABI version. This patch moves the initialization of the field from the perf_event_open() syscall stub to its proper location in the event_attr_init(). Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20120209151238.GA10272@quad Signed-off-by: Stephane Eranian <eranian@google.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/util.c')
-rw-r--r--tools/perf/util/util.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index fb25d1329218..8109a907841e 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -14,6 +14,8 @@ void event_attr_init(struct perf_event_attr *attr)
14 attr->exclude_host = 1; 14 attr->exclude_host = 1;
15 if (!perf_guest) 15 if (!perf_guest)
16 attr->exclude_guest = 1; 16 attr->exclude_guest = 1;
17 /* to capture ABI version */
18 attr->size = sizeof(*attr);
17} 19}
18 20
19int mkdir_p(char *path, mode_t mode) 21int mkdir_p(char *path, mode_t mode)