linux/tools/perf/tests
Ian Rogers 07eafd4e05 perf parse-event: Add init and exit to parse_event_error
parse_events() may succeed but leave string memory allocations reachable
in the error.

Add an init/exit that must be called to initialize and clean up the
error. This fixes a leak in metricgroup parse_ids.

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: John Garry <john.garry@huawei.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/20211107090002.3784612-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2021-11-07 15:39:25 -03:00
..
attr perf tests attr: Add missing topdown metrics events 2021-10-05 14:55:38 -03:00
shell perf tests: Improve temp file cleanup in test_arm_coresight.sh 2021-10-26 11:17:46 -03:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
api-io.c tools api: Add a lightweight buffered reading api 2020-04-30 10:48:28 -03:00
attr.c perf tests: Skip 'Setup struct perf_event_attr' test for hybrid 2021-04-29 10:31:00 -03:00
attr.py
backward-ring-buffer.c perf parse-event: Add init and exit to parse_event_error 2021-11-07 15:39:25 -03:00
bitmap.c tools: rename bitmap_alloc() to bitmap_zalloc() 2021-09-08 11:50:27 -07:00
bp_account.c perf tests bp_account: Make global variable static 2020-03-02 11:15:07 -03:00
bp_signal_overflow.c perf debug: Remove needless include directives from debug.h 2019-08-31 19:10:19 -03:00
bp_signal.c perf tools: Fix various typos in comments 2021-03-23 17:13:43 -03:00
bpf-script-example.c
bpf-script-test-kbuild.c
bpf-script-test-prologue.c
bpf-script-test-relocation.c
bpf.c perf parse-event: Add init and exit to parse_event_error 2021-11-07 15:39:25 -03:00
Build perf tests: Add dlfilter test 2021-08-11 09:35:44 -03:00
builtin-test.c perf test: Make --skip work on shell tests 2021-08-11 15:45:08 -03:00
clang.c perf tools: Remove util.h from where it is not needed 2019-09-20 09:19:20 -03:00
code-reading.c Merge remote-tracking branch 'torvalds/master' into perf/core 2021-10-08 11:13:17 -03:00
cpumap.c perf test: Fix cpu map leaks in cpu_map_print test 2021-03-06 16:54:29 -03:00
demangle-java-test.c perf tests: Add test for the java demangler 2020-05-28 10:03:28 -03:00
demangle-ocaml-test.c perf tools: Preserve identifier id in OCaml demangler 2021-03-30 12:45:59 -03:00
dlfilter-test.c perf tests dlfilter: Free desc and long_desc in check_filter_desc 2021-08-20 11:16:27 -03:00
dso-data.c perf test: Handle fd gaps in test__dso_data_reopen 2021-08-02 10:01:54 -03:00
dwarf-unwind.c perf test: Fix DWARF unwind for optimized builds. 2021-09-27 09:32:28 -03:00
event_update.c perf test event_update: Fix memory leak of unit 2021-07-15 17:27:52 -03:00
event-times.c perf evlist: Use the right prefix for 'struct evlist' create maps methods 2020-11-30 14:56:52 -03:00
evsel-roundtrip-name.c perf tests: Fix 'Roundtrip evsel->name' on core-only system 2021-07-14 10:05:35 -03:00
evsel-tp-sched.c perf evsel: Convert last 'struct evsel' methods to the right evsel__ prefix 2020-11-30 09:08:24 -03:00
expand-cgroup.c perf parse-event: Add init and exit to parse_event_error 2021-11-07 15:39:25 -03:00
expr.c perf metric: Encode and use metric-id as qualifier 2021-10-20 10:57:05 -03:00
fdarray.c libperf: Add flags to fdarray fds objects 2020-07-21 09:52:51 -03:00
genelf.c perf jit: Move test functionality in to a test 2019-11-29 12:20:45 -03:00
hists_common.c perf tools: Move event synthesizing routines to separate header 2019-09-20 09:19:22 -03:00
hists_common.h
hists_cumulate.c perf tools: Fix various typos in comments 2021-03-23 17:13:43 -03:00
hists_filter.c perf hists: Split hists_stats from events_stats 2021-04-29 10:30:58 -03:00
hists_link.c libperf: Add perf_evlist__first()/last() functions 2019-09-25 09:51:48 -03:00
hists_output.c perf evsel: Rename perf_evsel__resort*() to evsel__resort*() 2020-05-28 10:03:24 -03:00
is_printable_array.c
keep-tracking.c perf test: Fix cpu and thread map leaks in keep_tracking test 2021-03-06 16:54:28 -03:00
kmod-path.c perf debug: Remove needless include directives from debug.h 2019-08-31 19:10:19 -03:00
llvm.c perf tools: Fix LLVM test failure when running in verbose mode 2021-08-31 15:17:45 -03:00
llvm.h
make perf tools: Test build with libbpf/LIBBPF_DYNAMIC=1 2021-05-17 20:32:05 -03:00
maps.c perf test maps__merge_in: Fix memory leak of maps 2021-07-15 17:27:52 -03:00
mem2node.c tools: rename bitmap_alloc() to bitmap_zalloc() 2021-09-08 11:50:27 -07:00
mem.c perf symbols: Move mem_info and branch_info out of symbol.h 2019-08-31 22:27:48 -03:00
mmap-basic.c libperf: Move 'idx' from tools/perf to perf_evsel::idx 2021-07-09 14:04:28 -03:00
mmap-thread-lookup.c perf tools: Allow controlling synthesizing PERF_RECORD_ metadata events during record 2021-09-17 08:44:19 -03:00
openat-syscall-all-cpus.c perf env: Remove unneeded internal/cpumap inclusions 2021-02-12 17:35:48 -03:00
openat-syscall-tp-fields.c perf evlist: Use the right prefix for alternative 'struct evlist' constructors 2020-11-30 15:04:05 -03:00
openat-syscall.c perf evsel: Rename perf_evsel__new*() to evsel__new*() 2020-05-28 10:03:24 -03:00
parse-events.c perf parse-event: Add init and exit to parse_event_error 2021-11-07 15:39:25 -03:00
parse-metric.c perf pmu: Add const to pmu_events_map. 2021-10-20 10:31:47 -03:00
parse-no-sample-id-all.c perf evlist: Use the right prefix for 'struct evlist' sample parsing methods 2020-11-30 09:43:07 -03:00
pe-file-parsing.c perf tools: Pass build_id object to filename__read_build_id() 2020-10-14 08:45:16 -03:00
pe-file.c perf tests: Add test for PE binary format support 2020-09-04 14:38:15 -03:00
pe-file.exe perf tests: Add test for PE binary format support 2020-09-04 14:38:15 -03:00
pe-file.exe.debug perf tests: Add test for PE binary format support 2020-09-04 14:38:15 -03:00
perf-hooks.c perf tests: Avoid raising SEGV using an obvious NULL dereference 2019-09-27 09:26:14 -03:00
perf-record.c perf evlist: Use the right prefix for 'struct evlist' event attribute config methods 2020-11-30 15:15:27 -03:00
perf-targz-src-pkg
perf-time-to-tsc.c perf tests: Fix 'Convert perf time to TSC' on core-only system 2021-07-14 10:05:35 -03:00
pfm.c libperf: Move 'nr_groups' from tools/perf to evlist::nr_groups 2021-07-09 14:04:32 -03:00
pmu-events.c perf parse-event: Add init and exit to parse_event_error 2021-11-07 15:39:25 -03:00
pmu.c perf test: Free formats for perf pmu parse test 2020-09-15 09:22:42 -03:00
python-use.c perf tests: Show python test script in verbose mode 2020-10-13 16:22:03 -03:00
sample-parsing.c perf test sample-parsing: Add endian test for struct branch_flags 2021-10-28 09:34:01 -03:00
sdt.c perf tools: Pass build_id object to build_id__sprintf() 2020-10-14 08:46:22 -03:00
stat.c perf tools: Move event synthesizing routines to separate header 2019-09-20 09:19:22 -03:00
sw-clock.c perf test: Fix cpu and thread map leaks in sw_clock_freq test 2021-03-06 16:54:28 -03:00
switch-tracking.c perf tests: Support 'Track with sched_switch' test for hybrid 2021-04-29 10:31:00 -03:00
task-exit.c perf test: Fix cpu and thread map leaks in task_exit test 2021-03-06 16:54:28 -03:00
tests.h perf tests: Add dlfilter test 2021-08-11 09:35:44 -03:00
thread-map.c perf test: Fix a memory leak in thread_map_remove test 2021-03-06 16:54:29 -03:00
thread-maps-share.c perf tests: Rename thread-mg-share to thread-maps-share 2019-11-26 11:07:46 -03:00
time-utils-test.c
topology.c perf parse-event: Add init and exit to parse_event_error 2021-11-07 15:39:25 -03:00
unit_number__scnprintf.c perf debug: Remove needless include directives from debug.h 2019-08-31 19:10:19 -03:00
vmlinux-kallsyms.c perf tests vmlinux-kallsyms: Ignore hidden symbols 2021-09-29 14:13:42 -03:00
wp.c perf test: Implement skip_reason callback for watchpoint tests 2020-11-04 09:42:40 -03:00