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>
This commit is contained in:
@@ -288,7 +288,7 @@ int event__synthesize_kernel_mmap(event__handler_t process,
|
||||
*/
|
||||
struct process_symbol_args args = { .name = symbol_name, };
|
||||
|
||||
mmap_name = machine__mmap_name(machine, name_buff);
|
||||
mmap_name = machine__mmap_name(machine, name_buff, sizeof(name_buff));
|
||||
if (machine__is_host(machine)) {
|
||||
/*
|
||||
* kernel uses PERF_RECORD_MISC_USER for user space maps,
|
||||
@@ -399,7 +399,7 @@ static int event__process_kernel_mmap(event_t *self,
|
||||
goto out_problem;
|
||||
}
|
||||
|
||||
machine__mmap_name(machine, kmmap_prefix);
|
||||
machine__mmap_name(machine, kmmap_prefix, sizeof(kmmap_prefix));
|
||||
if (machine__is_host(machine))
|
||||
kernel_type = DSO_TYPE_KERNEL;
|
||||
else
|
||||
|
Reference in New Issue
Block a user