20 Jan, 2021

2 commits

  • This is the 5.10.9 stable release

    * tag 'v5.10.9': (153 commits)
    Linux 5.10.9
    netfilter: nf_nat: Fix memleak in nf_nat_init
    netfilter: conntrack: fix reading nf_conntrack_buckets
    ...

    Signed-off-by: Jason Liu

    Jason Liu
     
  • commit 5501e9229a80d95a1ea68609f44c447a75d23ed5 upstream.

    In some cases, the number of cpus (nr_cpus_online) is confused with the
    maximum cpu number (nr_cpus_avail), which results in the error in the
    example below:

    Example on system with 8 cpus:

    Before:
    # echo 0 > /sys/devices/system/cpu/cpu2/online
    # ./perf record --kcore -e intel_pt// taskset --cpu-list 7 uname
    Linux
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.147 MB perf.data ]
    # ./perf script --itrace=e
    Requested CPU 7 too large. Consider raising MAX_NR_CPUS
    0x25908 [0x8]: failed to process type: 68 [Invalid argument]

    After:
    # ./perf script --itrace=e
    #

    Fixes: 8c7274691f0d ("perf machine: Replace MAX_NR_CPUS with perf_env::nr_cpus_online")
    Fixes: 7df4e36a4785 ("perf session: Replace MAX_NR_CPUS with perf_env::nr_cpus_online")
    Signed-off-by: Adrian Hunter
    Tested-by: Kan Liang
    Cc: Jiri Olsa
    Cc: stable@vger.kernel.org
    Link: http://lore.kernel.org/lkml/20210107174159.24897-1-adrian.hunter@intel.com
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Greg Kroah-Hartman

    Adrian Hunter
     

04 Jan, 2021

1 commit

  • This is the 5.10.4 stable release

    * tag 'v5.10.4': (717 commits)
    Linux 5.10.4
    x86/CPU/AMD: Save AMD NodeId as cpu_die_id
    drm/edid: fix objtool warning in drm_cvt_modes()
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    drivers/gpu/drm/imx/dcss/dcss-plane.c
    drivers/media/i2c/ov5640.c

    Jason Liu
     

30 Dec, 2020

4 commits

  • [ Upstream commit 5149303fdfe5c67ddb51c911e23262f781cd75eb ]

    The argv_split() function must be paired with argv_free(), else we must
    keep a reference to the argv array received or do the freeing ourselves,
    in synthesize_sdt_probe_command() we were simply leaking that argv[]
    array.

    Fixes: 3b1f8311f6963cd1 ("perf probe: Add sdt probes arguments into the uprobe cmd string")
    Cc: Adrian Hunter
    Cc: Alexander Shishkin
    Cc: Alexandre Truong
    Cc: Alexis Berlemont
    Cc: He Zhe
    Cc: Ian Rogers
    Cc: Ingo Molnar
    Cc: Jiri Olsa
    Cc: John Garry
    Cc: Mark Rutland
    Cc: Masami Hiramatsu
    Cc: Mathieu Poirier
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Sumanth Korikkar
    Cc: Thomas Richter
    Cc: Will Deacon
    Link: https://lore.kernel.org/r/20201224135139.GF477817@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Sasha Levin

    Arnaldo Carvalho de Melo
     
  • [ Upstream commit 2eb5dd418034ecea2f7031e3d33f2991a878b148 ]

    When using 'perf record's option '-I' or '--user-regs=' along with
    argument '?' to list available register names, memory of variable 'os'
    allocated by strdup() needs to be released before __parse_regs()
    returns, otherwise memory leak will occur.

    Fixes: bcc84ec65ad1 ("perf record: Add ability to name registers to record")
    Signed-off-by: Zheng Zengkai
    Acked-by: Jiri Olsa
    Cc: Alexander Shishkin
    Cc: Li Bin
    Cc: Mark Rutland
    Cc: Namhyung Kim
    Link: https://lore.kernel.org/r/20200703093344.189450-1-zhengzengkai@huawei.com
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Sasha Levin

    Zheng Zengkai
     
  • [ Upstream commit b2ce5dbc15819ea4bef47dbd368239cb1e965158 ]

    Commit e1c92a7fbbc5 ("perf tests: Add another metric parsing test") add
    another test for metric parsing. The test goes through all metrics
    compiled for arch within pmu events and try to parse them.

    Right now this test is failing in powerpc machine.

    Result in power9 platform:

    [command]# ./perf test 10
    10: PMU events :
    10.1: PMU event table sanity : Ok
    10.2: PMU event map aliases : Ok
    10.3: Parsing of PMU event table metrics : Skip (some metrics failed)
    10.4: Parsing of PMU event table metrics with fake PMUs : FAILED!

    Issue is we are passing different runtime parameter value in
    "expr__find_other" and "expr__parse" function which is called from
    function `metric_parse_fake`. And because of this parsing of hv-24x7
    metrics is failing.

    [command]# ./perf test 10 -vv
    .....
    hv_24x7/pm_mcs01_128b_rd_disp_port01,chip=1/ not found
    expr__parse failed
    test child finished with -1
    ---- end ----
    PMU events subtest 4: FAILED!

    This patch fix this issue and change runtime parameter value to '0' in
    expr__parse function.

    Result in power9 platform after this patch:

    [command]# ./perf test 10
    10: PMU events :
    10.1: PMU event table sanity : Ok
    10.2: PMU event map aliases : Ok
    10.3: Parsing of PMU event table metrics : Skip (some metrics failed)
    10.4: Parsing of PMU event table metrics with fake PMUs : Ok

    Fixes: e1c92a7fbbc5 ("perf tests: Add another metric parsing test")
    Signed-off-by: Kajol Jain
    Acked-by: Ian Rogers
    Acked-by: Jiri Olsa
    Cc: Madhavan Srinivasan
    Cc: Ravi Bangoria
    Link: http://lore.kernel.org/lkml/20201119152411.46041-1-kjain@linux.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Sasha Levin

    Kajol Jain
     
  • [ Upstream commit 9b0a7836359443227c9af101f7aea8412e739458 ]

    I found that the UNHALTED_CORE_CYCLES event is only available in the
    Intel machines and it makes other vendors/archs fail on the test. As
    libpfm4 can parse the generic events like cycles, let's use them.

    Fixes: 40b74c30ffb9 ("perf test: Add expand cgroup event test")
    Signed-off-by: Namhyung Kim
    Acked-by: Ian Rogers
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: Jiri Olsa
    Cc: Mark Rutland
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lore.kernel.org/lkml/20201027072855.655449-1-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Sasha Levin

    Namhyung Kim
     

