linux/tools/perf/tests/shell
Namhyung Kim 8f178998af perf bpf-filter: Fix a parsing error with comma
[ Upstream commit 35d13f841a ]

The previous change to support cgroup filters introduced a bug that
pathname can include commas.  It confused the lexer to treat an item and
the trailing comma as a single token.  And it resulted in a parse error:

  $ sudo perf record -e cycles:P --filter 'period > 0, ip > 64' -- true
  perf_bpf_filter: Error: Unexpected item: 0,
  perf_bpf_filter: syntax error, unexpected BFT_ERROR, expecting BFT_NUM

   Usage: perf record [<options>] [<command>]
      or: perf record [<options>] -- <command> [<options>]

          --filter <filter>
                            event filter

It should get "0" and "," separately.

An easiest fix would be to remove "," from the possible pathname
characters.  As it's for cgroup names, probably ok to assume it won't
have commas in the pathname.

I found that the existing BPF filtering test didn't have any complex
filter condition with commas.  Let's update the group filter test which
is supposed to test filter combinations like this.

Link: https://lore.kernel.org/r/20250307220922.434319-1-namhyung@kernel.org
Fixes: 91e88437d5 ("perf bpf-filter: Support filtering on cgroups")
Reported-by: Sally Shi <sshii@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-04-10 14:39:26 +02:00
..
base_probe perf test: Handle perftool-testsuite_probe failure due to broken DWARF 2024-10-23 17:23:09 -03:00
base_report perf testsuite report: Add test for perf-report basic functionality 2024-08-28 18:07:21 -03:00
common perf testsuite report: Add test for perf-report basic functionality 2024-08-28 18:07:21 -03:00
coresight perf tools: annotate asm_pure_loop.S 2025-04-10 14:39:26 +02:00
lib perf test shell probe_vfs_getname: Remove extraneous '=' from probe line number regex 2024-09-11 09:35:34 -03:00
annotate.sh perf test annotate: Dump trapping test in trap handler 2024-08-14 10:20:39 -03:00
buildid.sh perf tests shell: Fixed shellcheck warnings 2023-06-13 23:40:34 -03:00
daemon.sh perf test shell daemon: Make signal test less racy 2024-01-26 10:51:49 -03:00
diff.sh perf test shell diff: Skip test if test_loop symbol is missing in the perf binary 2023-12-06 13:01:36 -03:00
ftrace.sh perf tests ftrace: Add pattern check for time, count 2024-08-08 09:59:40 -03:00
list.sh perf test: Workaround debug output in list test 2024-01-26 10:51:49 -03:00
lock_contention.sh perf tests: Ignore shellcheck warning in lock_contention 2023-10-17 12:40:51 -07:00
perftool-testsuite_probe.sh perf testsuite: Add test case for perf probe 2024-02-16 11:49:22 -08:00
perftool-testsuite_report.sh perf testsuite report: Add test case for perf report 2024-08-28 18:07:21 -03:00
pipe_test.sh perf inject: Lazy build-id mmap2 event insertion 2024-09-10 17:32:47 -03:00
probe_vfs_getname.sh tests/shell: Fix shellcheck SC1090 to handle the location of sourced files 2023-09-26 21:47:12 -07:00
record+probe_libc_inet_pton.sh perf tests probe_vfs_getname.sh: Update to use 'perf check feature' 2024-09-04 16:19:52 -03:00
record+script_probe_vfs_getname.sh perf tests probe_vfs_getname.sh: Update to use 'perf check feature' 2024-09-04 16:19:52 -03:00
record+zstd_comp_decomp.sh perf tests record+zstd_comp_decomp: Fix the shellcheck warnings about word splitting/quoting 2023-08-03 17:01:27 -03:00
record.sh perf test: Add cgroup sampling test 2024-08-19 16:32:32 -03:00
record_bpf_filter.sh perf bpf-filter: Fix a parsing error with comma 2025-04-10 14:39:26 +02:00
record_lbr.sh perf test shell lbr: Support hybrid x86 systems too 2024-08-08 17:30:39 -03:00
record_offcpu.sh perf tests offcpu: Adjust test case perf record offcpu profiling tests for s390 2023-11-09 13:49:33 -03:00
record_sideband.sh perf tests: Fix shellcheck warning in record_sideband.sh 2023-10-17 12:40:51 -07:00
script.sh perf test: Avoid python leak sanitizer test failures 2024-07-31 16:12:59 -03:00
stat+csv_output.sh perf stat: Support per-cluster aggregation 2024-02-09 14:59:53 -08:00
stat+csv_summary.sh tests/shell: Fix shellcheck issues in tests/shell/stat+shadow_stat.sh tetscase 2023-09-26 21:47:12 -07:00
stat+json_output.sh perf test: Stat output per thread of just the parent process 2024-03-21 13:54:39 -03:00
stat+shadow_stat.sh tests/shell: Fix shellcheck issues in tests/shell/stat+shadow_stat.sh tetscase 2023-09-26 21:47:12 -07:00
stat+std_output.sh perf stat: Support per-cluster aggregation 2024-02-09 14:59:53 -08:00
stat.sh perf test: Add cputype testing to perf stat 2023-05-15 09:18:43 -03:00
stat_all_metricgroups.sh perf tests: Fix shellcheck warning in stat_all_metricgroups 2023-10-17 12:40:51 -07:00
stat_all_metrics.sh perf tests stat_all_metrics: Fix shellcheck warning SC2076 2023-06-13 23:40:33 -03:00
stat_all_pfm.sh perf test: Add test of libpfm4 events 2023-06-12 15:57:53 -03:00
stat_all_pmu.sh perf tools: Fix spelling mistake "parametrized" -> "parameterized" 2023-11-09 13:49:32 -03:00
stat_bpf_counters.sh perf test stat_bpf_counter.sh: Stabilize the test results 2024-06-26 11:10:58 -07:00
stat_bpf_counters_cgrp.sh perf test stat_bpf_counters_cgrp: Enhance perf stat cgroup BPF counter test 2023-08-29 14:16:15 -03:00
stat_metrics_values.sh perf test: Simplify metric value validation test final report 2024-02-01 22:16:37 -08:00
test_arm_callgraph_fp.sh perf test: Make test_arm_callgraph_fp.sh more robust 2024-06-24 14:42:59 -07:00
test_arm_coresight.sh perf test shell arm_coresight: Increase buffer size for Coresight basic tests 2024-04-18 22:22:51 -03:00
test_arm_spe.sh perf tests test_arm_spe: Address shellcheck warnings about signal name case 2023-06-13 23:40:33 -03:00
test_arm_spe_fork.sh perf tests: Address signal case issues detected via shellcheck 2023-08-03 17:01:25 -03:00
test_brstack.sh perf tests: Skip branch stack sampling test if brstack_bench symbol is missing 2023-11-27 15:40:22 -03:00
test_data_symbol.sh perf tests: Skip data symbol test if buf1 symbol is missing 2023-11-27 15:40:28 -03:00
test_intel_pt.sh tests/shell: Fix shellcheck SC1090 to handle the location of sourced files 2023-09-26 21:47:12 -07:00
test_java_symbol.sh perf test java symbol: Remove needless debuginfod queries 2023-05-10 12:54:53 -03:00
test_perf_data_converter_json.sh perf test: Use common python setup library 2023-12-05 15:48:52 -03:00
test_stat_intel_tpebs.sh perf test: Add test for Intel TPEBS counting mode 2024-08-13 15:26:54 -03:00
test_task_analyzer.sh perf tools test_task_analyzer.sh: Update to use 'perf check feature' 2024-09-04 16:19:33 -03:00
test_uprobe_from_different_cu.sh perf test: Skip uprobe test if probe command isn't present 2024-09-03 11:23:01 -03:00
trace+probe_vfs_getname.sh tests/shell: Fix shellcheck SC1090 to handle the location of sourced files 2023-09-26 21:47:12 -07:00
trace_btf_enum.sh perf test: Skip syscall enum test if no landlock syscall 2025-02-08 09:58:07 +01:00