1. 13 11月, 2021 1 次提交
  2. 27 9月, 2021 1 次提交
    • J
      perf tests: Fix flaky test 'Object code reading' · 0f892fd1
      James Clark 提交于
      This test occasionally fails on aarch64 when a sample is taken in
      free@plt and it fails with "Bytes read differ from those read by
      objdump".
      
      This is because that symbol is near a section boundary in the elf file.
      Despite the -z option to always output zeros, objdump uses
      bfd_map_over_sections() to iterate through the elf file so it doesn't
      see outside of the sections where these zeros are and can't print them.
      
      For example this boundary proceeds free@plt in libc with a gap of 48
      bytes between .plt and .text:
      
        objdump -d -z --start-address=0x23cc8 --stop-address=0x23d08 libc-2.30.so
      
        libc-2.30.so:     file format elf64-littleaarch64
      
        Disassembly of section .plt:
      
        0000000000023cc8 <*ABS*+0x7fd00@plt+0x8>:
           23cc8:	91018210 	add	x16, x16, #0x60
           23ccc:	d61f0220 	br	x17
      
        Disassembly of section .text:
      
        0000000000023d00 <abort@@GLIBC_2.17-0x98>:
           23d00:	a9bf7bfd 	stp	x29, x30, [sp, #-16]!
           23d04:	910003fd 	mov	x29, sp
      
      Taking a sample in free@plt is very rare because it is so small, but the
      test can be forced to fail almost every time on any platform by linking
      the test with a shared library that has a single empty function and
      calling it in a loop.
      
      The fix is to zero the buffers so that when there is a jump in the
      addresses output by objdump, zeros are already filled in between.
      Signed-off-by: NJames Clark <james.clark@arm.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>
      Link: http://lore.kernel.org/lkml/20210906152238.3415467-1-james.clark@arm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      0f892fd1
  3. 17 9月, 2021 1 次提交
  4. 24 3月, 2021 1 次提交
  5. 07 3月, 2021 1 次提交
    • N
      perf test: Fix cpu and thread map leaks in code_reading test · e06c3ca4
      Namhyung Kim 提交于
      The evlist and the cpu/thread maps should be released together.
      Otherwise following error was reported by Asan.
      
      Note that this test still has memory leaks in DSOs so it still fails
      even after this change.  I'll take a look at that too.
      
        # perf test -v 26
        26: Object code reading                        :
        --- start ---
        test child forked, pid 154184
        Looking at the vmlinux_path (8 entries long)
        symsrc__init: build id mismatch for vmlinux.
        symsrc__init: cannot get elf header.
        Using /proc/kcore for kernel data
        Using /proc/kallsyms for symbols
        Parsing event 'cycles'
        mmap size 528384B
        ...
        =================================================================
        ==154184==ERROR: LeakSanitizer: detected memory leaks
      
        Direct leak of 439 byte(s) in 1 object(s) allocated from:
          #0 0x7fcb66e77037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
          #1 0x55ad9b7e821e in dso__new_id util/dso.c:1256
          #2 0x55ad9b8cfd4a in __machine__addnew_vdso util/vdso.c:132
          #3 0x55ad9b8cfd4a in machine__findnew_vdso util/vdso.c:347
          #4 0x55ad9b845b7e in map__new util/map.c:176
          #5 0x55ad9b8415a2 in machine__process_mmap2_event util/machine.c:1787
          #6 0x55ad9b8fab16 in perf_tool__process_synth_event util/synthetic-events.c:64
          #7 0x55ad9b8fab16 in perf_event__synthesize_mmap_events util/synthetic-events.c:499
          #8 0x55ad9b8fbfdf in __event__synthesize_thread util/synthetic-events.c:741
          #9 0x55ad9b8ff3e3 in perf_event__synthesize_thread_map util/synthetic-events.c:833
          #10 0x55ad9b738585 in do_test_code_reading tests/code-reading.c:608
          #11 0x55ad9b73b25d in test__code_reading tests/code-reading.c:722
          #12 0x55ad9b6f28fb in run_test tests/builtin-test.c:428
          #13 0x55ad9b6f28fb in test_and_print tests/builtin-test.c:458
          #14 0x55ad9b6f4a53 in __cmd_test tests/builtin-test.c:679
          #15 0x55ad9b6f4a53 in cmd_test tests/builtin-test.c:825
          #16 0x55ad9b760cc4 in run_builtin /home/namhyung/project/linux/tools/perf/perf.c:313
          #17 0x55ad9b5eaa88 in handle_internal_command /home/namhyung/project/linux/tools/perf/perf.c:365
          #18 0x55ad9b5eaa88 in run_argv /home/namhyung/project/linux/tools/perf/perf.c:409
          #19 0x55ad9b5eaa88 in main /home/namhyung/project/linux/tools/perf/perf.c:539
          #20 0x7fcb669acd09 in __libc_start_main ../csu/libc-start.c:308
      
          ...
        SUMMARY: AddressSanitizer: 471 byte(s) leaked in 2 allocation(s).
        test child finished with 1
        ---- end ----
        Object code reading: FAILED!
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Acked-by: NJiri Olsa <jolsa@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: https://lore.kernel.org/r/20210301140409.184570-6-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e06c3ca4
  6. 18 2月, 2021 1 次提交
    • F
      perf tools: Add OCaml demangling · cef7af25
      Fabian Hemmer 提交于
      Detect symbols generated by the OCaml compiler based on their prefix.
      
      Demangle OCaml symbols, returning a newly allocated string (like the
      existing Java demangling functionality).
      
      Move a helper function (hex) from tests/code-reading.c to util/string.c
      
      To test:
      
        echo 'Printf.printf "%d\n" (Random.int 42)' > test.ml
        perf record ocamlopt.opt test.ml
        perf report -d ocamlopt.opt
      Signed-off-by: NFabian Hemmer <copy@copy.sh>
      Acked-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LPU-Reference: 20210203211537.b25ytjb6dq5jfbwx@nyu
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cef7af25
  7. 01 12月, 2020 2 次提交
  8. 30 11月, 2020 1 次提交
  9. 23 6月, 2020 1 次提交
  10. 26 11月, 2019 1 次提交
  11. 10 10月, 2019 4 次提交
  12. 25 9月, 2019 5 次提交
  13. 20 9月, 2019 2 次提交
  14. 01 9月, 2019 2 次提交
  15. 30 8月, 2019 1 次提交
  16. 26 8月, 2019 1 次提交
  17. 30 7月, 2019 14 次提交