mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2026-01-13 09:38:18 +00:00
Compiling perf with make LIBPFM4=1 includes libpfm support and
enables test case 63 'Test libpfm4 support'. This test reports an error
on all platforms for subtest 63.2 'test groups of --pfm-events'.
The reported error message is 'nested event groups not supported'
# ./perf test -F 63
63: Test libpfm4 support :
63.1: test of individual --pfm-events :
Error:
failed to parse event stereolab : event not found
Error:
failed to parse event stereolab,instructions : event not found
Error:
failed to parse event instructions,stereolab : event not found
Ok
63.2: test groups of --pfm-events :
Error:
nested event groups not supported <------ Error message here
Error:
failed to parse event {stereolab} : event not found
Error:
failed to parse event {instructions,cycles},{instructions,stereolab} :\
event not found
Ok
#
This patch addresses the error message 'nested event groups not supported'.
The root cause is function parse_libpfm_events_option() which parses the
event string '{},{instructions}' and can not handle a leading empty
group notation '{},...'.
The code detects the first (empty) group indicator '{' but does not
terminate group processing on the following group closing character '}'.
So when the second group indicator '{' is detected, the code assumes
a nested group and returns an error.
With the error message fixed, also change the expected event number to
one for the test case to succeed.
While at it also fix a memory leak. In good case the function does not
free the duplicated string given as first parameter.
Output after:
# ./perf test -F 63
63: Test libpfm4 support :
63.1: test of individual --pfm-events :
Error:
failed to parse event stereolab : event not found
Error:
failed to parse event stereolab,instructions : event not found
Error:
failed to parse event instructions,stereolab : event not found
Ok
63.2: test groups of --pfm-events :
Error:
failed to parse event {stereolab} : event not found
Error:
failed to parse event {instructions,cycles},{instructions,stereolab} : \
event not found
Ok
#
Error message 'nested event groups not supported' is gone.
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Acked-By: Ian Rogers <irogers@google.com>
Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Link: http://lore.kernel.org/lkml/20210517140931.2559364-1-tmricht@linux.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
||
|---|---|---|
| .. | ||
| attr | ||
| shell | ||
| .gitignore | ||
| api-io.c | ||
| attr.c | ||
| attr.py | ||
| backward-ring-buffer.c | ||
| bitmap.c | ||
| bp_account.c | ||
| bp_signal_overflow.c | ||
| bp_signal.c | ||
| bpf-script-example.c | ||
| bpf-script-test-kbuild.c | ||
| bpf-script-test-prologue.c | ||
| bpf-script-test-relocation.c | ||
| bpf.c | ||
| Build | ||
| builtin-test.c | ||
| clang.c | ||
| code-reading.c | ||
| cpumap.c | ||
| demangle-java-test.c | ||
| demangle-ocaml-test.c | ||
| dso-data.c | ||
| dwarf-unwind.c | ||
| event_update.c | ||
| event-times.c | ||
| evsel-roundtrip-name.c | ||
| evsel-tp-sched.c | ||
| expand-cgroup.c | ||
| expr.c | ||
| fdarray.c | ||
| genelf.c | ||
| hists_common.c | ||
| hists_common.h | ||
| hists_cumulate.c | ||
| hists_filter.c | ||
| hists_link.c | ||
| hists_output.c | ||
| is_printable_array.c | ||
| keep-tracking.c | ||
| kmod-path.c | ||
| llvm.c | ||
| llvm.h | ||
| make | ||
| maps.c | ||
| mem2node.c | ||
| mem.c | ||
| mmap-basic.c | ||
| mmap-thread-lookup.c | ||
| openat-syscall-all-cpus.c | ||
| openat-syscall-tp-fields.c | ||
| openat-syscall.c | ||
| parse-events.c | ||
| parse-metric.c | ||
| parse-no-sample-id-all.c | ||
| pe-file-parsing.c | ||
| pe-file.c | ||
| pe-file.exe | ||
| pe-file.exe.debug | ||
| perf-hooks.c | ||
| perf-record.c | ||
| perf-targz-src-pkg | ||
| perf-time-to-tsc.c | ||
| pfm.c | ||
| pmu-events.c | ||
| pmu.c | ||
| python-use.c | ||
| sample-parsing.c | ||
| sdt.c | ||
| stat.c | ||
| sw-clock.c | ||
| switch-tracking.c | ||
| task-exit.c | ||
| tests.h | ||
| thread-map.c | ||
| thread-maps-share.c | ||
| time-utils-test.c | ||
| topology.c | ||
| unit_number__scnprintf.c | ||
| vmlinux-kallsyms.c | ||
| wp.c | ||