Re: Re: [PATCH perf/core v3 3/3] [BUGFIX] perf probe: Show usage even if the last event is skipped

Arnaldo Carvalho de Melo
2015-06-17T15:00:52Z

Em Wed, Jun 17, 2015 at 11:58:18PM +0900, Masami Hiramatsu escreveu:
> On 2015/06/17 14:31, Masami Hiramatsu wrote:
> >> > I.e. the only problem I found was this:
> >> >
> >> > [root@zoo ~]# time perf probe -l > /dev/null
> >> >
> >> > real 0m15.408s
> >> > user 0m14.892s
> >> > sys 0m0.534s
> >> > [root@zoo ~]#
> >> > [root@zoo ~]# perf stat perf probe -l > /dev/null
> >> >
> >> > Performance counter stats for 'perf probe -l':
> >> >
> >> > 15256.588897 task-clock (msec) # 1.001 CPUs utilized
> >> > 116 context-switches # 0.008 K/sec
> >> > 4 cpu-migrations # 0.000 K/sec
> >> > 230,720 page-faults # 0.015 M/sec
> >> > 47,830,405,530 cycles # 3.135 GHz
> >> > 43,974,134,505 stalled-cycles-frontend # 91.94% frontend cycles idle
> >> > <not supported> stalled-cycles-backend
> >> > 11,540,587,038 instructions # 0.24 insns per cycle
> >> > # 3.81 stalled cycles per insn
> >> > 2,807,769,592 branches # 184.037 M/sec
> >> > 20,087,075 branch-misses # 0.72% of all branches
> >> >
> >> > 15.240796324 seconds time elapsed
> >> >
> >> > [root@zoo ~]#
> >> >
> >> > Can you check why it takes so long and check the need for this patch?
> > It is because perf probe -l is not optimized to show a lot of probes yet.
> > It initializes and loads debuginfo for each probe. I guess we can reuse
> > debuginfo among them. let me try...
> >
>
> OK, I've ensured that's true,
>
> [root@localhost perf]# time ./perf probe -l &> /dev/null
>
> real 0m25.376s
> user 0m24.381s
> sys 0m1.012s
>
> [root@localhost perf]# time ./perf probe --no-dwarf -l &> /dev/null
>
> real 0m0.059s
> user 0m0.039s
> sys 0m0.020s
>
> (Note that --no-dwarf is my local patch for debugging, not sending yet)
>
> So, the problem is on the debuginfo processing. I've also fixed that
> by caching the last used debuginfo. :)
>
> [root@localhost perf]# time ./perf probe -l &> /dev/null
>
> real 0m0.161s
> user 0m0.136s
> sys 0m0.025s
>
> I'll send the patch asap.

Thanks! I really need to go thru builtin-probe.c looking at how it uses
the symbol functions, to see what I can change in symbol*.[ch] to help
it with its needs.

Till then tho, please send the patch, that is a really great speedup! :-)

- Arnaldo