linux-xiaomi-chiron/tools/perf/util
Frank Ch. Eigler c7a14fdcb3 perf build-ids: Fall back to debuginfod query if debuginfo not found
During a perf-record, use the -ldebuginfod API to query a debuginfod
server, should the debug data not be found in the usual system
locations.  If successful, the usual $HOME/.debug dir is populated.

Tested with:

  $ find .
  .
  ./ctags-debuginfo-5.8-26.fc31.x86_64.rpm
  ./usr
  ./usr/lib
  ./usr/lib/debug
  ./usr/lib/debug/.build-id
  ./usr/lib/debug/.build-id/ca
  ./usr/lib/debug/.build-id/ca/46f6ae6a0cee57d85abc1d461c49074248908d
  ./usr/lib/debug/.build-id/ca/46f6ae6a0cee57d85abc1d461c49074248908d.debug
  ./usr/lib/debug/usr
  ./usr/lib/debug/usr/bin
  ./usr/lib/debug/usr/bin/ctags-5.8-26.fc31.x86_64.debug

  $ debuginfod  -F .
  ...

  $ rm -rf ~/.debug/ ; mkdir ~/.debug

  $ perf record make tags
    BUILD:   Doing 'make -j8' parallel build
    GEN      tags
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.107 MB perf.data (1483 samples) ]

  $ find ~/.debug | grep ctags
  /home/jolsa/.debug/usr/bin/ctags
  /home/jolsa/.debug/usr/bin/ctags/ca46f6ae6a0cee57d85abc1d461c49074248908d
  /home/jolsa/.debug/usr/bin/ctags/ca46f6ae6a0cee57d85abc1d461c49074248908d/elf
  /home/jolsa/.debug/usr/bin/ctags/ca46f6ae6a0cee57d85abc1d461c49074248908d/probes

  $ rm -rf ~/.debug/ ; mkdir ~/.debug

  $ DEBUGINFOD_URLS=http://localhost:8002 perf record make tags
    BUILD:   Doing 'make -j8' parallel build
    GEN      tags
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.108 MB perf.data (1531 samples) ]

  $ find ~/.debug | grep ctag
  /home/jolsa/.debug/usr/bin/ctags
  /home/jolsa/.debug/usr/bin/ctags/ca46f6ae6a0cee57d85abc1d461c49074248908d
  /home/jolsa/.debug/usr/bin/ctags/ca46f6ae6a0cee57d85abc1d461c49074248908d/debug
  /home/jolsa/.debug/usr/bin/ctags/ca46f6ae6a0cee57d85abc1d461c49074248908d/elf
  /home/jolsa/.debug/usr/bin/ctags/ca46f6ae6a0cee57d85abc1d461c49074248908d/probes

Note the 'debug' file is created in the last run.

Note that currently the debuginfo data are downloaded only on record path,
we still need add this support to perf build-id/report.. and test ;-)