14 Dec, 2020

9 commits


28 Nov, 2020

6 commits

  • Since some gcc generates a broken DWARF which lacks DW_AT_declaration
    attribute from the subprogram DIE of function prototype.
    (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97060)

    So, in addition to the DW_AT_declaration check, we also check the
    subprogram DIE has DW_AT_inline or actual entry pc.

    Committer testing:

    # cat /etc/fedora-release
    Fedora release 33 (Thirty Three)
    #

    Before:

    # perf test vfs_getname
    78: Use vfs_getname probe to get syscall args filenames : FAILED!
    79: Check open filename arg using perf trace + vfs_getname : FAILED!
    81: Add vfs_getname probe to get syscall args filenames : FAILED!
    #

    After:

    # perf test vfs_getname
    78: Use vfs_getname probe to get syscall args filenames : Ok
    79: Check open filename arg using perf trace + vfs_getname : Ok
    81: Add vfs_getname probe to get syscall args filenames : Ok
    #

    Reported-by: Thomas Richter
    Signed-off-by: Masami Hiramatsu
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Sumanth Korikkar
    Link: http://lore.kernel.org/lkml/160645613571.2824037.7441351537890235895.stgit@devnote2
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Fix die_entrypc() to return error correctly if the DIE has no
    DW_AT_ranges attribute. Since dwarf_ranges() will treat the case as an
    empty ranges and return 0, we have to check it by ourselves.

    Fixes: 91e2f539eeda ("perf probe: Fix to show function entry line as probe-able")
    Signed-off-by: Masami Hiramatsu
    Cc: Sumanth Korikkar
    Cc: Thomas Richter
    Link: http://lore.kernel.org/lkml/160645612634.2824037.5284932731175079426.stgit@devnote2
    Signed-off-by: Arnaldo Carvalho de Melo

    Masami Hiramatsu
     
  • Currently perf stat shows some metrics (like IPC) for defined events.
    But when no aggregation mode is used (-A option), it shows incorrect
    values since it used a value from a different cpu.

    Before:

    $ perf stat -aA -e cycles,instructions sleep 1

    Performance counter stats for 'system wide':

    CPU0 116,057,380 cycles
    CPU1 86,084,722 cycles
    CPU2 99,423,125 cycles
    CPU3 98,272,994 cycles
    CPU0 53,369,217 instructions # 0.46 insn per cycle
    CPU1 33,378,058 instructions # 0.29 insn per cycle
    CPU2 58,150,086 instructions # 0.50 insn per cycle
    CPU3 40,029,703 instructions # 0.34 insn per cycle

    1.001816971 seconds time elapsed

    So the IPC for CPU1 should be 0.38 (= 33,378,058 / 86,084,722)
    but it was 0.29 (= 33,378,058 / 116,057,380) and so on.

    After:

    $ perf stat -aA -e cycles,instructions sleep 1

    Performance counter stats for 'system wide':

    CPU0 109,621,384 cycles
    CPU1 159,026,454 cycles
    CPU2 99,460,366 cycles
    CPU3 124,144,142 cycles
    CPU0 44,396,706 instructions # 0.41 insn per cycle
    CPU1 120,195,425 instructions # 0.76 insn per cycle
    CPU2 44,763,978 instructions # 0.45 insn per cycle
    CPU3 69,049,079 instructions # 0.56 insn per cycle

    1.001910444 seconds time elapsed

    Fixes: 44d49a600259 ("perf stat: Support metrics in --per-core/socket mode")
    Reported-by: Sam Xi
    Signed-off-by: Namhyung Kim
    Reviewed-by: Andi Kleen
    Acked-by: Jiri Olsa
    Cc: Alexander Shishkin
    Cc: Ian Rogers
    Cc: Mark Rutland
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lore.kernel.org/lkml/20201127041404.390276-1-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • It didn't check the tool->cgroup_events bit which is set when the
    --all-cgroups option is given. Without it, samples will not have cgroup
    info so no reason to synthesize.

    We can check the PERF_RECORD_CGROUP records after running perf record
    *WITHOUT* the --all-cgroups option:

    Before:

    $ perf report -D | grep CGROUP
    0 0 0x8430 [0x38]: PERF_RECORD_CGROUP cgroup: 1 /
    CGROUP events: 1
    CGROUP events: 0
    CGROUP events: 0

    After:

    $ perf report -D | grep CGROUP
    CGROUP events: 0
    CGROUP events: 0
    CGROUP events: 0

    Committer testing:

    Before:

    # perf record -a sleep 1
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 2.208 MB perf.data (10003 samples) ]
    # perf report -D | grep "CGROUP events"
    CGROUP events: 146
    CGROUP events: 0
    CGROUP events: 0
    #

    After:

    # perf record -a sleep 1
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 2.208 MB perf.data (10448 samples) ]
    # perf report -D | grep "CGROUP events"
    CGROUP events: 0
    CGROUP events: 0
    CGROUP events: 0
    #

    With all-cgroups:

    # perf record --all-cgroups -a sleep 1
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 2.374 MB perf.data (11526 samples) ]
    # perf report -D | grep "CGROUP events"
    CGROUP events: 146
    CGROUP events: 0
    CGROUP events: 0
    #

    Fixes: 8fb4b67939e16 ("perf record: Add --all-cgroups option")
    Signed-off-by: Namhyung Kim
    Tested-by: Arnaldo Carvalho de Melo
    Acked-by: Jiri Olsa
    Cc: Alexander Shishkin
    Cc: Ian Rogers
    Cc: Mark Rutland
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lore.kernel.org/lkml/20201127054356.405481-1-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • An appropriate return value should be set on the failed path.

    Fixes: 2a09a84c720b436a ("perf diff: Support hot streams comparison")
    Reported-by: Hulk Robot
    Signed-off-by: Zhen Lei
    Acked-by: Jiri Olsa
    Acked-by: Namhyung Kim
    Cc: Alexander Shishkin
    Cc: Jin Yao
    Cc: Mark Rutland
    Cc: Peter Zijlstra
    Link: http://lore.kernel.org/lkml/20201124103652.438-1-thunder.leizhen@huawei.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Zhen Lei
     
  • To pick the changes in:

    7a078d2d18801bba ("libbpf, hashmap: Fix undefined behavior in hash_bits")

    That don't entail any changes in tools/perf.

    This addresses this perf build warning:

    Warning: Kernel ABI header at 'tools/perf/util/hashmap.h' differs from latest version at 'tools/lib/bpf/hashmap.h'
    diff -u tools/perf/util/hashmap.h tools/lib/bpf/hashmap.h

    Not a kernel ABI, its just that this uses the mechanism in place for
    checking kernel ABI files drift.

    Cc: Adrian Hunter
    Cc: Daniel Borkmann
    Cc: Ian Rogers
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     

