aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/call-graph-from-postgresql.py
diff options
context:
space:
mode:
authorWang Nan <[email protected]>2015-12-08 02:25:44 +0000
committerArnaldo Carvalho de Melo <[email protected]>2015-12-11 09:32:41 -0300
commit93b0ba3c60da89043ce2b9f601cd2b3da408903b (patch)
treed91948d40c9ab01a09006a14a02da2721f9d76c2 /tools/perf/scripts/python/call-graph-from-postgresql.py
parent27cfef009ae8a1019d174153987ce22a0e6677fc (diff)
perf tools: Clear struct machine during machine__init()
There are so many test cases use stack allocated 'struct machine'. Including: test__hists_link test__hists_filter test__mmap_thread_lookup test__thread_mg_share test__hists_output test__hists_cumulate Also, in non-test code (for example, machine__new_host()) there are code use 'malloc()' to alloc struct machine. These are dangerous operations, cause some tests fail or hung in machines__exit(). For example, in machines__exit -> machine__destroy_kernel_maps -> map_groups__remove -> maps__remove -> pthread_rwlock_wrlock a incorrectly initialized lock causes unintended behavior. This patch memset(0) that structure in machine__init() to ensure all fields in 'struct machine' are initialized to zero. Signed-off-by: Wang Nan <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Zefan Li <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] [ Use memset, see 'man bzero' ] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/call-graph-from-postgresql.py')
0 files changed, 0 insertions, 0 deletions