diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2013-05-14 11:09:02 +0900 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-05-28 16:24:00 +0300 |
commit | 27a0dcb7adb52473dd98d285a46b764b9219d303 (patch) | |
tree | 52deb89bf5ef67e3749b2e2a026837a76f93d3f2 /tools/perf/builtin-top.c | |
parent | 3a5714f8b58913ded4d9e90abdd30e7e5993f863 (diff) | |
download | op-kernel-dev-27a0dcb7adb52473dd98d285a46b764b9219d303.zip op-kernel-dev-27a0dcb7adb52473dd98d285a46b764b9219d303.tar.gz |
perf hists: Move locking to its call-sites
It's a preparation patch to eliminate unneeded locking in the perf
report path.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1368497347-9628-5-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r-- | tools/perf/builtin-top.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 5cd41ec..c2c9734 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -245,8 +245,11 @@ static struct hist_entry *perf_evsel__add_hist_entry(struct perf_evsel *evsel, { struct hist_entry *he; + pthread_mutex_lock(&evsel->hists.lock); he = __hists__add_entry(&evsel->hists, al, NULL, sample->period, sample->weight); + pthread_mutex_unlock(&evsel->hists.lock); + if (he == NULL) return NULL; |