linux-xiaomi-chiron/tools/perf/util
Ian Rogers b194c9cd09 perf evsel: Fix memory leaks relating to unit
unit may have a strdup pointer or be to a literal, consequently memory
assocciated with it isn't freed. Change it so the unit is always strdup
and so the memory can be safely freed.

Fix related issue in perf_event__process_event_update() for name and
own_cpus. Leaks were spotted by leak sanitizer.

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20211118084749.2191447-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2021-11-18 10:19:14 -03:00
..
arm-spe-decoder perf arm-spe: Save context ID in record 2021-11-13 18:11:51 -03:00
bpf_skel
c++ perf test: Convert clang tests to test cases. 2021-11-13 18:11:49 -03:00
cs-etm-decoder perf cs-etm: Print the decoder name 2021-09-03 08:17:25 -03:00
include
intel-pt-decoder perf tools: Use __BYTE_ORDER__ 2021-11-07 12:27:38 -03:00
libunwind
scripting-engines perf script python: Allow reporting the [un]throttle PERF_RECORD_ meta event 2021-09-03 08:18:25 -03:00
affinity.c tools: rename bitmap_alloc() to bitmap_zalloc() 2021-09-08 11:50:27 -07:00
affinity.h
amd-sample-raw.c perf report: Add support to print a textual representation of IBS raw sample data 2021-09-10 18:15:21 -03:00
annotate.c perf symbols: Factor out annotation init/exit 2021-11-13 18:11:51 -03:00
annotate.h perf symbols: Factor out annotation init/exit 2021-11-13 18:11:51 -03:00
archinsn.h
arm-spe.c perf inject: Fix ARM SPE handling 2021-11-18 10:08:07 -03:00
arm-spe.h
auxtrace.c perf auxtrace: Add itrace A option to approximate IPC 2021-10-27 16:20:08 -03:00
auxtrace.h perf auxtrace: Add itrace d+o option to direct debug log to stdout 2021-10-27 16:20:45 -03:00
block-info.c
block-info.h
block-range.c
block-range.h
bpf-event.c perf tools: Add more weak libbpf functions 2021-11-13 18:11:51 -03:00
bpf-event.h perf bpf: Pull in bpf_program__get_prog_info_linear() 2021-11-01 18:16:40 -03:00
bpf-loader.c
bpf-loader.h
bpf-prologue.c
bpf-prologue.h
bpf-utils.c perf bpf: Pull in bpf_program__get_prog_info_linear() 2021-11-01 18:16:40 -03:00
bpf-utils.h perf bpf: Pull in bpf_program__get_prog_info_linear() 2021-11-01 18:16:40 -03:00
bpf_counter.c perf bpf: Pull in bpf_program__get_prog_info_linear() 2021-11-01 18:16:40 -03:00
bpf_counter.h
bpf_counter_cgroup.c perf bpf: Deprecate bpf_map__resize() in favor of bpf_map_set_max_entries() 2021-09-15 17:57:30 -03:00
bpf_map.c
bpf_map.h
branch.c
branch.h
Build perf bpf: Pull in bpf_program__get_prog_info_linear() 2021-11-01 18:16:40 -03:00
build-id.c
build-id.h
cache.h
cacheline.c
cacheline.h
call-path.c
call-path.h
callchain.c
callchain.h
cap.c
cap.h
cgroup.c
cgroup.h
clockid.c
clockid.h
cloexec.c
cloexec.h
color.c
color.h
color_config.c
comm.c
comm.h
compress.h
config.c perf config: Refine error message to eliminate confusion 2021-09-27 09:32:28 -03:00
config.h
copyfile.c
copyfile.h
counts.c
counts.h
cpu-set-sched.h
cpumap.c
cpumap.h
cputopo.c perf cputopo: Match thread_siblings to topology ABI name 2021-11-13 18:11:50 -03:00
cputopo.h perf cputopo: Match thread_siblings to topology ABI name 2021-11-13 18:11:50 -03:00
cs-etm.c perf cs-etm: Print size using consistent format 2021-11-13 18:11:50 -03:00
cs-etm.h perf cs-etm: Save TRCDEVARCH register 2021-09-03 08:15:10 -03:00
data-convert-bt.c perf tools: Use __BYTE_ORDER__ 2021-11-07 12:27:38 -03:00
data-convert-json.c perf tools: Remove repipe argument from perf_session__new() 2021-08-02 10:06:51 -03:00
data-convert.h
data.c
data.h
db-export.c
db-export.h
debug.c libtraceevent: Increase libtraceevent logging when verbose 2021-09-28 16:09:16 -03:00
debug.h perf tools: Add WARN_ONCE equivalent for UI warnings 2021-08-03 17:03:18 -03:00
demangle-java.c
demangle-java.h
demangle-ocaml.c
demangle-ocaml.h
demangle-rust.c
demangle-rust.h
dlfilter.c perf tests: Add dlfilter test 2021-08-11 09:35:44 -03:00
dlfilter.h perf tests: Add dlfilter test 2021-08-11 09:35:44 -03:00
dso.c perf bpf: Pull in bpf_program__get_prog_info_linear() 2021-11-01 18:16:40 -03:00
dso.h perf dso: Fix /proc/kcore access on 32 bit systems 2021-10-25 13:47:42 -03:00
dsos.c
dsos.h
dump-insn.c
dump-insn.h
dwarf-aux.c perf probe: Fix add event failure when running 32-bit perf in a 64-bit kernel 2021-07-18 09:31:15 -03:00
dwarf-aux.h perf probe: Fix add event failure when running 32-bit perf in a 64-bit kernel 2021-07-18 09:31:15 -03:00
dwarf-regs.c
env.c perf bpf: Avoid memory leak from perf_env__insert_btf() 2021-11-13 18:11:51 -03:00
env.h perf bpf: Avoid memory leak from perf_env__insert_btf() 2021-11-13 18:11:51 -03:00
event.c perf tools: Add support for PERF_RECORD_AUX_OUTPUT_HW_ID 2021-10-20 11:22:27 -03:00
event.h perf tools: Add support for PERF_RECORD_AUX_OUTPUT_HW_ID 2021-10-20 11:22:27 -03:00
events_stats.h perf session: Report collisions in AUX records 2021-09-03 08:29:55 -03:00
evlist-hybrid.c perf tools: Enable on a list of CPUs for hybrid 2021-08-11 16:07:32 -03:00
evlist-hybrid.h perf tools: Enable on a list of CPUs for hybrid 2021-08-11 16:07:32 -03:00
evlist.c perf tools: Enable on a list of CPUs for hybrid 2021-08-11 16:07:32 -03:00
evlist.h perf evlist: Add evlist__for_each_entry_from() macro 2021-09-01 11:24:43 -03:00
evsel.c perf evsel: Fix memory leaks relating to unit 2021-11-18 10:19:14 -03:00
evsel.h perf expr: Add source_count for aggregating events 2021-11-13 18:11:50 -03:00
evsel_config.h
evsel_fprintf.c perf script: Show binary offsets for userspace addr 2021-10-27 20:56:36 -03:00
evsel_fprintf.h
evswitch.c
evswitch.h
expr.c perf expr: Add source_count for aggregating events 2021-11-13 18:11:50 -03:00
expr.h perf expr: Add source_count for aggregating events 2021-11-13 18:11:50 -03:00
expr.l perf expr: Add source_count for aggregating events 2021-11-13 18:11:50 -03:00
expr.y perf expr: Add source_count for aggregating events 2021-11-13 18:11:50 -03:00
find-map.c
fncache.c
fncache.h
genelf.c
genelf.h perf tools: Use __BYTE_ORDER__ 2021-11-07 12:27:38 -03:00
genelf_debug.c
generate-cmdlist.sh
get_current_dir_name.c perf tools: Fixup get_current_dir_name() compilation 2021-08-30 10:06:16 -03:00
get_current_dir_name.h
hashmap.c
hashmap.h
header.c perf evsel: Fix memory leaks relating to unit 2021-11-18 10:19:14 -03:00
header.h perf tools: Pass a fd to perf_file_header__read_pipe() 2021-08-02 10:09:05 -03:00
help-unknown-cmd.c
help-unknown-cmd.h
hist.c perf sort: Fix the 'p_stage_cyc' sort key behavior 2021-11-18 10:08:07 -03:00
hist.h perf hist: Fix memory leak of a perf_hpp_fmt 2021-11-18 10:16:56 -03:00
intel-bts.c perf tools: Use __BYTE_ORDER__ 2021-11-07 12:27:38 -03:00
intel-bts.h
intel-pt.c perf intel-pt: Support itrace d+o option to direct debug log to stdout 2021-10-27 16:21:01 -03:00
intel-pt.h
intlist.c
intlist.h
iostat.c
iostat.h
jit.h
jitdump.c
jitdump.h
kvm-stat.h
levenshtein.c
levenshtein.h
llvm-utils.c perf tools: Fix LLVM download hint link 2021-08-31 15:18:16 -03:00
llvm-utils.h
lzma.c
machine.c perf tools: Add support for PERF_RECORD_AUX_OUTPUT_HW_ID 2021-10-20 11:22:27 -03:00
machine.h perf tools: Add support for PERF_RECORD_AUX_OUTPUT_HW_ID 2021-10-20 11:22:27 -03:00
map.c Revert "perf map: Fix dso->nsinfo refcounting" 2021-07-30 18:26:22 -03:00
map.h
map_symbol.h
maps.h
mem-events.c tools/perf: Add mem_hops field in perf_mem_data_src structure 2021-10-19 17:27:00 +02:00
mem-events.h
mem2node.c
mem2node.h
memswap.c
memswap.h
metricgroup.c perf metric: Fix memory leaks 2021-11-07 15:39:28 -03:00
metricgroup.h perf list: Display hybrid PMU events with cpu type 2021-10-25 13:47:42 -03:00
mmap.c perf mmap: Introduce mmap_cpu_mask__duplicate() 2021-10-08 11:42:17 -03:00
mmap.h perf mmap: Introduce mmap_cpu_mask__duplicate() 2021-10-08 11:42:17 -03:00
namespaces.c
namespaces.h
ordered-events.c
ordered-events.h
parse-branch-options.c
parse-branch-options.h
parse-events-hybrid.c perf parse-events: Add new "metric-id" term 2021-10-20 10:54:44 -03:00
parse-events-hybrid.h perf parse-events: Add new "metric-id" term 2021-10-20 10:54:44 -03:00
parse-events.c perf evsel: Fix memory leaks relating to unit 2021-11-18 10:19:14 -03:00
parse-events.h perf parse-event: Add init and exit to parse_event_error 2021-11-07 15:39:25 -03:00
parse-events.l perf metric: Encode and use metric-id as qualifier 2021-10-20 10:57:05 -03:00
parse-events.y perf parse-events: Rename parse_events_error functions 2021-11-07 15:38:54 -03:00
parse-regs-options.c
parse-regs-options.h
parse-sublevel-options.c
parse-sublevel-options.h perf tools: Add missing newline at the end of header file 2021-08-24 15:01:31 -03:00
path.c
path.h
perf-hooks-list.h
perf-hooks.c
perf-hooks.h
PERF-VERSION-GEN
perf_api_probe.c
perf_api_probe.h
perf_event_attr_fprintf.c perf tools: Fix perf_event_attr__fprintf() missing/dupl. fields 2021-09-11 15:58:36 -03:00
perf_regs.c
perf_regs.h
pfm.c perf parse-events: Add new "metric-id" term 2021-10-20 10:54:44 -03:00
pfm.h
pmu-hybrid.c
pmu-hybrid.h
pmu.c perf parse-events: Rename parse_events_error functions 2021-11-07 15:38:54 -03:00
pmu.h perf evsel: Fix missing exclude_{host,guest} setting 2021-11-06 17:54:42 -03:00
pmu.l
pmu.y
print_binary.c
print_binary.h
probe-event.c perf probe: Fix add event failure when running 32-bit perf in a 64-bit kernel 2021-07-18 09:31:15 -03:00
probe-event.h perf probe: Fix add event failure when running 32-bit perf in a 64-bit kernel 2021-07-18 09:31:15 -03:00
probe-file.c
probe-file.h
probe-finder.c perf probe: Fix add event failure when running 32-bit perf in a 64-bit kernel 2021-07-18 09:31:15 -03:00
probe-finder.h perf probe: Fix add event failure when running 32-bit perf in a 64-bit kernel 2021-07-18 09:31:15 -03:00
pstack.c
pstack.h
python-ext-sources tools lib: Adopt list_sort() from the kernel sources 2021-10-20 10:30:59 -03:00
python.c perf evsel: Fix missing exclude_{host,guest} setting 2021-11-06 17:54:42 -03:00
rb_resort.h
rblist.c
rblist.h
record.c
record.h perf record: Add --synth option 2021-09-17 08:55:00 -03:00
rlimit.c
rlimit.h
rwsem.c
rwsem.h
s390-cpumcf-kernel.h
s390-cpumsf-kernel.h
s390-cpumsf.c perf tools: Use __BYTE_ORDER__ 2021-11-07 12:27:38 -03:00
s390-cpumsf.h
s390-sample-raw.c perf pmu: Make pmu_event tables const. 2021-10-20 10:32:33 -03:00
sample-raw.c perf report: Add support to print a textual representation of IBS raw sample data 2021-09-10 18:15:21 -03:00
sample-raw.h perf report: Add support to print a textual representation of IBS raw sample data 2021-09-10 18:15:21 -03:00
session.c Merge remote-tracking branch 'torvalds/master' into perf/core 2021-10-26 11:03:02 -03:00
session.h perf session: Introduce decompressor in reader object 2021-10-25 13:47:41 -03:00
setns.c
setup.py
sideband_evlist.c
smt.c
smt.h
sort.c perf sort: Fix the 'p_stage_cyc' sort key behavior 2021-11-18 10:08:07 -03:00
sort.h perf sort: Fix the 'p_stage_cyc' sort key behavior 2021-11-18 10:08:07 -03:00
spark.c
spark.h
srccode.c
srccode.h
srcline.c perf srcline: Use long-running addr2line per DSO 2021-10-04 09:29:07 -03:00
srcline.h
stat-display.c
stat-shadow.c perf expr: Add source_count for aggregating events 2021-11-13 18:11:50 -03:00
stat.c
stat.h
strbuf.c
strbuf.h
stream.c
stream.h
strfilter.c
strfilter.h
string.c
string2.h
strlist.c
strlist.h
svghelper.c
svghelper.h
symbol-elf.c
symbol-minimal.c
symbol.c perf symbols: Factor out annotation init/exit 2021-11-13 18:11:51 -03:00
symbol.h perf symbols: Bit pack to save a byte 2021-11-13 18:11:51 -03:00
symbol_conf.h
symbol_fprintf.c
symsrc.h
synthetic-events.c perf record: Add --synth option 2021-09-17 08:55:00 -03:00
synthetic-events.h perf record: Add --synth option 2021-09-17 08:55:00 -03:00
syscalltbl.c
syscalltbl.h
target.c
target.h perf tools: Create hybrid flag in target 2021-08-11 16:04:33 -03:00
term.c
term.h
thread-stack.c
thread-stack.h
thread.c
thread.h
thread_map.c
thread_map.h
time-utils.c
time-utils.h
tool.h perf tools: Add support for PERF_RECORD_AUX_OUTPUT_HW_ID 2021-10-20 11:22:27 -03:00
top.c
top.h
topdown.c
topdown.h
trace-event-info.c
trace-event-parse.c
trace-event-read.c
trace-event-scripting.c
trace-event.c
trace-event.h perf script python: Allow reporting the [un]throttle PERF_RECORD_ meta event 2021-09-03 08:18:25 -03:00
trigger.h
tsc.c
tsc.h
units.c
units.h
unwind-libdw.c
unwind-libdw.h
unwind-libunwind-local.c
unwind-libunwind.c
unwind.h
usage.c
util.c perf report: Fix memory leaks around perf_tip() 2021-11-18 10:18:03 -03:00
util.h perf report: Fix memory leaks around perf_tip() 2021-11-18 10:18:03 -03:00
values.c
values.h
vdso.c
vdso.h
zlib.c
zstd.c