diff options
author | Namhyung Kim <namhyung@kernel.org> | 2015-05-18 09:30:40 +0900 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-05-18 10:17:36 -0300 |
commit | 4a936edc317005e8cd2b501e7865721bec104544 (patch) | |
tree | 5060ee93fb06786372c782e0f3951228a2c72f1d /tools/perf/util/dso.c | |
parent | 9c9f5a2f1944e8b6bf2b618d04b31e1c1760637e (diff) | |
download | lwn-4a936edc317005e8cd2b501e7865721bec104544.tar.gz lwn-4a936edc317005e8cd2b501e7865721bec104544.zip |
perf symbols: Protect dso symbol loading using a mutex
Add mutex to protect it from concurrent dso__load().
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1431909055-21442-26-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/dso.c')
-rw-r--r-- | tools/perf/util/dso.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index 13d9ae0bd15c..482d6024ef13 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c @@ -936,6 +936,7 @@ struct dso *dso__new(const char *name) RB_CLEAR_NODE(&dso->rb_node); INIT_LIST_HEAD(&dso->node); INIT_LIST_HEAD(&dso->data.open_entry); + pthread_mutex_init(&dso->lock, NULL); } return dso; @@ -966,6 +967,7 @@ void dso__delete(struct dso *dso) dso_cache__free(&dso->data.cache); dso__free_a2l(dso); zfree(&dso->symsrc_filename); + pthread_mutex_destroy(&dso->lock); free(dso); } |