linux/tools/perf/tests
Changbin Du 15e268e9e1 perf tests: Fix a memory leak in test__perf_evsel__tp_sched_test()
commit d982b33133 upstream.

  =================================================================
  ==20875==ERROR: LeakSanitizer: detected memory leaks

  Direct leak of 1160 byte(s) in 1 object(s) allocated from:
      #0 0x7f1b6fc84138 in calloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xee138)
      #1 0x55bd50005599 in zalloc util/util.h:23
      #2 0x55bd500068f5 in perf_evsel__newtp_idx util/evsel.c:327
      #3 0x55bd4ff810fc in perf_evsel__newtp /home/work/linux/tools/perf/util/evsel.h:216
      #4 0x55bd4ff81608 in test__perf_evsel__tp_sched_test tests/evsel-tp-sched.c:69
      #5 0x55bd4ff528e6 in run_test tests/builtin-test.c:358
      #6 0x55bd4ff52baf in test_and_print tests/builtin-test.c:388
      #7 0x55bd4ff543fe in __cmd_test tests/builtin-test.c:583
      #8 0x55bd4ff5572f in cmd_test tests/builtin-test.c:722
      #9 0x55bd4ffc4087 in run_builtin /home/changbin/work/linux/tools/perf/perf.c:302
      #10 0x55bd4ffc45c6 in handle_internal_command /home/changbin/work/linux/tools/perf/perf.c:354
      #11 0x55bd4ffc49ca in run_argv /home/changbin/work/linux/tools/perf/perf.c:398
      #12 0x55bd4ffc5138 in main /home/changbin/work/linux/tools/perf/perf.c:520
      #13 0x7f1b6e34809a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)

  Indirect leak of 19 byte(s) in 1 object(s) allocated from:
      #0 0x7f1b6fc83f30 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xedf30)
      #1 0x7f1b6e3ac30f in vasprintf (/lib/x86_64-linux-gnu/libc.so.6+0x8830f)

Signed-off-by: Changbin Du <changbin.du@gmail.com>
Reviewed-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Fixes: 6a6cd11d4e ("perf test: Add test for the sched tracepoint format fields")
Link: http://lkml.kernel.org/r/20190316080556.3075-17-changbin.du@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2019-08-13 12:38:48 +01:00
..
attr perf tests attr: Fix no-delay test 2017-11-26 13:50:13 +00:00
attr.c perf tools: Fix snprint warnings for gcc 8 2018-11-20 18:06:05 +00:00
attr.py perf tests: Make attr script test event cpu 2013-03-15 13:06:00 -03:00
bp_signal.c perf tests: Fix compile errors in bp_signal files 2013-05-28 16:23:57 +03:00
bp_signal_overflow.c perf tests: Fix compile errors in bp_signal files 2013-05-28 16:23:57 +03:00
builtin-test.c perf tests: Add test for closing dso objects on EMFILE error 2014-06-12 16:53:23 +02:00
code-reading.c perf tools: Use tid for finding thread 2014-05-12 11:09:50 +02:00
dso-data.c perf tests: Add test for closing dso objects on EMFILE error 2014-06-12 16:53:23 +02:00
dwarf-unwind.c Revert "perf: Disable PERF_RECORD_MMAP2 support" 2014-06-09 13:34:46 +02:00
evsel-roundtrip-name.c perf evlist: Introduce evlist__for_each() & friends 2014-01-13 10:06:25 -03:00
evsel-tp-sched.c perf tests: Fix a memory leak in test__perf_evsel__tp_sched_test() 2019-08-13 12:38:48 +01:00
hists_common.c perf tests: Add a test case for cumulating callchains 2014-06-01 14:35:11 +02:00
hists_common.h perf tests: Define and use symbolic names for fake symbols 2014-06-01 14:35:11 +02:00
hists_cumulate.c perf tests: Add a test case for cumulating callchains 2014-06-01 14:35:11 +02:00
hists_filter.c perf tests: Define and use symbolic names for fake symbols 2014-06-01 14:35:11 +02:00
hists_link.c perf tests: Define and use symbolic names for fake symbols 2014-06-01 14:35:11 +02:00
hists_output.c perf tests: Define and use symbolic names for fake symbols 2014-06-01 14:35:11 +02:00
keep-tracking.c tools: Consolidate types.h 2014-05-01 21:22:39 +02:00
make perf tests: Show the inner make output when an error happens 2014-06-09 12:14:22 -03:00
mmap-basic.c perf evlist: Introduce evlist__for_each() & friends 2014-01-13 10:06:25 -03:00
mmap-thread-lookup.c perf tests: Add thread maps lookup automated tests 2014-04-28 13:42:52 +02:00
open-syscall-all-cpus.c perf evsel: Remove idx parm from constructor 2013-11-11 15:56:39 -03:00
open-syscall-tp-fields.c perf record: Rename --no-delay to --no-buffering 2014-01-14 17:57:04 -03:00
open-syscall.c perf evsel: Remove idx parm from constructor 2013-11-11 15:56:39 -03:00
parse-events.c perf tests: Avoid possible truncation with dirent->d_name + snprintf 2017-06-05 21:17:06 +01:00
parse-no-sample-id-all.c tools: Consolidate types.h 2014-05-01 21:22:39 +02:00
perf-record.c perf record: Rename --no-delay to --no-buffering 2014-01-14 17:57:04 -03:00
perf-targz-src-pkg perf tools: Add test for building detached source tarballs 2014-01-13 10:06:26 -03:00
perf-time-to-tsc.c tools: Consolidate types.h 2014-05-01 21:22:39 +02:00
pmu.c perf tools: Fix snprint warnings for gcc 8 2018-11-20 18:06:05 +00:00
python-use.c perf tests: Check python path on attr and binding test 2013-01-24 16:40:10 -03:00
rdpmc.c tools: Consolidate types.h 2014-05-01 21:22:39 +02:00
sample-parsing.c tools: Consolidate types.h 2014-05-01 21:22:39 +02:00
sw-clock.c perf evlist: Auto unmap on destructor 2014-01-13 10:06:22 -03:00
task-exit.c perf evlist: Auto unmap on destructor 2014-01-13 10:06:22 -03:00
tests.h perf tests: Add test for closing dso objects on EMFILE error 2014-06-12 16:53:23 +02:00
thread-mg-share.c perf tests: Add map groups sharing with thread object test 2014-04-28 13:43:40 +02:00
vmlinux-kallsyms.c perf tests: No need to set up ref_reloc_sym 2014-01-31 17:21:52 -03:00