Tested-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2020-08-14 09:51:14 -03:00
..
arm-spe-decoder perf arm-spe: Support synthetic events 2020-06-01 12:24:23 -03:00
c++
cs-etm-decoder perf: cs-etm: Update to build with latest opencsd version. 2020-05-05 16:35:32 -03:00
include
intel-pt-decoder perf intel-pt: Add support for decoding PSB+ only 2020-08-06 09:02:43 -03:00
libunwind
scripting-engines perf evsel: Rename *perf_evsel__*name() to *evsel__*name() 2020-05-05 16:35:30 -03:00
affinity.c
affinity.h
annotate.c perf annotate: Fix non-null terminated buffer returned by readlink() 2020-07-09 12:36:50 -03:00
annotate.h perf tools: Replace zero-length array with flexible-array 2020-05-28 10:03:27 -03:00
archinsn.h
arm-spe.c perf arm-spe: Support synthetic events 2020-06-01 12:24:23 -03:00
arm-spe.h
auxtrace.c perf auxtrace: Add itrace 'q' option for quicker, less detailed decoding 2020-08-06 08:24:03 -03:00
auxtrace.h perf auxtrace: Add itrace 'q' option for quicker, less detailed decoding 2020-08-06 08:24:03 -03:00
block-info.c
block-info.h
block-range.c
block-range.h
bpf-event.c perf bpf: Decouple creating the evlist from adding the SB event 2020-05-05 16:35:29 -03:00
bpf-event.h perf bpf: Decouple creating the evlist from adding the SB event 2020-05-05 16:35:29 -03:00
bpf-loader.c perf bpf-loader: Add missing '*' for key_scan_pos 2020-05-28 10:03:27 -03:00
bpf-loader.h
bpf-prologue.c perf bpf: Fix bpf prologue generation 2020-06-09 12:40:04 -03:00
bpf-prologue.h
bpf_map.c
bpf_map.h
branch.c
branch.h perf branch: Replace zero-length array with flexible-array 2020-05-28 10:03:27 -03:00
Build perf tools: Add general function to parse sublevel options 2020-08-14 09:15:47 -03:00
build-id.c perf build-ids: Fall back to debuginfod query if debuginfo not found 2020-08-14 09:51:14 -03:00
build-id.h
cache.h
cacheline.c
cacheline.h
call-path.c
call-path.h
callchain.c perf callchain: Setup callchain properly in pipe mode 2020-05-28 10:03:25 -03:00
callchain.h perf callchain: Setup callchain properly in pipe mode 2020-05-28 10:03:25 -03:00
cap.c
cap.h
cgroup.c perf cgroup: Avoid needless closing of unopened fd 2020-04-22 10:01:33 -03:00
cgroup.h
clockid.c perf tools: Add clockid_name function 2020-08-06 09:33:57 -03:00
clockid.h perf tools: Add clockid_name function 2020-08-06 09:33:57 -03:00
cloexec.c perf tool: Make perf tool aware of SELinux access control 2020-05-28 10:03:26 -03:00
cloexec.h
color.c
color.h
color_config.c
comm.c
comm.h
compress.h
config.c perf tools: Remove some duplicated includes 2020-06-02 11:09:41 -03:00
config.h
copyfile.c
copyfile.h
counts.c perf counts: Reset prev_raw_counts counts 2020-05-28 10:03:27 -03:00
counts.h perf counts: Reset prev_raw_counts counts 2020-05-28 10:03:27 -03:00
cpu-set-sched.h
cpumap.c
cpumap.h
cputopo.c
cputopo.h perf tools: Replace zero-length array with flexible-array 2020-05-28 10:03:27 -03:00
cs-etm.c perf cs-etm: Move definition of 'traceid_list' global variable from header file 2020-05-05 16:35:32 -03:00
cs-etm.h perf cs-etm: Move definition of 'traceid_list' global variable from header file 2020-05-05 16:35:32 -03:00
data-convert-bt.c perf data: Add support to store time of day in CTF data conversion 2020-08-06 09:43:37 -03:00
data-convert-bt.h
data-convert.h perf data: Add support to store time of day in CTF data conversion 2020-08-06 09:43:37 -03:00
data.c
data.h
db-export.c
db-export.h
debug.c perf tools: Add general function to parse sublevel options 2020-08-14 09:15:47 -03:00
debug.h
demangle-java.c perf jvmti: Fix demangling Java symbols 2020-05-28 10:03:28 -03:00
demangle-java.h
demangle-rust.c
demangle-rust.h
dso.c perf tools: Rename 'enum dso_kernel_type' to 'enum dso_space_type' 2020-08-13 09:53:21 -03:00
dso.h perf tools: Rename 'enum dso_kernel_type' to 'enum dso_space_type' 2020-08-13 09:53:21 -03:00
dsos.c
dsos.h
dump-insn.c
dump-insn.h
dwarf-aux.c
dwarf-aux.h
dwarf-regs.c
env.c
env.h perf tools: Move clockid_res_ns under clock struct 2020-08-06 09:42:20 -03:00
event.c perf script: Show text poke address symbol 2020-07-10 08:39:14 -03:00
event.h perf script: Show text poke address symbol 2020-07-10 08:39:14 -03:00
events_stats.h
evlist.c perf evlist: Implement control command handling functions 2020-07-22 09:28:04 -03:00
evlist.h perf stat: extend -D,--delay option with -1 value 2020-07-22 10:00:11 -03:00
evsel.c perf evsel: Extend message to mention CAP_SYS_PTRACE and perf security doc link 2020-08-06 09:04:23 -03:00
evsel.h perf record: Fix duplicated sideband events with Intel PT system wide tracing 2020-07-03 08:16:51 -03:00
evsel_config.h perf evsel: Rename *perf_evsel__get_config_term() & friends to evsel__env() 2020-05-28 10:03:24 -03:00
evsel_fprintf.c perf evsel: Rename perf_evsel__fprintf() to evsel__fprintf() 2020-05-28 10:03:24 -03:00
evsel_fprintf.h perf evsel: Rename perf_evsel__fprintf() to evsel__fprintf() 2020-05-28 10:03:24 -03:00
evswitch.c
evswitch.h
expr.c perf metric: Add recursion check when processing nested metrics 2020-07-30 07:01:49 -03:00
expr.h perf metric: Add recursion check when processing nested metrics 2020-07-30 07:01:49 -03:00
expr.l perf expr: Add < and > operators 2020-06-22 16:28:09 -03:00
expr.y perf metric: Compute referenced metrics 2020-07-30 07:01:49 -03:00
find-map.c
fncache.c
fncache.h
genelf.c
genelf.h
genelf_debug.c perf jit: Fix inaccurate DWARF line table 2020-05-29 16:51:38 -03:00
generate-cmdlist.sh
get_current_dir_name.c
get_current_dir_name.h
group.h
hashmap.c perf tools: Grab a copy of libbpf's hashmap 2020-05-28 10:03:26 -03:00
hashmap.h perf tools: Sync hashmap.h with libbpf's 2020-07-17 09:35:18 -03:00
header.c perf tools: Fix module symbol processing 2020-08-13 09:57:40 -03:00
header.h perf header: Store clock references for -k/--clockid option 2020-08-06 09:35:06 -03:00
help-unknown-cmd.c
help-unknown-cmd.h
hist.c perf evsel: Rename perf_evsel__resort*() to evsel__resort*() 2020-05-28 10:03:24 -03:00
hist.h perf evsel: Rename perf_evsel__resort*() to evsel__resort*() 2020-05-28 10:03:24 -03:00
intel-bts.c perf evsel: Rename __perf_evsel__sample_size() to __evsel__sample_size() 2020-05-05 16:35:30 -03:00
intel-bts.h
intel-pt.c perf intel-pt: Add support for decoding FUP/TIP only 2020-08-06 09:02:14 -03:00
intel-pt.h
intlist.c
intlist.h
jit.h
jitdump.c perf inject jit: Remove //anon mmap events 2020-07-08 13:51:12 -03:00
jitdump.h perf tools: Replace zero-length array with flexible-array 2020-05-28 10:03:27 -03:00
kvm-stat.h
levenshtein.c
levenshtein.h
llvm-utils.c
llvm-utils.h
lzma.c
machine.c perf tools: Rename 'enum dso_kernel_type' to 'enum dso_space_type' 2020-08-13 09:53:21 -03:00
machine.h perf tools: Add support for PERF_RECORD_TEXT_POKE 2020-07-10 08:20:01 -03:00
map.c perf tools: Rename 'enum dso_kernel_type' to 'enum dso_space_type' 2020-08-13 09:53:21 -03:00
map.h perf tools: Add support for PERF_RECORD_KSYMBOL_TYPE_OOL 2020-07-10 08:30:25 -03:00
map_symbol.h
maps.h
mem-events.c perf c2c: Fix 'perf c2c record -e list' to show the default events used 2020-05-28 10:03:25 -03:00
mem-events.h perf c2c: Fix 'perf c2c record -e list' to show the default events used 2020-05-28 10:03:25 -03:00
mem2node.c perf mem2node: Avoid double free related to realloc 2020-05-05 16:35:30 -03:00
mem2node.h
memswap.c
memswap.h
metricgroup.c perf metric: Rename group_list to metric_list 2020-07-30 07:01:50 -03:00
metricgroup.h perf metric: Collect referenced metrics in struct metric_expr 2020-07-30 07:01:49 -03:00
mmap.c
mmap.h
namespaces.c
namespaces.h
ordered-events.c perf tools: Remove unneeded semicolons 2020-04-30 10:48:32 -03:00
ordered-events.h perf tools: Replace zero-length array with flexible-array 2020-05-28 10:03:27 -03:00
parse-branch-options.c
parse-branch-options.h
parse-events.c perf tools: Fix term parsing for raw syntax 2020-07-30 07:01:48 -03:00
parse-events.h perf tools: Fix term parsing for raw syntax 2020-07-30 07:01:48 -03:00
parse-events.l perf tools: Fix term parsing for raw syntax 2020-07-30 07:01:48 -03:00
parse-events.y perf tools: Add fake pmu support 2020-06-22 16:28:08 -03:00
parse-regs-options.c
parse-regs-options.h
parse-sublevel-options.c perf tools: Add general function to parse sublevel options 2020-08-14 09:15:47 -03:00
parse-sublevel-options.h perf tools: Add general function to parse sublevel options 2020-08-14 09:15:47 -03:00
path.c
path.h
perf-hooks-list.h
perf-hooks.c
perf-hooks.h
PERF-VERSION-GEN
perf_api_probe.c perf tools: Add support for PERF_RECORD_TEXT_POKE 2020-07-10 08:20:01 -03:00
perf_api_probe.h perf tools: Add support for PERF_RECORD_TEXT_POKE 2020-07-10 08:20:01 -03:00
perf_event_attr_fprintf.c perf tools: Add support for PERF_RECORD_TEXT_POKE 2020-07-10 08:20:01 -03:00
perf_regs.c
perf_regs.h
pfm.c perf tools: Add optional support for libpfm4 2020-05-29 16:51:38 -03:00
pfm.h perf tools: Add optional support for libpfm4 2020-05-29 16:51:38 -03:00
pmu.c perf pmu: Improve CPU core PMU HW event list ordering 2020-06-22 16:28:09 -03:00
pmu.h perf pmu: Add a perf_pmu__fake object to use with __parse_events() 2020-06-22 16:28:08 -03:00
pmu.l
pmu.y
print_binary.c
print_binary.h
probe-event.c perf probe: Warn if the target function is a GNU indirect function 2020-07-17 09:09:47 -03:00
probe-event.h
probe-file.c perf probe: Fix user attribute access in kprobes 2020-06-09 12:40:04 -03:00
probe-file.h
probe-finder.c perf probe: Fix memory leakage when the probe point is not found 2020-07-17 09:09:46 -03:00
probe-finder.h
pstack.c perf tools: Replace zero-length array with flexible-array 2020-05-28 10:03:27 -03:00
pstack.h
python-ext-sources
python.c perf evsel: Rename perf_evsel__parse_sample*() to evsel__parse_sample*() 2020-05-05 16:35:31 -03:00
rb_resort.h
rblist.c
rblist.h
record.c perf evsel: Rename *perf_evsel__read*() to *evsel__read() 2020-05-05 16:35:31 -03:00
record.h perf record: Introduce --control fd:ctl-fd[,ack-fd] options 2020-08-04 08:50:52 -03:00
rlimit.c
rlimit.h
rwsem.c
rwsem.h
s390-cpumcf-kernel.h
s390-cpumsf-kernel.h
s390-cpumsf.c perf auxtrace: Add option to synthesize branch stack for regular events 2020-05-05 16:35:29 -03:00
s390-cpumsf.h
s390-sample-raw.c
sample-raw.c
sample-raw.h
session.c perf tools: Add support for PERF_RECORD_TEXT_POKE 2020-07-10 08:20:01 -03:00
session.h
setns.c
setup.py
sideband_evlist.c perf evsel: Rename perf_evsel__new*() to evsel__new*() 2020-05-28 10:03:24 -03:00
smt.c perf tools: Simplify checking if SMT is active. 2020-05-05 16:35:29 -03:00
smt.h
sort.c perf util: Fix memory leak of prefix_if_not_in 2020-05-28 10:03:27 -03:00
sort.h perf hist: Add fast path for duplicate entries check 2020-04-18 09:05:01 -03:00
spark.c
spark.h
srccode.c
srccode.h
srcline.c
srcline.h
stat-display.c perf stat: Fix NULL pointer dereference 2020-06-09 12:40:04 -03:00
stat-shadow.c perf metric: Add referenced metrics to hash data 2020-07-30 07:01:49 -03:00
stat.c perf stat: Report summary for interval mode 2020-05-28 10:03:27 -03:00
stat.h perf stat: Introduce --control fd:ctl-fd[,ack-fd] options 2020-08-04 08:48:58 -03:00
strbuf.c
strbuf.h
strfilter.c
strfilter.h
string.c
string2.h
strlist.c
strlist.h
svghelper.c
svghelper.h
symbol-elf.c perf tools: Fix module symbol processing 2020-08-13 09:57:40 -03:00
symbol-minimal.c
symbol.c perf tools: Rename 'enum dso_kernel_type' to 'enum dso_space_type' 2020-08-13 09:53:21 -03:00
symbol.h perf tools: Replace zero-length array with flexible-array 2020-05-28 10:03:27 -03:00
symbol_conf.h
symbol_fprintf.c
symsrc.h
synthetic-events.c perf tools: Remove unneeded semicolons 2020-04-30 10:48:32 -03:00
synthetic-events.h
syscalltbl.c perf trace: Use zalloc() to make sure all fields are zeroed in the syscalltbl constructor 2020-05-29 16:50:29 -03:00
syscalltbl.h perf trace: Remove union from syscalltbl, all the fields are needed 2020-05-29 16:50:26 -03:00
target.c
target.h
term.c
term.h
thread-stack.c perf thread-stack: Add thread_stack__br_sample_late() 2020-05-05 16:35:29 -03:00
thread-stack.h perf thread-stack: Add thread_stack__br_sample_late() 2020-05-05 16:35:29 -03:00
thread.c perf callchain: Stitch LBR call stack 2020-04-18 09:05:01 -03:00
thread.h perf callchain: Stitch LBR call stack 2020-04-18 09:05:01 -03:00
thread_map.c
thread_map.h
time-utils.c
time-utils.h
tool.h perf tools: Add support for PERF_RECORD_TEXT_POKE 2020-07-10 08:20:01 -03:00
top.c perf evsel: Rename *perf_evsel__*name() to *evsel__*name() 2020-05-05 16:35:30 -03:00
top.h perf top: Move sb_evlist to 'struct perf_top' 2020-05-05 16:35:29 -03:00
trace-event-info.c perf util: Fix potential SEGFAULT in put_tracepoints_path error path 2020-05-28 10:03:27 -03:00
trace-event-parse.c
trace-event-read.c perf tools: Remove unneeded semicolons 2020-04-30 10:48:32 -03:00
trace-event-scripting.c
trace-event.c
trace-event.h
trigger.h
tsc.c
tsc.h
units.c
units.h
unwind-libdw.c
unwind-libdw.h
unwind-libunwind-local.c perf tools: Replace zero-length array with flexible-array 2020-05-28 10:03:27 -03:00
unwind-libunwind.c
unwind.h
usage.c
util.c
util.h
values.c
values.h
vdso.c
vdso.h
xyarray.c
zlib.c
zstd.c