From: Jiri Olsa <jolsa@redhat.com>
To: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
Anton Blanchard <anton@au1.ibm.com>,
Maynard Johnson <mpjohn@us.ibm.com>,
ulrich.weigand@de.ibm.com,
Michael Ellerman <michaele@au1.ibm.com>,
linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 1/1] powerpc/perf: Adjust callchain based on DWARF debug info
Date: Wed, 25 Jun 2014 09:42:48 +0200 [thread overview]
Message-ID: <20140625074248.GC1153@krava.brq.redhat.com> (raw)
In-Reply-To: <20140625000052.GA4484@us.ibm.com>
On Tue, Jun 24, 2014 at 05:00:52PM -0700, Sukadev Bhattiprolu wrote:
> [PATCH v5 1/1] powerpc/perf: Adjust callchain based on DWARF debug info
superflous ^^^
>
> When saving the callchain on Power, the kernel conservatively saves excess
> entries in the callchain. A few of these entries are needed in some cases
> but not others. We should use the DWARF debug information to determine
> when the entries are needed.
SNIP
> diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
> index 0e5fea9..6221d01 100644
> --- a/tools/perf/util/machine.c
> +++ b/tools/perf/util/machine.c
> @@ -1291,7 +1291,9 @@ static int machine__resolve_callchain_sample(struct machine *machine,
> u8 cpumode = PERF_RECORD_MISC_USER;
> int chain_nr = min(max_stack, (int)chain->nr);
> int i;
> + int j;
> int err;
> + int skip_idx;
>
> callchain_cursor_reset(&callchain_cursor);
>
> @@ -1300,14 +1302,26 @@ static int machine__resolve_callchain_sample(struct machine *machine,
> return 0;
> }
>
> + /*
> + * Based on DWARF debug information, some architectures skip
> + * a callchain entry saved by the kernel.
> + */
> + skip_idx = arch_skip_callchain_idx(machine, thread, chain);
> +
> for (i = 0; i < chain_nr; i++) {
> u64 ip;
> struct addr_location al;
>
> if (callchain_param.order == ORDER_CALLEE)
> - ip = chain->ips[i];
> + j = i;
> else
> - ip = chain->ips[chain->nr - i - 1];
> + j = chain->nr - i - 1;
> +
> +#ifdef HAVE_SKIP_CALLCHAIN_IDX
> + if (j == skip_idx)
> + continue;
> +#endif
> + ip = chain->ips[j];
>
> if (ip >= PERF_CONTEXT_MAX) {
> switch (ip) {
> --
> 1.7.9.5
>
got following compile error:
CC util/map.o
util/machine.c: In function ‘machine__resolve_callchain_sample’:
util/machine.c:1286:6: error: variable ‘skip_idx’ set but not used [-Werror=unused-but-set-variable]
int skip_idx;
^
cc1: all warnings being treated as errors
make[2]: *** [util/machine.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [all] Error 2
test: test -x ./perf
make: *** [make_pure] Error 1
you could use __maybe_unused for the 'skip_idx'
jirka
next prev parent reply other threads:[~2014-06-25 7:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-25 0:00 Sukadev Bhattiprolu
2014-06-25 7:42 ` Jiri Olsa [this message]
2014-06-25 15:49 ` Sukadev Bhattiprolu
2014-07-05 10:42 ` [tip:perf/core] perf tools powerpc: " tip-bot for Sukadev Bhattiprolu
2014-09-22 21:33 ` [PATCH v5 1/1] powerpc/perf: " Aaro Koskinen
2014-09-23 6:59 ` Jiri Olsa
2014-09-23 16:26 ` Sukadev Bhattiprolu
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=20140625074248.GC1153@krava.brq.redhat.com \
--to=jolsa@redhat.com \
--cc=acme@kernel.org \
--cc=anton@au1.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=michaele@au1.ibm.com \
--cc=mpjohn@us.ibm.com \
--cc=sukadev@linux.vnet.ibm.com \
--cc=ulrich.weigand@de.ibm.com \
/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