perf probe: Speed up perf probe --list by caching debuginfo
authorMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Wed, 17 Jun 2015 14:58:54 +0000 (23:58 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
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 <masami.hiramatsu.pt@hitachi.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Naohiro Aota <naota@elisp.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20150617145854.19715.15314.stgit@localhost.localdomain
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/probe-event.c