17 Nov, 2020

2 commits

  • This fix is for a failure that occurred in the DWARF unwind perf test.

    Stack unwinders may probe memory when looking for frames.

    Memory sanitizer will poison and track uninitialized memory on the
    stack, and on the heap if the value is copied to the heap.

    This can lead to false memory sanitizer failures for the use of an
    uninitialized value.

    Avoid this problem by removing the poison on the copied stack.

    The full msan failure with track origins looks like:

    ==2168==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x559ceb10755b in handle_cfi elfutils/libdwfl/frame_unwind.c:648:8
    #1 0x559ceb105448 in __libdwfl_frame_unwind elfutils/libdwfl/frame_unwind.c:741:4
    #2 0x559ceb0ece90 in dwfl_thread_getframes elfutils/libdwfl/dwfl_frame.c:435:7
    #3 0x559ceb0ec6b7 in get_one_thread_frames_cb elfutils/libdwfl/dwfl_frame.c:379:10
    #4 0x559ceb0ec6b7 in get_one_thread_cb elfutils/libdwfl/dwfl_frame.c:308:17
    #5 0x559ceb0ec6b7 in dwfl_getthreads elfutils/libdwfl/dwfl_frame.c:283:17
    #6 0x559ceb0ec6b7 in getthread elfutils/libdwfl/dwfl_frame.c:354:14
    #7 0x559ceb0ec6b7 in dwfl_getthread_frames elfutils/libdwfl/dwfl_frame.c:388:10
    #8 0x559ceaff6ae6 in unwind__get_entries tools/perf/util/unwind-libdw.c:236:8
    #9 0x559ceabc9dbc in test_dwarf_unwind__thread tools/perf/tests/dwarf-unwind.c:111:8
    #10 0x559ceabca5cf in test_dwarf_unwind__compare tools/perf/tests/dwarf-unwind.c:138:26
    #11 0x7f812a6865b0 in bsearch (libc.so.6+0x4e5b0)
    #12 0x559ceabca871 in test_dwarf_unwind__krava_3 tools/perf/tests/dwarf-unwind.c:162:2
    #13 0x559ceabca926 in test_dwarf_unwind__krava_2 tools/perf/tests/dwarf-unwind.c:169:9
    #14 0x559ceabca946 in test_dwarf_unwind__krava_1 tools/perf/tests/dwarf-unwind.c:174:9
    #15 0x559ceabcae12 in test__dwarf_unwind tools/perf/tests/dwarf-unwind.c:211:8
    #16 0x559ceabbc4ab in run_test tools/perf/tests/builtin-test.c:418:9
    #17 0x559ceabbc4ab in test_and_print tools/perf/tests/builtin-test.c:448:9
    #18 0x559ceabbac70 in __cmd_test tools/perf/tests/builtin-test.c:669:4
    #19 0x559ceabbac70 in cmd_test tools/perf/tests/builtin-test.c:815:9
    #20 0x559cea960e30 in run_builtin tools/perf/perf.c:313:11
    #21 0x559cea95fbce in handle_internal_command tools/perf/perf.c:365:8
    #22 0x559cea95fbce in run_argv tools/perf/perf.c:409:2
    #23 0x559cea95fbce in main tools/perf/perf.c:539:3

    Uninitialized value was stored to memory at
    #0 0x559ceb106acf in __libdwfl_frame_reg_set elfutils/libdwfl/frame_unwind.c:77:22
    #1 0x559ceb106acf in handle_cfi elfutils/libdwfl/frame_unwind.c:627:13
    #2 0x559ceb105448 in __libdwfl_frame_unwind elfutils/libdwfl/frame_unwind.c:741:4
    #3 0x559ceb0ece90 in dwfl_thread_getframes elfutils/libdwfl/dwfl_frame.c:435:7
    #4 0x559ceb0ec6b7 in get_one_thread_frames_cb elfutils/libdwfl/dwfl_frame.c:379:10
    #5 0x559ceb0ec6b7 in get_one_thread_cb elfutils/libdwfl/dwfl_frame.c:308:17
    #6 0x559ceb0ec6b7 in dwfl_getthreads elfutils/libdwfl/dwfl_frame.c:283:17
    #7 0x559ceb0ec6b7 in getthread elfutils/libdwfl/dwfl_frame.c:354:14
    #8 0x559ceb0ec6b7 in dwfl_getthread_frames elfutils/libdwfl/dwfl_frame.c:388:10
    #9 0x559ceaff6ae6 in unwind__get_entries tools/perf/util/unwind-libdw.c:236:8
    #10 0x559ceabc9dbc in test_dwarf_unwind__thread tools/perf/tests/dwarf-unwind.c:111:8
    #11 0x559ceabca5cf in test_dwarf_unwind__compare tools/perf/tests/dwarf-unwind.c:138:26
    #12 0x7f812a6865b0 in bsearch (libc.so.6+0x4e5b0)
    #13 0x559ceabca871 in test_dwarf_unwind__krava_3 tools/perf/tests/dwarf-unwind.c:162:2
    #14 0x559ceabca926 in test_dwarf_unwind__krava_2 tools/perf/tests/dwarf-unwind.c:169:9
    #15 0x559ceabca946 in test_dwarf_unwind__krava_1 tools/perf/tests/dwarf-unwind.c:174:9
    #16 0x559ceabcae12 in test__dwarf_unwind tools/perf/tests/dwarf-unwind.c:211:8
    #17 0x559ceabbc4ab in run_test tools/perf/tests/builtin-test.c:418:9
    #18 0x559ceabbc4ab in test_and_print tools/perf/tests/builtin-test.c:448:9
    #19 0x559ceabbac70 in __cmd_test tools/perf/tests/builtin-test.c:669:4
    #20 0x559ceabbac70 in cmd_test tools/perf/tests/builtin-test.c:815:9
    #21 0x559cea960e30 in run_builtin tools/perf/perf.c:313:11
    #22 0x559cea95fbce in handle_internal_command tools/perf/perf.c:365:8
    #23 0x559cea95fbce in run_argv tools/perf/perf.c:409:2
    #24 0x559cea95fbce in main tools/perf/perf.c:539:3

    Uninitialized value was stored to memory at
    #0 0x559ceb106a54 in handle_cfi elfutils/libdwfl/frame_unwind.c:613:9
    #1 0x559ceb105448 in __libdwfl_frame_unwind elfutils/libdwfl/frame_unwind.c:741:4
    #2 0x559ceb0ece90 in dwfl_thread_getframes elfutils/libdwfl/dwfl_frame.c:435:7
    #3 0x559ceb0ec6b7 in get_one_thread_frames_cb elfutils/libdwfl/dwfl_frame.c:379:10
    #4 0x559ceb0ec6b7 in get_one_thread_cb elfutils/libdwfl/dwfl_frame.c:308:17
    #5 0x559ceb0ec6b7 in dwfl_getthreads elfutils/libdwfl/dwfl_frame.c:283:17
    #6 0x559ceb0ec6b7 in getthread elfutils/libdwfl/dwfl_frame.c:354:14
    #7 0x559ceb0ec6b7 in dwfl_getthread_frames elfutils/libdwfl/dwfl_frame.c:388:10
    #8 0x559ceaff6ae6 in unwind__get_entries tools/perf/util/unwind-libdw.c:236:8
    #9 0x559ceabc9dbc in test_dwarf_unwind__thread tools/perf/tests/dwarf-unwind.c:111:8
    #10 0x559ceabca5cf in test_dwarf_unwind__compare tools/perf/tests/dwarf-unwind.c:138:26
    #11 0x7f812a6865b0 in bsearch (libc.so.6+0x4e5b0)
    #12 0x559ceabca871 in test_dwarf_unwind__krava_3 tools/perf/tests/dwarf-unwind.c:162:2
    #13 0x559ceabca926 in test_dwarf_unwind__krava_2 tools/perf/tests/dwarf-unwind.c:169:9
    #14 0x559ceabca946 in test_dwarf_unwind__krava_1 tools/perf/tests/dwarf-unwind.c:174:9
    #15 0x559ceabcae12 in test__dwarf_unwind tools/perf/tests/dwarf-unwind.c:211:8
    #16 0x559ceabbc4ab in run_test tools/perf/tests/builtin-test.c:418:9
    #17 0x559ceabbc4ab in test_and_print tools/perf/tests/builtin-test.c:448:9
    #18 0x559ceabbac70 in __cmd_test tools/perf/tests/builtin-test.c:669:4
    #19 0x559ceabbac70 in cmd_test tools/perf/tests/builtin-test.c:815:9
    #20 0x559cea960e30 in run_builtin tools/perf/perf.c:313:11
    #21 0x559cea95fbce in handle_internal_command tools/perf/perf.c:365:8
    #22 0x559cea95fbce in run_argv tools/perf/perf.c:409:2
    #23 0x559cea95fbce in main tools/perf/perf.c:539:3

    Uninitialized value was stored to memory at
    #0 0x559ceaff8800 in memory_read tools/perf/util/unwind-libdw.c:156:10
    #1 0x559ceb10f053 in expr_eval elfutils/libdwfl/frame_unwind.c:501:13
    #2 0x559ceb1060cc in handle_cfi elfutils/libdwfl/frame_unwind.c:603:18
    #3 0x559ceb105448 in __libdwfl_frame_unwind elfutils/libdwfl/frame_unwind.c:741:4
    #4 0x559ceb0ece90 in dwfl_thread_getframes elfutils/libdwfl/dwfl_frame.c:435:7
    #5 0x559ceb0ec6b7 in get_one_thread_frames_cb elfutils/libdwfl/dwfl_frame.c:379:10
    #6 0x559ceb0ec6b7 in get_one_thread_cb elfutils/libdwfl/dwfl_frame.c:308:17
    #7 0x559ceb0ec6b7 in dwfl_getthreads elfutils/libdwfl/dwfl_frame.c:283:17
    #8 0x559ceb0ec6b7 in getthread elfutils/libdwfl/dwfl_frame.c:354:14
    #9 0x559ceb0ec6b7 in dwfl_getthread_frames elfutils/libdwfl/dwfl_frame.c:388:10
    #10 0x559ceaff6ae6 in unwind__get_entries tools/perf/util/unwind-libdw.c:236:8
    #11 0x559ceabc9dbc in test_dwarf_unwind__thread tools/perf/tests/dwarf-unwind.c:111:8
    #12 0x559ceabca5cf in test_dwarf_unwind__compare tools/perf/tests/dwarf-unwind.c:138:26
    #13 0x7f812a6865b0 in bsearch (libc.so.6+0x4e5b0)
    #14 0x559ceabca871 in test_dwarf_unwind__krava_3 tools/perf/tests/dwarf-unwind.c:162:2
    #15 0x559ceabca926 in test_dwarf_unwind__krava_2 tools/perf/tests/dwarf-unwind.c:169:9
    #16 0x559ceabca946 in test_dwarf_unwind__krava_1 tools/perf/tests/dwarf-unwind.c:174:9
    #17 0x559ceabcae12 in test__dwarf_unwind tools/perf/tests/dwarf-unwind.c:211:8
    #18 0x559ceabbc4ab in run_test tools/perf/tests/builtin-test.c:418:9
    #19 0x559ceabbc4ab in test_and_print tools/perf/tests/builtin-test.c:448:9
    #20 0x559ceabbac70 in __cmd_test tools/perf/tests/builtin-test.c:669:4
    #21 0x559ceabbac70 in cmd_test tools/perf/tests/builtin-test.c:815:9
    #22 0x559cea960e30 in run_builtin tools/perf/perf.c:313:11
    #23 0x559cea95fbce in handle_internal_command tools/perf/perf.c:365:8
    #24 0x559cea95fbce in run_argv tools/perf/perf.c:409:2
    #25 0x559cea95fbce in main tools/perf/perf.c:539:3

    Uninitialized value was stored to memory at
    #0 0x559cea9027d9 in __msan_memcpy llvm/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:1558:3
    #1 0x559cea9d2185 in sample_ustack tools/perf/arch/x86/tests/dwarf-unwind.c:41:2
    #2 0x559cea9d202c in test__arch_unwind_sample tools/perf/arch/x86/tests/dwarf-unwind.c:72:9
    #3 0x559ceabc9cbd in test_dwarf_unwind__thread tools/perf/tests/dwarf-unwind.c:106:6
    #4 0x559ceabca5cf in test_dwarf_unwind__compare tools/perf/tests/dwarf-unwind.c:138:26
    #5 0x7f812a6865b0 in bsearch (libc.so.6+0x4e5b0)
    #6 0x559ceabca871 in test_dwarf_unwind__krava_3 tools/perf/tests/dwarf-unwind.c:162:2
    #7 0x559ceabca926 in test_dwarf_unwind__krava_2 tools/perf/tests/dwarf-unwind.c:169:9
    #8 0x559ceabca946 in test_dwarf_unwind__krava_1 tools/perf/tests/dwarf-unwind.c:174:9
    #9 0x559ceabcae12 in test__dwarf_unwind tools/perf/tests/dwarf-unwind.c:211:8
    #10 0x559ceabbc4ab in run_test tools/perf/tests/builtin-test.c:418:9
    #11 0x559ceabbc4ab in test_and_print tools/perf/tests/builtin-test.c:448:9
    #12 0x559ceabbac70 in __cmd_test tools/perf/tests/builtin-test.c:669:4
    #13 0x559ceabbac70 in cmd_test tools/perf/tests/builtin-test.c:815:9
    #14 0x559cea960e30 in run_builtin tools/perf/perf.c:313:11
    #15 0x559cea95fbce in handle_internal_command tools/perf/perf.c:365:8
    #16 0x559cea95fbce in run_argv tools/perf/perf.c:409:2
    #17 0x559cea95fbce in main tools/perf/perf.c:539:3

    Uninitialized value was created by an allocation of 'bf' in the stack frame of function 'perf_event__synthesize_mmap_events'
    #0 0x559ceafc5f60 in perf_event__synthesize_mmap_events tools/perf/util/synthetic-events.c:445

    SUMMARY: MemorySanitizer: use-of-uninitialized-value elfutils/libdwfl/frame_unwind.c:648:8 in handle_cfi
    Signed-off-by: Ian Rogers
    Cc: Alexander Shishkin
    Cc: clang-built-linux@googlegroups.com
    Cc: Jiri Olsa
    Cc: Mark Rutland
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Sandeep Dasgupta
    Cc: Stephane Eranian
    Link: http://lore.kernel.org/lkml/20201113182053.754625-1-irogers@google.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Ian Rogers
     
  • "perf inject" can create corrupt files when synthesizing sample events from AUX
    data. This happens when in the input file, the first event (for the AUX data)
    has a different sample_type from the second event (generally dummy).

    Specifically, they differ in the bits that indicate the standard fields
    appended to perf records in the mmap buffer. "perf inject" deletes the first
    event and moves up the second event to first position.

    The problem is with the synthetic PERF_RECORD_MMAP (etc.) events created
    by "perf record".

    Since these are synthetic versions of events which are normally produced
    by the kernel, they have to have the standard fields appended as
    described by sample_type.

    "perf record" fills these in with zeroes, including the IDENTIFIER
    field; perf readers interpret records with zero IDENTIFIER using the
    descriptor for the first event in the file.

    Since "perf inject" changes the first event, these synthetic records are
    then processed with the wrong value of sample_type, and the perf reader
    reads bad data, reports on incorrect length records etc.

    Mismatching sample_types are seen with "perf record -e cs_etm//", where the AUX
    event has TID|TIME|CPU|IDENTIFIER and the dummy event has TID|TIME|IDENTIFIER.

    Perhaps they could be the same, but it isn't normally a problem if they aren't
    - perf has no problems reading the file.

    The sample_types have to agree on the position of IDENTIFIER, because
    that's how perf finds the right event descriptor in the first place, but
    they don't normally have to agree on other fields, and perf doesn't
    check that they do.

    The problem is specific to the way "perf inject" reorganizes the events
    and the way synthetic MMAP events are recorded with a zero identifier. A
    simple solution is to stop "perf inject" deleting the tracing event.

    Committer testing

    Removed the now unused 'evsel' variable, update the comment about the
    evsel removal not being performed anymore, and apply the patch manually
    as it failed with this warning:

    warning: Patch sent with format=flowed; space at the end of lines might be lost.

    Testing it with:

    $ perf bench internals inject-build-id
    # Running 'internals/inject-build-id' benchmark:
    Average build-id injection took: 8.543 msec (+- 0.130 msec)
    Average time per event: 0.838 usec (+- 0.013 usec)
    Average memory usage: 12717 KB (+- 9 KB)
    Average build-id-all injection took: 5.710 msec (+- 0.058 msec)
    Average time per event: 0.560 usec (+- 0.006 usec)
    Average memory usage: 12079 KB (+- 7 KB)
    $

    Signed-off-by: Al Grant
    Acked-by: Adrian Hunter
    Acked-by: Namhyung Kim
    Cc: Alexander Shishkin
    Cc: Jiri Olsa
    Cc: Mark Rutland
    Cc: Peter Zijlstra
    LPU-Reference: b9cf5611-daae-2390-3439-6617f8f0a34b@foss.arm.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Al Grant
     

