aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/event.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-04-27 20:19:05 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-04-27 20:19:05 -0400
commit48ea8f5470aa6f35244d1b218316705ea88c0259 (patch)
treeb4e9a2d1cc227be96f2c3de815b5b2b4c12e3cb5 /tools/perf/util/event.c
parent23346f21b277e3aae5e9989e711a11cbe8133a45 (diff)
perf machine: Pass buffer size to machine__mmap_name
Don't blindly assume that the size of the buffer is enough, use snprintf. Cc: Avi Kivity <avi@redhat.com> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Zhang, Yanmin <yanmin_zhang@linux.intel.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/event.c')
-rw-r--r--tools/perf/util/event.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 2f33ca9899bd..7400e5147e13 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -288,7 +288,7 @@ int event__synthesize_kernel_mmap(event__handler_t process,
288 */ 288 */
289 struct process_symbol_args args = { .name = symbol_name, }; 289 struct process_symbol_args args = { .name = symbol_name, };
290 290
291 mmap_name = machine__mmap_name(machine, name_buff); 291 mmap_name = machine__mmap_name(machine, name_buff, sizeof(name_buff));
292 if (machine__is_host(machine)) { 292 if (machine__is_host(machine)) {
293 /* 293 /*
294 * kernel uses PERF_RECORD_MISC_USER for user space maps, 294 * kernel uses PERF_RECORD_MISC_USER for user space maps,
@@ -399,7 +399,7 @@ static int event__process_kernel_mmap(event_t *self,
399 goto out_problem; 399 goto out_problem;
400 } 400 }
401 401
402 machine__mmap_name(machine, kmmap_prefix); 402 machine__mmap_name(machine, kmmap_prefix, sizeof(kmmap_prefix));
403 if (machine__is_host(machine)) 403 if (machine__is_host(machine))
404 kernel_type = DSO_TYPE_KERNEL; 404 kernel_type = DSO_TYPE_KERNEL;
405 else 405 else