perf probe: Speed up perf probe --list by caching debuginfo
authorMasami Hiramatsu <[email protected]>
Wed, 17 Jun 2015 14:58:54 +0000 (23:58 +0900)
committerArnaldo Carvalho de Melo <[email protected]>
Wed, 17 Jun 2015 19:37:53 +0000 (16:37 -0300)
commit7737af010b097f3c1e2aeded21774d58b4aa2698
tree58e1d8dae9259063d165eb673490561a0d97a720
parentd350bd571ffa89fc3bd07cfa9685d5210f459be8
perf probe: Speed up perf probe --list by caching debuginfo

Speed up the "perf probe --list" by caching the last used debuginfo.
perf probe --list always open and load debuginfo for each entry of probe
list. This takes very a long time.

E.g. with vfs_* events (total 96 probes)

  [root@localhost perf]# time  ./perf probe -l &> /dev/null

  real    0m25.376s
  user    0m24.381s
  sys     0m1.012s

To solve this issue, this adds debuginfo_cache to cache the
last used debuginfo on memory.

With this fix, the perf-probe --list significantly improves
its speed.

  [root@localhost perf]#  time  ./perf probe -l &> /dev/null

  real    0m0.161s
  user    0m0.136s
  sys     0m0.025s

Signed-off-by: Masami Hiramatsu <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Naohiro Aota <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/util/probe-event.c