13 Nov, 2020

5 commits

  • Since the commit 943b69ac1884 ("perf parse-events: Set exclude_guest=1
    for user-space counting"), 'exclude_guest=1' is set for user-space
    counting; and the branch sample's modifier has been altered, the sample
    event name has been changed from "branches:u:" to "branches:uH:", which
    gives out info for "user-space and host counting".

    But the cs-etm testing's regular expression cannot match the updated
    branch sample event and leads to test failure.

    This patch updates the branch sample pattern by using a more flexible
    expression '.*' to match branch sample's modifiers, so that allows the
    testing to work as expected.

    Fixes: 943b69ac1884 ("perf parse-events: Set exclude_guest=1 for user-space counting")
    Signed-off-by: Leo Yan
    Reviewed-by: Mathieu Poirier
    Cc: Alexander Shishkin
    Cc: Jin Yao
    Cc: Jiri Olsa
    Cc: Mark Rutland
    Cc: Mike Leach
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Suzuki Poulouse
    Cc: coresight ml
    Cc: stable@kernel.org
    Link: http://lore.kernel.org/lkml/20201110063417.14467-2-leo.yan@linaro.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Leo Yan
     
  • Fix a typo: s/devce_name/device_name.

    Fixes: fe0aed19b266 ("perf test: Introduce script for Arm CoreSight testing")
    Signed-off-by: Leo Yan
    Reviewed-by: Mathieu Poirier
    Cc: Alexander Shishkin
    Cc: Jin Yao
    Cc: Jiri Olsa
    Cc: Mark Rutland
    Cc: Mike Leach
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Suzuki Poulouse
    Cc: coresight ml
    Cc: stable@kernel.org
    Link: http://lore.kernel.org/lkml/20201110063417.14467-1-leo.yan@linaro.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Leo Yan
     
  • To bring in the change made in this cset:

    4d6ffa27b8e5116c ("x86/lib: Change .weak to SYM_FUNC_START_WEAK for arch/x86/lib/mem*_64.S")
    6dcc5627f6aec4cb ("x86/asm: Change all ENTRY+ENDPROC to SYM_FUNC_*")

    I needed to define SYM_FUNC_START_LOCAL() as SYM_L_GLOBAL as
    mem{cpy,set}_{orig,erms} are used by 'perf bench'.

    This silences these perf tools build warnings:

    Warning: Kernel ABI header at 'tools/arch/x86/lib/memcpy_64.S' differs from latest version at 'arch/x86/lib/memcpy_64.S'
    diff -u tools/arch/x86/lib/memcpy_64.S arch/x86/lib/memcpy_64.S
    Warning: Kernel ABI header at 'tools/arch/x86/lib/memset_64.S' differs from latest version at 'arch/x86/lib/memset_64.S'
    diff -u tools/arch/x86/lib/memset_64.S arch/x86/lib/memset_64.S

    Cc: Adrian Hunter
    Cc: Borislav Petkov
    Cc: Fangrui Song
    Cc: Ian Rogers
    Cc: Jiri Olsa
    Cc: Jiri Slaby
    Cc: Namhyung Kim
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • When execute command "perf lock report", it hits failure and outputs log
    as follows:

    perf: builtin-lock.c:623: report_lock_release_event: Assertion `!(seq->read_count < 0)' failed.
    Aborted

    This is an imbalance issue. The locking sequence structure
    "lock_seq_stat" contains the reader counter and it is used to check if
    the locking sequence is balance or not between acquiring and releasing.

    If the tool wrongly frees "lock_seq_stat" when "read_count" isn't zero,
    the "read_count" will be reset to zero when allocate a new structure at
    the next time; thus it causes the wrong counting for reader and finally
    results in imbalance issue.

    To fix this issue, if detects "read_count" is not zero (means still have
    read user in the locking sequence), goto the "end" tag to skip freeing
    structure "lock_seq_stat".

    Fixes: e4cef1f65061 ("perf lock: Fix state machine to recognize lock sequence")
    Signed-off-by: Leo Yan
    Acked-by: Jiri Olsa
    Link: https://lore.kernel.org/r/20201104094229.17509-2-leo.yan@linaro.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Leo Yan
     
  • The tracepoint "lock:lock_acquire" contains field "flags" but not
    "flag". Current code wrongly retrieves value from field "flag" and it
    always gets zero for the value, thus "perf lock" doesn't report the
    correct result.

    This patch replaces the field name "flag" with "flags", so can read out
    the correct flags for locking.

    Fixes: e4cef1f65061 ("perf lock: Fix state machine to recognize lock sequence")
    Signed-off-by: Leo Yan
    Acked-by: Jiri Olsa
    Link: https://lore.kernel.org/r/20201104094229.17509-1-leo.yan@linaro.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Leo Yan
     

03 Nov, 2020

11 commits

  • It was missed to add a swap function for PERF_RECORD_CGROUP.

    Fixes: ba78c1c5461c ("perf tools: Basic support for CGROUP event")
    Signed-off-by: Namhyung Kim
    Acked-by: Jiri Olsa
    Cc: Alexander Shishkin
    Cc: Ian Rogers
    Cc: Mark Rutland
    Cc: Peter Zijlstra
    Cc: Stephane Eranian
    Link: http://lore.kernel.org/lkml/20201102140228.303657-1-namhyung@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Namhyung Kim
     
  • We are missing swap for ino_generation field.

    Fixes: 5c5e854bc760 ("perf tools: Add attr->mmap2 support")
    Signed-off-by: Jiri Olsa
    Acked-by: Namhyung Kim
    Link: https://lore.kernel.org/r/20201101233103.3537427-2-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • We display garbage for undefined build_id objects, because we don't
    initialize the output buffer.

    Signed-off-by: Jiri Olsa
    Acked-by: Namhyung Kim
    Link: https://lore.kernel.org/r/20201101233103.3537427-1-jolsa@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Jiri Olsa
     
  • Making perf with gcc-9.1.1 generates the following warning:

    CC ui/browsers/hists.o
    ui/browsers/hists.c: In function 'perf_evsel__hists_browse':
    ui/browsers/hists.c:3078:61: error: '%d' directive output may be \
    truncated writing between 1 and 11 bytes into a region of size \
    between 2 and 12 [-Werror=format-truncation=]

    3078 | "Max event group index to sort is %d (index from 0 to %d)",
    | ^~
    ui/browsers/hists.c:3078:7: note: directive argument in the range [-2147483648, 8]
    3078 | "Max event group index to sort is %d (index from 0 to %d)",
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from /usr/include/stdio.h:937,
    from ui/browsers/hists.c:5:

    IOW, the string in line 3078 might be too long for buf[] of 64 bytes.

    Fix this by increasing the size of buf[] to 128.

    Fixes: dbddf1747441 ("perf report/top TUI: Support hotkeys to let user select any event for sorting")
    Signed-off-by: Song Liu
    Acked-by: Jiri Olsa
    Cc: Jin Yao
    Cc: stable@vger.kernel.org # v5.7+
    Link: http://lore.kernel.org/lkml/20201030235431.534417-1-songliubraving@fb.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Song Liu
     
  • To avoid this:

    util/scripting-engines/trace-event-python.c: In function 'python_start_script':
    util/scripting-engines/trace-event-python.c:1595:2: error: 'visibility' attribute ignored [-Werror=attributes]
    1595 | PyMODINIT_FUNC (*initfunc)(void);
    | ^~~~~~~~~~~~~~

    That started breaking when building with PYTHON=python3 and these gcc
    versions (I haven't checked with the clang ones, maybe it breaks there
    as well):

    # export PERF_TARBALL=http://192.168.86.5/perf/perf-5.9.0.tar.xz
    # dm fedora:33 fedora:rawhide
    1 107.80 fedora:33 : Ok gcc (GCC) 10.2.1 20201005 (Red Hat 10.2.1-5), clang version 11.0.0 (Fedora 11.0.0-1.fc33)
    2 92.47 fedora:rawhide : Ok gcc (GCC) 10.2.1 20201016 (Red Hat 10.2.1-6), clang version 11.0.0 (Fedora 11.0.0-1.fc34)
    #

    Avoid that by ditching that 'initfunc' function pointer with its:

    #define Py_EXPORTED_SYMBOL _attribute_ ((visibility ("default")))
    #define PyMODINIT_FUNC Py_EXPORTED_SYMBOL PyObject*

    And just call PyImport_AppendInittab() at the end of the ifdef python3
    block with the functions that were being attributed to that initfunc.

    Cc: Adrian Hunter
    Cc: Ian Rogers
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • The GCC specific __attribute__((optimize)) attribute does not what is
    commonly expected and is explicitly recommended against using in
    production code by the GCC people.

    Unlike what is often expected, it doesn't add to the optimization flags,
    but it fully replaces them, loosing any and all optimization flags
    provided by the compiler commandline.

    The only guaranteed upon means of inhibiting tail-calls is by placing a
    volatile asm with side-effects after the call such that the tail-call simply
    cannot be done.

    Given the original commit wasn't specific on which calls were the problem, this
    removal might re-introduce the problem, which can then be re-analyzed and cured
    properly.

    Signed-off-by: Peter Zijlstra
    Acked-by: Ard Biesheuvel
    Acked-by: Miguel Ojeda
    Cc: Alexei Starovoitov
    Cc: Arnd Bergmann
    Cc: Arvind Sankar
    Cc: Daniel Borkmann
    Cc: Geert Uytterhoeven
    Cc: Ian Rogers
    Cc: Josh Poimboeuf
    Cc: Kees Kook
    Cc: Martin Liška
    Cc: Nick Desaulniers
    Cc: Randy Dunlap
    Cc: Thomas Gleixner
    Link: http://lore.kernel.org/lkml/20201028081123.GT2628@hirez.programming.kicks-ass.net
    Signed-off-by: Arnaldo Carvalho de Melo

    Peter Zijlstra
     
  • Ian reports an issue that the metric DRAM_BW_Use often remains 0.

    The metric expression for DRAM_BW_Use on CLX/SKX:

    "( 64 * ( uncore_imc@cas_count_read@ + uncore_imc@cas_count_write@ ) / 1000000000 ) / duration_time"

    The counts of uncore_imc/cas_count_read/ and uncore_imc/cas_count_write/
    are scaled up by 64, that is to turn a count of cache lines into bytes,
    the count is then divided by 1000000000 to give GB.

    However, the counts of uncore_imc/cas_count_read/ and
    uncore_imc/cas_count_write/ have been scaled yet.

    The scale values are from sysfs, such as
    /sys/devices/uncore_imc_0/events/cas_count_read.scale.
    It's 6.103515625e-5 (64 / 1024.0 / 1024.0).

    So if we use original metric expression, the result is not correct.

    But the difficulty is, for SKL client, the counts are not scaled.

    The metric expression for DRAM_BW_Use on SKL:

    "64 * ( arb@event\\=0x81\\,umask\\=0x1@ + arb@event\\=0x84\\,umask\\=0x1@ ) / 1000000 / duration_time / 1000"

    root@kbl-ppc:~# perf stat -M DRAM_BW_Use -a -- sleep 1

    Performance counter stats for 'system wide':

    190 arb/event=0x84,umask=0x1/ # 1.86 DRAM_BW_Use
    29,093,178 arb/event=0x81,umask=0x1/
    1,000,703,287 ns duration_time

    1.000703287 seconds time elapsed

    The result is expected.

    So the easy way is just change the metric expression for CLX/SKX.
    This patch changes the metric expression to:

    "( ( ( uncore_imc@cas_count_read@ + uncore_imc@cas_count_write@ ) * 1048576 ) / 1000000000 ) / duration_time"

    1048576 = 1024 * 1024.

    Before (tested on CLX):

    root@lkp-csl-2sp5 ~# perf stat -M DRAM_BW_Use -a -- sleep 1

    Performance counter stats for 'system wide':

    765.35 MiB uncore_imc/cas_count_read/ # 0.00 DRAM_BW_Use
    5.42 MiB uncore_imc/cas_count_write/
    1001515088 ns duration_time

    1.001515088 seconds time elapsed

    After:

    root@lkp-csl-2sp5 ~# perf stat -M DRAM_BW_Use -a -- sleep 1

    Performance counter stats for 'system wide':

    767.95 MiB uncore_imc/cas_count_read/ # 0.80 DRAM_BW_Use
    5.02 MiB uncore_imc/cas_count_write/
    1001900010 ns duration_time

    1.001900010 seconds time elapsed

    Fixes: 038d3b53c284 ("perf vendor events intel: Update CascadelakeX events to v1.08")
    Fixes: b5ff7f2799a4 ("perf vendor events: Update SkylakeX events to v1.21")
    Signed-off-by: Jin Yao
    Acked-by: Ian Rogers
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: Jiri Olsa
    Cc: Kan Liang
    Cc: Peter Zijlstra
    Link: http://lore.kernel.org/lkml/20201023005334.7869-1-yao.jin@linux.intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Jin Yao
     
  • # ./perf trace -e sched:sched_switch -G test -a sleep 1
    perf: Segmentation fault
    Obtained 11 stack frames.
    ./perf(sighandler_dump_stack+0x43) [0x55cfdc636db3]
    /lib/x86_64-linux-gnu/libc.so.6(+0x3efcf) [0x7fd23eecafcf]
    ./perf(parse_cgroups+0x36) [0x55cfdc673f36]
    ./perf(+0x3186ed) [0x55cfdc70d6ed]
    ./perf(parse_options_subcommand+0x629) [0x55cfdc70e999]
    ./perf(cmd_trace+0x9c2) [0x55cfdc5ad6d2]
    ./perf(+0x1e8ae0) [0x55cfdc5ddae0]
    ./perf(+0x1e8ded) [0x55cfdc5ddded]
    ./perf(main+0x370) [0x55cfdc556f00]
    /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe6) [0x7fd23eeadb96]
    ./perf(_start+0x29) [0x55cfdc557389]
    Segmentation fault
    #

    It happens because "struct trace" in option->value is passed to the
    parse_cgroups function instead of "struct evlist".

    Fixes: 9ea42ba4411ac ("perf trace: Support setting cgroups as targets")
    Signed-off-by: Stanislav Ivanichkin
    Tested-by: Arnaldo Carvalho de Melo
    Acked-by: Namhyung Kim
    Cc: Dmitry Monakhov
    Link: http://lore.kernel.org/lkml/20201027094357.94881-1-sivanichkin@yandex-team.ru
    Signed-off-by: Arnaldo Carvalho de Melo

    Stanislav Ivanichkin
     
  • The addr in PERF_RECORD_KSYMBOL events for non-jited bpf progs points to
    the bpf interpreter, ie. within kernel text section. When processing the
    unregister event, this causes unexpected removal of vmlinux_map,
    crashing perf later in cleanup:

    # perf record -- timeout --signal=INT 2s /usr/share/bcc/tools/execsnoop
    PCOMM PID PPID RET ARGS
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.208 MB perf.data (5155 samples) ]
    perf: tools/include/linux/refcount.h:131: refcount_sub_and_test: Assertion `!(new > val)' failed.
    Aborted (core dumped)

    # perf script -D|grep KSYM
    0 0xa40 [0x48]: PERF_RECORD_KSYMBOL addr ffffffffa9b6b530 len 0 type 1 flags 0x0 name bpf_prog_f958f6eb72ef5af6
    0 0xab0 [0x48]: PERF_RECORD_KSYMBOL addr ffffffffa9b6b530 len 0 type 1 flags 0x0 name bpf_prog_8c42dee26e8cd4c2
    0 0xb20 [0x48]: PERF_RECORD_KSYMBOL addr ffffffffa9b6b530 len 0 type 1 flags 0x0 name bpf_prog_f958f6eb72ef5af6
    108563691893 0x33d98 [0x58]: PERF_RECORD_KSYMBOL addr ffffffffa9b6b3b0 len 0 type 1 flags 0x0 name bpf_prog_bc5697a410556fc2_syscall__execve
    108568518458 0x34098 [0x58]: PERF_RECORD_KSYMBOL addr ffffffffa9b6b3f0 len 0 type 1 flags 0x0 name bpf_prog_45e2203c2928704d_do_ret_sys_execve
    109301967895 0x34830 [0x58]: PERF_RECORD_KSYMBOL addr ffffffffa9b6b3b0 len 0 type 1 flags 0x1 name bpf_prog_bc5697a410556fc2_syscall__execve
    109302007356 0x348b0 [0x58]: PERF_RECORD_KSYMBOL addr ffffffffa9b6b3f0 len 0 type 1 flags 0x1 name bpf_prog_45e2203c2928704d_do_ret_sys_execve
    perf: tools/include/linux/refcount.h:131: refcount_sub_and_test: Assertion `!(new > val)' failed.

    Here the addresses match the bpf interpreter:

    # grep -e ffffffffa9b6b530 -e ffffffffa9b6b3b0 -e ffffffffa9b6b3f0 /proc/kallsyms
    ffffffffa9b6b3b0 t __bpf_prog_run224
    ffffffffa9b6b3f0 t __bpf_prog_run192
    ffffffffa9b6b530 t __bpf_prog_run32

    Fix by not allowing vmlinux_map to be removed by PERF_RECORD_KSYMBOL
    unregister event.

    Signed-off-by: Tommi Rantala
    Acked-by: Jiri Olsa
    Tested-by: Jiri Olsa
    Link: https://lore.kernel.org/r/20201016114718.54332-1-tommi.t.rantala@nokia.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Tommi Rantala
     
  • To pick the changes from:

    ecb8ac8b1f146915 ("mm/madvise: introduce process_madvise() syscall: an external memory hinting API")

    That addresses these perf build warning:

    Warning: Kernel ABI header at 'tools/include/uapi/asm-generic/unistd.h' differs from latest version at 'include/uapi/asm-generic/unistd.h'
    diff -u tools/include/uapi/asm-generic/unistd.h include/uapi/asm-generic/unistd.h
    Warning: Kernel ABI header at 'tools/perf/arch/x86/entry/syscalls/syscall_64.tbl' differs from latest version at 'arch/x86/entry/syscalls/syscall_64.tbl'
    diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl

    Cc: Adrian Hunter
    Cc: Ian Rogers
    Cc: Jiri Olsa
    Cc: Linus Torvalds
    Cc: Minchan Kim
    Cc: Namhyung Kim
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • To pick the changes in:

    85367030a6c7ef33 ("libbpf: Centralize poisoning and poison reallocarray()")
    7d9c71e10baa3496 ("libbpf: Extract generic string hashing function for reuse")

    That don't entail any changes in tools/perf.

    This addresses this perf build warning:

    Warning: Kernel ABI header at 'tools/perf/util/hashmap.h' differs from latest version at 'tools/lib/bpf/hashmap.h'
    diff -u tools/perf/util/hashmap.h tools/lib/bpf/hashmap.h

    Not a kernel ABI, its just that this uses the mechanism in place for
    checking kernel ABI files drift.

    Cc: Adrian Hunter
    Cc: Alexei Starovoitov
    Cc: Andrii Nakryiko
    Cc: Ian Rogers
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo