Re: Fw: Re: [PATCH 1/1] powerpc/perf: Adjust callchain based on DWARF debug info

From: Jiri Olsa
Date: Mon Jun 02 2014 - 10:12:54 EST


On Fri, May 30, 2014 at 05:59:25PM +0200, Jiri Olsa wrote:
> On Fri, May 30, 2014 at 08:50:19AM -0700, Sukadev Bhattiprolu wrote:
> > Jiri Olsa [jolsa@xxxxxxxxxx] wrote:
> > | On Fri, May 16, 2014 at 02:03:33PM -0700, Sukadev Bhattiprolu wrote:
> > | > Hi Arnaldo, Jiri
> > | >
> > | > Do you have any comments on this patch ? Pls let me know if you need
> > | > me to resend this. The TODO is for a less frequent case and can be
> > | > addressed independently.
> > |
> > | hi,
> > | I can take it, but it does not apply to my perf/core,
> > | there're some ARM related unwind changes already:
> > | git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
> > |
> > | please resend updated patch
> >
> > Jiri,
> >
> > I resent the patch. Can you please let me know if you have any
> > comments ?
> >
> > https://lkml.org/lkml/2014/5/22/695
>
> sry, got distracted.. yep, that one seems looks ok now, I'll queue it
>

so.. I tried some performance test and looks like this
adds some considerable penalty also for archs != powerpc

test data:
$ sudo ./perf record -a -g -F 50000 # perf.data size is ~1.1GB

before your patch:

Performance counter stats for './perf.old report --stdio' (5 runs):

60,345,248,146 cycles ( +- 0.50% ) âââââ
72,766,496,819 instructions # 1.21 insns per cycle ( +- 0.00% ) âââââ

19.930324523 seconds time elapsed ( +- 1.07% ) âââââ

with your patch:
62,559,079,470 cycles ( +- 2.10% ) âââââ
72,649,781,930 instructions # 1.16 insns per cycle ( +- 0.00% ) âââââ

23.355028944 seconds time elapsed ( +- 9.85% ) âââââ


I think the issue is following hunk (I havent verified with record/report):

@@ -1300,14 +1301,25 @@ static int machine__resolve_callchain_sample(struct machine *machine,
return 0;
}

+ /*
+ * Based on DWARF debug information, some architectures skip
+ * some of the callchain entries saved by the kernel.
+ */
+ skip_slot = 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)
+ if (callchain_param.order == ORDER_CALLEE) {
+ if (i == skip_slot)
+ continue;
ip = chain->ips[i];
- else
+ } else {
+ if ((int)(chain->nr - i - 1) == skip_slot)
+ continue;
ip = chain->ips[chain->nr - i - 1];
+ }


could you please change this, so it's nop for arch != powerpc
via #ifdef I guess.. or some other smart way ;-)

adding some other folks and lkml to the loop

thanks,
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/