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

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>
2025-04-10 14:39:26 +02:00
..
arch perf tools: Fix up some comments and code to properly use the event_source bus 2025-04-07 10:08:36 +02:00
bench perf bench: Fix perf bench syscall loop count 2025-04-10 14:39:23 +02:00
check-header_ignore_hunks/lib perf tools: Cope with differences for lib/list_sort.c copy from the kernel 2024-10-02 15:07:32 -03:00
dlfilters
Documentation perf tools: Fix up some comments and code to properly use the event_source bus 2025-04-07 10:08:36 +02:00
include/perf
jvmti
pmu-events perf vendor events arm64 AmpereOneX: Fix frontend_bound calculation 2025-04-10 14:39:26 +02:00
python
scripts perf scripts python cs-etm: Restore first sample log in verbose mode 2024-07-31 16:58:18 -03:00
tests perf bpf-filter: Fix a parsing error with comma 2025-04-10 14:39:26 +02:00
trace perf beauty: Update copy of linux/socket.h with the kernel sources 2024-09-30 17:23:38 -03:00
ui perf tools: Print lost samples due to BPF filter 2024-08-28 18:07:20 -03:00
util perf bpf-filter: Fix a parsing error with comma 2025-04-10 14:39:26 +02:00
.gitignore
Build perf check: Introduce 'check' subcommand 2024-09-04 09:56:05 -03:00
builtin-annotate.c perf annotate: Display the branch counter histogram 2024-08-14 10:20:40 -03:00
builtin-bench.c perf bench uprobe: Add uretprobe variant of uprobe benchmarks 2024-04-12 17:54:02 -03:00
builtin-buildid-cache.c perf dso: Add reference count checking and accessor functions 2024-05-06 15:28:49 -03:00
builtin-buildid-list.c perf buildid-list: Use perf_tool__init 2024-08-12 18:07:10 -03:00
builtin-c2c.c perf mem: Fix missed p-core mem events on ADL and RPL 2024-09-06 11:45:17 -03:00
builtin-check.c perf check: Fix inconsistencies in feature names 2024-09-04 16:19:53 -03:00
builtin-config.c
builtin-daemon.c perf daemon: Fix the build on more 32-bit architectures 2024-08-19 21:44:30 -03:00
builtin-data.c
builtin-diff.c perf report: Display the branch counter histogram 2024-08-14 10:20:40 -03:00
builtin-evlist.c perf evlist: Print hint for group 2024-09-11 13:08:45 -03:00
builtin-ftrace.c perf ftrace: Fix undefined behavior in cmp_profile_data() 2024-12-19 18:12:59 +01:00
builtin-help.c perf help: Fix a typo ("bellow") 2024-09-11 11:24:12 -03:00
builtin-inject.c perf inject: Fix use without initialization of local variables 2025-02-08 09:57:33 +01:00
builtin-kallsyms.c perf dso: Add reference count checking and accessor functions 2024-05-06 15:28:49 -03:00
builtin-kmem.c libsubcmd: Don't free the usage string 2024-09-04 09:54:24 -03:00
builtin-kvm.c libsubcmd: Don't free the usage string 2024-09-04 09:54:24 -03:00
builtin-kwork.c libsubcmd: Don't free the usage string 2024-09-04 09:54:24 -03:00
builtin-list.c perf list: Fix topic and pmu_name argument order 2024-12-05 14:02:24 +01:00
builtin-lock.c perf lock: Fix parse_lock_type which only retrieve one lock flag 2025-02-08 09:57:35 +01:00
builtin-mem.c perf mem: Fix the wrong reference in parse_record_events() 2024-09-06 11:45:28 -03:00
builtin-probe.c perf probe: Use zfree() to avoid possibly accessing dangling pointers 2024-05-07 12:44:02 -03:00
builtin-record.c perf record: Fix sample cgroup & namespace tracking 2024-08-19 16:32:05 -03:00
builtin-report.c perf report: Switch data file correctly in TUI 2025-04-10 14:39:22 +02:00
builtin-sched.c libsubcmd: Don't free the usage string 2024-09-04 09:54:24 -03:00
builtin-script.c perf env: Find correct branch counter info on hybrid 2024-09-11 13:08:46 -03:00
builtin-stat.c perf tools: Fix up some comments and code to properly use the event_source bus 2025-04-07 10:08:36 +02:00
builtin-timechart.c perf timechart: Use perf_tool__init() 2024-08-12 18:12:06 -03:00
builtin-top.c perf top: Don't complain about lack of vmlinux when not resolving some kernel samples 2025-02-08 09:57:31 +01:00
builtin-trace.c perf trace: Fix runtime error of index out of bounds 2025-02-08 09:58:07 +01:00
builtin-version.c perf version: Update --build-options to use 'supported_features' array 2024-09-04 16:19:29 -03:00
builtin.h perf check: Introduce 'check' subcommand 2024-09-04 09:56:05 -03:00
check-headers.sh tools headers: Update the linux/unaligned.h copy with the kernel sources 2024-10-28 12:34:28 -03:00
command-list.txt
CREDITS
design.txt
Makefile perf tools: Fix wrong message when running "make JOBS=1" 2024-08-01 12:11:33 -03:00
Makefile.config perf: Always feature test reallocarray 2025-04-10 14:39:22 +02:00
Makefile.perf perf build: Fix in-tree build due to symbolic link 2025-04-10 14:39:22 +02:00
MANIFEST perf MANIFEST: Add arch/*/include/uapi/asm/bpf_perf_event.h to the perf tarball 2025-02-08 09:57:32 +01:00
perf-archive.sh perf build: Add shellcheck to tools/perf scripts 2024-04-12 17:54:02 -03:00
perf-completion.sh perf build: Add shellcheck to tools/perf scripts 2024-04-12 17:54:02 -03:00
perf-iostat.sh
perf-read-vdso.c
perf-sys.h
perf.c perf check: Introduce 'check' subcommand 2024-09-04 09:56:05 -03:00
perf.h