perf top: Access hists->lock only if needed
authorNamhyung Kim <namhyung@kernel.org>
Fri, 11 Dec 2015 02:56:54 +0000 (11:56 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 11 Dec 2015 11:34:49 +0000 (08:34 -0300)
commit151ee834cc946fa159ee406c62b4d5ce1ebd7115
tree6fb57dae8b814f4553b62936eccb3edda8468248
parent64226bcf64629996948dc03c38594f00511bfc2b
perf top: Access hists->lock only if needed

The perf_top__record_precise_ip() releases and regrabs the
he->hists->lock because it can sleep if there's an error.  But it should
be done conditionally as it slows down the fast path.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1449802616-16170-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-top.c