[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140111163529.GF1131@krava.brq.redhat.com>
Date: Sat, 11 Jan 2014 17:35:29 +0100
From: Jiri Olsa <jolsa@...hat.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Paul Mackerras <paulus@...ba.org>,
Ingo Molnar <mingo@...nel.org>,
Namhyung Kim <namhyung.kim@....com>,
LKML <linux-kernel@...r.kernel.org>,
Arun Sharma <asharma@...com>,
Frederic Weisbecker <fweisbec@...il.com>,
Rodrigo Campos <rodrigo@...g.com.ar>
Subject: Re: [PATCH 25/28] perf top: Convert to hist_entry_iter
On Wed, Jan 08, 2014 at 05:46:30PM +0900, Namhyung Kim wrote:
> Reuse hist_entry_iter__add() function to share the similar code with
> perf report. Note that it needs to be called with hists.lock so tweak
> some internal functions not to deadlock or hold the lock too long.
>
> Signed-off-by: Namhyung Kim <namhyung@...nel.org>
> ---
> tools/perf/builtin-top.c | 75 ++++++++++++++++++++++++------------------------
> 1 file changed, 37 insertions(+), 38 deletions(-)
>
> diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
> index f0f55e6030cd..cf330c66bed7 100644
> --- a/tools/perf/builtin-top.c
> +++ b/tools/perf/builtin-top.c
> @@ -186,9 +186,6 @@ static void perf_top__record_precise_ip(struct perf_top *top,
> sym = he->ms.sym;
> notes = symbol__annotation(sym);
>
> - if (pthread_mutex_trylock(¬es->lock))
> - return;
> -
> ip = he->ms.map->map_ip(he->ms.map, ip);
> err = hist_entry__inc_addr_samples(he, counter, ip);
>
> @@ -201,6 +198,8 @@ static void perf_top__record_precise_ip(struct perf_top *top,
> sym->name);
> sleep(1);
> }
> +
> + pthread_mutex_lock(¬es->lock);
> }
locking on function exit.. does not look right ;-)
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists