perf tools: Lock to protect namespaces and comm list
authorKan Liang <kan.liang@intel.com>
Fri, 29 Sep 2017 14:47:52 +0000 (07:47 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 3 Oct 2017 12:27:27 +0000 (09:27 -0300)
commitb32ee9e522f7ba26339856a047cfe9efc0be0ff3
treedcc085afc2c85c1bdfb1689ef75cbe94a3916ec7
parent22905582f6dd4bbd0c370fe5732c607452010c04
perf tools: Lock to protect namespaces and comm list

Add two locks to protect namespaces_list and comm_list.

The lock is only needed for multithreaded code, so using mutex wrappers
provided by perf tool.

Not all the comm_list/namespaces_list accessing are protected, e.g.
thread__exec_comm. Because the multithread code for perf top event
synthesizing does not touch them. They don't need a lock.

Signed-off-by: Kan Liang <kan.liang@intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Lukasz Odzioba <lukasz.odzioba@intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1506696477-146932-2-git-send-email-kan.liang@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/thread.c
tools/perf/util/thread.h