aboutsummaryrefslogtreecommitdiff
path: root/lib/dynamic_debug.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <[email protected]>2015-07-09 12:14:43 -0300
committerArnaldo Carvalho de Melo <[email protected]>2015-07-09 12:28:53 -0300
commit08ae217b8d44986062fe3648c5bb83816d5bc00f (patch)
tree8b7e07d74b349a70d8e1eb26af973c41343d0dbf /lib/dynamic_debug.c
parentc867b150de8514d8682978d8e8874c3940ae781b (diff)
perf thread_map: Fix the sizeof() calculation for map entries
When we started adding extra stuff per array entry, growing the size of those entries to more than sizeof(pid_t), we had to convert those sizeof operations to the more robust sizeof(map->map[0]) idiom, that is future proof, i.e. if/when we add more stuff to those entries, that expression will produce the new per-entry size. And besides that, we need to zero out those extra fields, that sometimes may not get filled, like when we couldn't care less about the comms, since we don't need those, but since we will try freeing it at thread_map__delete(), we better fix it. That is why a thread_map__realloc() was provided. But that method wasn't used in thread_map__new_by_uid(), fix it. Reported-by: Ingo Molnar <[email protected]> Fixes: 792402fd5c0a ("perf thrad_map: Add comm string into array") Fixes: 9d7e8c3a96e5 ("perf tools: Add thread_map__(alloc|realloc) helpers") Cc: Adrian Hunter <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: David Ahern <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'lib/dynamic_debug.c')
0 files changed, 0 insertions, 0 deletions