diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2013-05-13 22:09:02 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-05-28 09:24:00 -0400 |
commit | 27a0dcb7adb52473dd98d285a46b764b9219d303 (patch) | |
tree | 52deb89bf5ef67e3749b2e2a026837a76f93d3f2 /tools/perf/util/hist.c | |
parent | 3a5714f8b58913ded4d9e90abdd30e7e5993f863 (diff) |
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/util/hist.c')
-rw-r--r-- | tools/perf/util/hist.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 7e0fa628e9ab..b11a6cfdb414 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
@@ -347,8 +347,6 @@ static struct hist_entry *add_hist_entry(struct hists *hists, | |||
347 | struct hist_entry *he; | 347 | struct hist_entry *he; |
348 | int cmp; | 348 | int cmp; |
349 | 349 | ||
350 | pthread_mutex_lock(&hists->lock); | ||
351 | |||
352 | p = &hists->entries_in->rb_node; | 350 | p = &hists->entries_in->rb_node; |
353 | 351 | ||
354 | while (*p != NULL) { | 352 | while (*p != NULL) { |
@@ -394,14 +392,12 @@ static struct hist_entry *add_hist_entry(struct hists *hists, | |||
394 | 392 | ||
395 | he = hist_entry__new(entry); | 393 | he = hist_entry__new(entry); |
396 | if (!he) | 394 | if (!he) |
397 | goto out_unlock; | 395 | return NULL; |
398 | 396 | ||
399 | rb_link_node(&he->rb_node_in, parent, p); | 397 | rb_link_node(&he->rb_node_in, parent, p); |
400 | rb_insert_color(&he->rb_node_in, hists->entries_in); | 398 | rb_insert_color(&he->rb_node_in, hists->entries_in); |
401 | out: | 399 | out: |
402 | hist_entry__add_cpumode_period(he, al->cpumode, period); | 400 | hist_entry__add_cpumode_period(he, al->cpumode, period); |
403 | out_unlock: | ||
404 | pthread_mutex_unlock(&hists->lock); | ||
405 | return he; | 401 | return he; |
406 | } | 402 | } |
407 | 403 | ||