linux-stable/tools/perf/tests
Ian Rogers 146edff3d7 perf test: Parse events workaround for dash/minus
Skip an event configuration for event names with a dash/minus in them.
Events with a dash/minus in their name cause parsing issues as legacy
encoding of events would use a dash/minus as a separator.

The parser separates events with dashes into prefixes and suffixes and
then recombines them. Unfortunately if an event has part of its name
that matches a legacy token then the recombining fails.

This is seen for branch-brs where branch is a legacy token. branch-brs
was introduced to sysfs in:

  https://lore.kernel.org/all/20220322221517.2510440-5-eranian@google.com/

The failure is shown below as well as the workaround to use a config
where the dash/minus isn't treated specially:

```
  $ perf stat -e branch-brs true
  event syntax error: 'branch-brs'
                             \___ parser error

  $ perf stat -e cpu/branch-brs/ true

   Performance counter stats for 'true':

              46,179      cpu/branch-brs/
```

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
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: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20221013011205.3151391-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2022-10-31 11:07:25 -03:00
..
attr perf test: Fix attr tests for PERF_FORMAT_LOST 2022-10-15 10:13:16 -03:00
shell perf test: Do not set TEST_SKIP for record subtests 2022-10-27 16:37:26 -03:00
.gitignore
api-io.c
attr.c
attr.py
backward-ring-buffer.c
bitmap.c
bp_account.c perf test: Fix variable length array undefined behavior in bp_account 2022-06-19 10:41:43 -03:00
bp_signal.c
bp_signal_overflow.c
bpf-script-example.c perf bpf: Convert legacy map definition to BTF-defined 2022-08-01 14:43:13 -03:00
bpf-script-test-kbuild.c
bpf-script-test-prologue.c
bpf-script-test-relocation.c
bpf.c perf test bpf: Skip test if clang is not present 2022-05-21 14:54:21 -03:00
Build perf test: Refactor shell tests allowing subdirs 2022-08-13 15:13:20 -03:00
builtin-test-list.c perf test: Refactor shell tests allowing subdirs 2022-08-13 15:13:20 -03:00
builtin-test-list.h perf test: Refactor shell tests allowing subdirs 2022-08-13 15:13:20 -03:00
builtin-test.c perf test: Refactor shell tests allowing subdirs 2022-08-13 15:13:20 -03:00
clang.c
code-reading.c perf tools: Do not pass NULL to parse_events() 2022-08-10 14:30:09 -03:00
cpumap.c perf cpumap: Add range data encoding 2022-10-04 08:55:21 -03:00
demangle-java-test.c
demangle-ocaml-test.c
dlfilter-test.c perf tools: Move 'struct perf_sample' to a separate header file to disentangle headers 2022-10-31 11:06:41 -03:00
dso-data.c
dwarf-unwind.c perf unwind: Don't show unwind error messages when augmenting frame pointer stack 2022-04-09 12:34:29 -03:00
event-times.c perf tools: Do not pass NULL to parse_events() 2022-08-10 14:30:09 -03:00
event_update.c perf events: Prefer union over variable length array 2022-10-04 08:55:21 -03:00
evsel-roundtrip-name.c perf tools: Do not pass NULL to parse_events() 2022-08-10 14:30:09 -03:00
evsel-tp-sched.c
expand-cgroup.c perf pmu-events: Hide the pmu_events 2022-08-13 15:02:08 -03:00
expr.c perf expr: Allow a double if expression 2022-10-06 08:03:52 -03:00
fdarray.c
genelf.c
hists_common.c
hists_common.h
hists_cumulate.c perf tools: Do not pass NULL to parse_events() 2022-08-10 14:30:09 -03:00
hists_filter.c perf tools: Do not pass NULL to parse_events() 2022-08-10 14:30:09 -03:00
hists_link.c perf tools: Do not pass NULL to parse_events() 2022-08-10 14:30:09 -03:00
hists_output.c perf tools: Do not pass NULL to parse_events() 2022-08-10 14:30:09 -03:00
is_printable_array.c
keep-tracking.c perf tools: Do not pass NULL to parse_events() 2022-08-10 14:30:09 -03:00
kmod-path.c
llvm.c
llvm.h
make
maps.c
mem.c
mem2node.c
mmap-basic.c perf tests: Add missing event.h include 2022-10-31 11:07:08 -03:00
mmap-thread-lookup.c
openat-syscall-all-cpus.c perf tests: Avoid pthread.h inclusion 2022-10-04 08:55:19 -03:00
openat-syscall-tp-fields.c perf tools: Move 'struct perf_sample' to a separate header file to disentangle headers 2022-10-31 11:06:41 -03:00
openat-syscall.c perf test: Use skip in openat syscall 2022-05-23 10:01:57 -03:00
parse-events.c perf test: Parse events workaround for dash/minus 2022-10-31 11:07:25 -03:00
parse-metric.c perf stat: Allocate evsel->stats->aggr properly 2022-10-27 16:37:25 -03:00
parse-no-sample-id-all.c perf tools: Move 'struct perf_sample' to a separate header file to disentangle headers 2022-10-31 11:06:41 -03:00
pe-file-parsing.c
pe-file.c
pe-file.exe
pe-file.exe.debug
perf-hooks.c
perf-record.c perf tests: Add missing event.h include 2022-10-31 11:07:08 -03:00
perf-targz-src-pkg
perf-time-to-tsc.c perf tools: Move 'struct perf_sample' to a separate header file to disentangle headers 2022-10-31 11:06:41 -03:00
pfm.c
pmu-events.c perf stat: Allocate evsel->stats->aggr properly 2022-10-27 16:37:25 -03:00
pmu.c
python-use.c
sample-parsing.c perf tools: Support reading PERF_FORMAT_LOST 2022-08-19 15:56:56 -03:00
sdt.c
sigtrap.c perf test: Skip sigtrap test on old kernels 2022-10-04 08:55:22 -03:00
stat.c
sw-clock.c perf tools: Move 'struct perf_sample' to a separate header file to disentangle headers 2022-10-31 11:06:41 -03:00
switch-tracking.c perf tools: Move 'struct perf_sample' to a separate header file to disentangle headers 2022-10-31 11:06:41 -03:00
task-exit.c
tests.h
thread-map.c
thread-maps-share.c
time-utils-test.c
topology.c perf stat: Rename to aggr_cpu_id.thread_idx 2022-10-06 08:03:53 -03:00
unit_number__scnprintf.c
vmlinux-kallsyms.c perf tests vmlinux-kallsyms: Update is_ignored_symbol function to match the kernel ignored list 2022-09-28 11:11:33 -03:00
wp.c perf test: Skip wp modify test on old kernels 2022-09-21 16:07:32 -03:00