From: Jiri Olsa <jolsa@redhat.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Ingo Molnar <mingo@kernel.org>, Paul Mackerras <paulus@samba.org>,
Namhyung Kim <namhyung.kim@lge.com>,
LKML <linux-kernel@vger.kernel.org>,
Jean Pihet <jean.pihet@linaro.org>, Arun Sharma <asharma@fb.com>
Subject: Re: [PATCH 1/2] perf callchain: Create an address space per thread
Date: Tue, 23 Sep 2014 14:24:37 +0200 [thread overview]
Message-ID: <20140923122437.GE2979@krava.brq.redhat.com> (raw)
In-Reply-To: <1411453828-14832-1-git-send-email-namhyung@kernel.org>
On Tue, Sep 23, 2014 at 03:30:27PM +0900, Namhyung Kim wrote:
> The unw_addr_space_t in libunwind represents an address space to be
> used for stack unwinding. It doesn't need to be create/destory
> everytime to unwind callchain (as in get_entries) and can have a same
> lifetime as thread (unless exec called).
>
> So move the address space construction/destruction logic to the thread
> lifetime handling functions. This is a preparation to enable caching
> in the unwind library.
>
> Cc: Jiri Olsa <jolsa@redhat.com>
> Cc: Jean Pihet <jean.pihet@linaro.org>
> Cc: Arun Sharma <asharma@fb.com>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
> tools/perf/util/thread.c | 8 ++++++++
> tools/perf/util/unwind-libunwind.c | 30 +++++++++++++++++++++++++-----
> tools/perf/util/unwind.h | 17 +++++++++++++++++
> 3 files changed, 50 insertions(+), 5 deletions(-)
>
> diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
> index a9df7f2c6dc9..c1fa4a3597ea 100644
> --- a/tools/perf/util/thread.c
> +++ b/tools/perf/util/thread.c
> @@ -7,6 +7,7 @@
> #include "util.h"
> #include "debug.h"
> #include "comm.h"
> +#include "unwind.h"
>
> int thread__init_map_groups(struct thread *thread, struct machine *machine)
> {
> @@ -48,6 +49,12 @@ struct thread *thread__new(pid_t pid, pid_t tid)
> goto err_thread;
>
> list_add(&comm->list, &thread->comm_list);
> +
> + if (unwind__prepare_access(thread) < 0) {
you could call list_add below this call and thus save
the list_del call below in error path
looks like you dont need comm to be on comm_list within
the unwind__prepare_access call
> + list_del(&comm->list);
> + free(comm);
> + goto err_thread;
> + }
> }
SNIP
jirka
next prev parent reply other threads:[~2014-09-23 12:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-23 6:30 Namhyung Kim
2014-09-23 6:30 ` [PATCH 2/2] perf callchain: Use global caching provided by libunwind Namhyung Kim
2014-09-23 12:28 ` Jiri Olsa
2014-09-23 12:53 ` Namhyung Kim
2014-09-24 1:04 ` Namhyung Kim
2014-09-23 14:01 ` Arun Sharma
2014-09-24 2:24 ` Namhyung Kim
2014-09-24 13:45 ` Jean Pihet
2014-09-26 5:50 ` Namhyung Kim
2014-09-26 7:14 ` Jean Pihet
2014-09-29 2:35 ` Namhyung Kim
2014-09-23 12:24 ` Jiri Olsa [this message]
2014-09-23 12:49 ` [PATCH 1/2] perf callchain: Create an address space per thread Namhyung Kim
2014-09-26 15:35 ` Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140923122437.GE2979@krava.brq.redhat.com \
--to=jolsa@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=asharma@fb.com \
--cc=jean.pihet@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung.kim@lge.com \
--cc=namhyung@kernel.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome