android_kernel_xiaomi_sm8350/tools/perf/util
Ian Rogers 4cd5db4fc4 perf env: Avoid recursively taking env->bpf_progs.lock
[ Upstream commit 9c51f8788b5d4e9f46afbcf563255cfd355690b3 ]

Add variants of perf_env__insert_bpf_prog_info(), perf_env__insert_btf()
and perf_env__find_btf prefixed with __ to indicate the
env->bpf_progs.lock is assumed held.

Call these variants when the lock is held to avoid recursively taking it
and potentially having a thread deadlock with itself.

Fixes: f8dfeae009 ("perf bpf: Show more BPF program info in print_bpf_prog_info()")
Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Song Liu <song@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: K Prateek Nayak <kprateek.nayak@amd.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ming Wang <wangming01@loongson.cn>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Link: https://lore.kernel.org/r/20231207014655.1252484-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-01-25 14:34:31 -08:00
..
c++
cs-etm-decoder
include
intel-pt-decoder perf intel-pt: Fix CYC timestamps after standalone CBR 2023-05-17 11:35:56 +02:00
libunwind
scripting-engines
annotate.c perf annotate bpf: Don't enclose non-debug code with an assert() 2023-09-23 10:59:57 +02:00
annotate.h perf annotate: Don't return -1 for error when doing BPF disassembly 2019-09-30 17:30:06 -03:00
archinsn.h perf script: Support insn output for normal samples 2019-03-11 11:56:02 -03:00
arm-spe-pkt-decoder.c
arm-spe-pkt-decoder.h
arm-spe.c perf env: Remove needless cpumap.h header 2019-09-20 09:19:21 -03:00
arm-spe.h
auxtrace.c perf auxtrace: Fix address filter entire kernel size 2023-05-17 11:35:56 +02:00
auxtrace.h
block-range.c perf block-range: Add missing headers 2019-01-25 15:12:09 +01:00
block-range.h perf block-range: Add missing headers 2019-01-25 15:12:09 +01:00
bpf_map.c
bpf_map.h
bpf-event.c perf env: Avoid recursively taking env->bpf_progs.lock 2024-01-25 14:34:31 -08:00
bpf-event.h perf env: Avoid recursively taking env->bpf_progs.lock 2024-01-25 14:34:31 -08:00
bpf-loader.c libperf: Add perf_evlist__first()/last() functions 2019-09-25 09:51:48 -03:00
bpf-loader.h
bpf-prologue.c
bpf-prologue.h
branch.c
branch.h
Build perf evsel: Introduce evsel_fprintf.h 2019-09-25 16:26:34 -03:00
build-id.c
build-id.h
cache.h
cacheline.c perf tools: Remove perf.h from source files not needing it 2019-08-29 17:38:32 -03:00
cacheline.h
call-path.c
call-path.h
callchain.c
callchain.h
cap.c
cap.h perf tools: Add CAP_SYSLOG define for older systems 2019-08-14 10:59:59 -03:00
cgroup.c
cgroup.h
cloexec.c
cloexec.h
color_config.c
color.c
color.h
comm.c tools lib: Adopt zalloc()/zfree() from tools/perf 2019-07-09 10:13:26 -03:00
comm.h
compress.h
config.c perf auxtrace: Uninline functions that touch perf_session 2019-08-31 22:24:10 -03:00
config.h perf config: Call perf_config__init() lazily 2018-05-16 16:11:09 -03:00
copyfile.c perf tools: Fix mode setting in copyfile_mode_ns() 2019-10-15 12:05:18 -03:00
copyfile.h
counts.c
counts.h
cpu-set-sched.h
cpumap.c perf cpumap: Fix snprintf overflow check 2020-10-01 13:17:46 +02:00
cpumap.h libperf: Rename the PERF_RECORD_ structs to have a "perf" prefix 2019-08-29 08:36:12 -03:00
cputopo.c
cputopo.h
cs-etm.c perf cs-etm: Move definition of 'traceid_list' global variable from header file 2020-10-17 10:11:21 +02:00
cs-etm.h perf cs-etm: Move definition of 'traceid_list' global variable from header file 2020-10-17 10:11:21 +02:00
data-convert-bt.c
data-convert-bt.h
data-convert.h
data.c perf tools: Fix resources leak in perf_data__open_dir() 2023-01-18 11:41:58 +01:00
data.h
db-export.c
db-export.h
debug.c perf script: Fix hex dump character output 2022-01-27 09:19:54 +01:00
debug.h
demangle-java.c perf tools: Remove debug.h from places where it is not needed 2019-09-20 09:19:20 -03:00
demangle-java.h
demangle-rust.c
demangle-rust.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dso.c
dso.h perf symbols: Fix debuginfo search for Ubuntu 2020-06-22 09:31:27 +02:00
dsos.c
dsos.h perf dsos: Move the dsos struct and its methods to separate source files 2019-08-31 22:24:10 -03:00
dump-insn.c
dump-insn.h perf script: Fix LBR skid dump problems in brstackinsn 2018-12-28 16:33:02 -03:00
dwarf-aux.c perf dwarf-aux: Fix off-by-one in die_get_varname() 2023-07-27 08:37:17 +02:00
dwarf-aux.h
dwarf-regs.c
env.c perf env: Avoid recursively taking env->bpf_progs.lock 2024-01-25 14:34:31 -08:00
env.h perf env: Avoid recursively taking env->bpf_progs.lock 2024-01-25 14:34:31 -08:00
event.c perf tools: Fix DSO filtering when not finding a map for a sampled address 2021-03-04 10:26:32 +01:00
event.h
events_stats.h
evlist.c perf bpf: Decouple creating the evlist from adding the SB event 2024-01-25 14:34:31 -08:00
evlist.h perf bpf: Decouple creating the evlist from adding the SB event 2024-01-25 14:34:31 -08:00
evsel_config.h
evsel_fprintf.c
evsel_fprintf.h
evsel.c
evsel.h
evswitch.c
evswitch.h
expr.h
expr.y perf tools: Use %define api.pure full instead of %pure-parser 2021-04-16 11:46:38 +02:00
find-map.c
genelf_debug.c perf tools: Remove perf.h from source files not needing it 2019-08-29 17:38:32 -03:00
genelf.c perf genelf: Set ELF program header addresses properly 2024-01-25 14:34:31 -08:00
genelf.h perf jit: Include program header in ELF files 2022-09-28 11:04:07 +02:00
generate-cmdlist.sh
get_current_dir_name.c perf tools: Fixup get_current_dir_name() compilation 2022-10-15 07:54:36 +02:00
get_current_dir_name.h perf tools: Move get_current_dir_name() cond prototype out of util.h 2019-07-09 10:13:26 -03:00
group.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
header.c perf env: Avoid recursively taking env->bpf_progs.lock 2024-01-25 14:34:31 -08:00
header.h
help-unknown-cmd.c
help-unknown-cmd.h
hist.c perf tools: Fix time sorting 2019-11-05 08:49:14 -03:00
hist.h
intel-bts.c
intel-bts.h
intel-pt.c perf intel-pt: Fix segfault in intel_pt_print_info() with uClibc 2022-10-26 13:22:59 +02:00
intel-pt.h
intlist.c
intlist.h
jit.h
jitdump.c perf inject jit: Fix JIT_CODE_MOVE filename 2019-09-30 17:29:49 -03:00
jitdump.h
kvm-stat.h
levenshtein.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
levenshtein.h
llvm-utils.c perf llvm: Fix inadvertent file creation 2023-03-11 16:43:49 +01:00
llvm-utils.h perf tools: Remove debug.h from header files not needing it 2019-08-29 17:38:32 -03:00
lzma.c
machine.c
machine.h perf tools: Move event synthesizing routines to separate header 2019-09-20 09:19:22 -03:00
map_groups.h
map_symbol.h
map.c perf map: Tighten snprintf() string precision to pass gcc check on some 32-bit arches 2021-04-16 11:46:39 +02:00
map.h
mem2node.c
mem2node.h
mem-events.c
mem-events.h
memswap.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
memswap.h perf memswap: Adopt 'struct u64_swap' from evsel.h 2019-09-20 09:19:22 -03:00
metricgroup.c
metricgroup.h
mmap.c
mmap.h libperf: Add 'flush' to 'struct perf_mmap' 2019-09-25 09:51:46 -03:00
namespaces.c
namespaces.h
ordered-events.c
ordered-events.h
parse-branch-options.c
parse-branch-options.h
parse-events.c
parse-events.h
parse-events.l
parse-events.y perf tools: Use %define api.pure full instead of %pure-parser 2021-04-16 11:46:38 +02:00
parse-regs-options.c perf record: Fix memory leak when using '--user-regs=?' to list registers 2020-12-30 11:51:28 +01:00
parse-regs-options.h perf parse-regs: Split parse_regs 2019-05-15 16:36:49 -03:00
path.c perf tools: Remove needless evlist.h include directives 2019-08-31 22:24:10 -03:00
path.h
perf_event_attr_fprintf.c
perf_regs.c
perf_regs.h
perf-hooks-list.h
perf-hooks.c
perf-hooks.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
PERF-VERSION-GEN
pmu.c
pmu.h
pmu.l
pmu.y perf tools: Fix build with bison 2.3 and older. 2013-02-14 16:12:34 -03:00
print_binary.c
print_binary.h
probe-event.c
probe-event.h
probe-file.c perf probe-file: Delete namelist in del_events() on the error path 2021-07-28 13:30:54 +02:00
probe-file.h
probe-finder.c perf probe: Fix memory leakage when the probe point is not found 2020-08-26 10:40:48 +02:00
probe-finder.h
pstack.c perf debug: Remove needless include directives from debug.h 2019-08-31 19:10:19 -03:00
pstack.h
python-ext-sources perf evsel: Introduce evsel_fprintf.h 2019-09-25 16:26:34 -03:00
python.c perf evsel: Fall back to global 'perf_env' in perf_evsel__env() 2019-09-30 17:29:57 -03:00
rb_resort.h perf util: Use cached rbtree for rblists 2019-01-25 15:12:10 +01:00
rblist.c Merge remote-tracking branch 'remotes/origin/tmp-f686d9f' into msm-lahaina 2019-07-01 17:41:24 -07:00
rblist.h
record.c
record.h
rlimit.c perf tools: Introduce rlimit__bump_memlock() helper 2019-07-09 14:59:11 -03:00
rlimit.h
rwsem.c perf tools: Remove util.h from where it is not needed 2019-09-20 09:19:20 -03:00
rwsem.h perf tools: Provide mutex wrappers for pthreads rwlocks 2017-09-21 13:28:06 -03:00
s390-cpumcf-kernel.h
s390-cpumsf-kernel.h
s390-cpumsf.c
s390-cpumsf.h perf auxtrace: Support for perf report -D for s390 2018-08-03 10:34:18 -03:00
s390-sample-raw.c perf tools: Remove util.h from where it is not needed 2019-09-20 09:19:20 -03:00
sample-raw.c
sample-raw.h
session.c
session.h
setns.c
setup.py
smt.c perf tools: Apply new CPU topology sysfs attributes 2019-06-10 16:20:11 -03:00
smt.h
sort.c perf map: Delete two variable initialisations before null pointer checks in sort__sym_from_cmp() 2023-05-17 11:36:00 +02:00
sort.h
srccode.c
srccode.h
srcline.c
srcline.h
stat-display.c perf stat: Fix printing os->prefix in CSV metrics output 2022-11-25 17:42:06 +01:00
stat-shadow.c
stat.c
stat.h
strbuf.c
strbuf.h
strfilter.c tools lib: Adopt zalloc()/zfree() from tools/perf 2019-07-09 10:13:26 -03:00
strfilter.h
string2.h tools lib: Move argv_{split,free} from tools/perf/util/ 2019-07-01 22:50:40 -03:00
string.c
strlist.c
strlist.h
svghelper.c
svghelper.h
symbol_conf.h
symbol_fprintf.c
symbol-elf.c perf symbols: Fix return incorrect build_id size in elf_read_build_id() 2023-05-17 11:36:00 +02:00
symbol-minimal.c
symbol.c
symbol.h
symsrc.h
synthetic-events.c
synthetic-events.h
syscalltbl.c
syscalltbl.h
target.c
target.h
term.c
term.h
thread_map.c
thread_map.h
thread-stack.c
thread-stack.h perf/core improvements and fixes: 2019-06-17 20:48:14 +02:00
thread.c
thread.h
time-utils.c
time-utils.h
tool.h perf tool: Rename perf_tool::bpf_event to bpf 2019-08-26 19:39:11 -03:00
top.c libperf: Add perf_evlist__first()/last() functions 2019-09-25 09:51:48 -03:00
top.h perf top: Move sb_evlist to 'struct perf_top' 2024-01-25 14:34:31 -08:00
trace-event-info.c libperf: Move 'page_size' global variable to libperf 2019-09-25 09:51:48 -03:00
trace-event-parse.c
trace-event-read.c
trace-event-scripting.c
trace-event.c
trace-event.h
trigger.h
tsc.c
tsc.h
units.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
units.h
unwind-libdw.c
unwind-libdw.h
unwind-libunwind-local.c
unwind-libunwind.c
unwind.h
usage.c
util.c
util.h perf report: Fix memory leaks around perf_tip() 2021-12-08 09:01:10 +01:00
values.c
values.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vdso.c
vdso.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xyarray.c
zlib.c
zstd.c