linux-stable/tools/perf
Namhyung Kim 4310551b76 perf bpf filter: Show warning for missing sample flags
For a BPF filter to work properly, users need to provide appropriate
options to enable the sample types.  Otherwise the BPF program would
see an invalid value (i.e. always 0) and filter won't work well.

Show a warning message if sample types are missing like below.

  $ sudo ./perf record -e cycles --filter 'addr < 100' true
  Error: cycles event does not have PERF_SAMPLE_ADDR
   Hint: please add -d option to perf record.
  failed to set filter "BPF" on event cycles with 22 (Invalid argument)

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Hao Luo <haoluo@google.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Song Liu <song@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: bpf@vger.kernel.org
Link: https://lore.kernel.org/r/20230314234237.3008956-2-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2023-03-15 11:08:36 -03:00
..
arch perf cs-etm: Avoid printing warning in cs_etm_is_ete() check 2023-03-13 17:42:27 -03:00
bench perf bench syscall: Add execve syscall benchmark 2023-02-02 16:32:19 -03:00
dlfilters perf tools: Fix usage of the verbose variable 2022-12-20 15:16:33 -03:00
Documentation perf record: Add BPF event filter support 2023-03-15 11:08:34 -03:00
examples/bpf perf trace: Remove unused bpf map 'syscalls' 2022-11-23 10:30:00 -03:00
include/perf perf bpf: Remove now unused BPF headers 2022-11-04 11:41:48 -03:00
jvmti
pmu-events perf vendor events s390: Add metric for TLB and cache 2023-03-14 18:36:08 -03:00
python
scripts perf script: Fix Python support when no libtraceevent 2023-03-15 10:27:07 -03:00
tests perf build: Error if no libelf and NO_LIBELF isn't set 2023-03-14 08:29:46 -03:00
trace perf beauty: Update copy of linux/socket.h with the kernel sources 2023-01-18 10:12:23 -03:00
ui perf tools: Fix "kernel lock contention analysis" test by not printing warnings in quiet mode 2022-10-27 16:37:26 -03:00
util perf bpf filter: Show warning for missing sample flags 2023-03-15 11:08:36 -03:00
.gitignore perf jevents: Run metric_test.py at compile-time 2023-02-03 17:11:39 -03:00
Build perf script: Fix Python support when no libtraceevent 2023-03-15 10:27:07 -03:00
builtin-annotate.c perf build: Use libtraceevent from the system 2022-12-14 11:16:12 -03:00
builtin-bench.c perf bench syscall: Add execve syscall benchmark 2023-02-02 16:32:19 -03:00
builtin-buildid-cache.c
builtin-buildid-list.c perf buildid-list: Add a "-m" option to show kernel and modules build-ids 2022-07-18 16:35:34 -03:00
builtin-c2c.c perf c2c: Add report option to show false sharing in adjacent cachelines 2023-02-16 09:33:45 -03:00
builtin-config.c
builtin-daemon.c perf daemon: Use sig_atomic_t to avoid UB 2022-11-03 09:35:44 -03:00
builtin-data.c perf build: Use libtraceevent from the system 2022-12-14 11:16:12 -03:00
builtin-diff.c perf tools: Make quiet mode consistent between tools 2022-10-27 16:37:26 -03:00
builtin-evlist.c
builtin-ftrace.c perf ftrace: Reuse target::initial_delay 2023-03-13 14:52:14 -03:00
builtin-help.c
builtin-inject.c perf inject: Fix --buildid-all not to eat up MMAP2 2023-02-23 10:03:00 -03:00
builtin-kallsyms.c
builtin-kmem.c mm: discard __GFP_ATOMIC 2023-02-02 22:33:13 -08:00
builtin-kvm.c perf build: Use libtraceevent from the system 2022-12-14 11:16:12 -03:00
builtin-kwork.c perf build: Use libtraceevent from the system 2022-12-14 11:16:12 -03:00
builtin-list.c perf list: Support for printing metric thresholds 2023-02-19 08:06:49 -03:00
builtin-lock.c perf lock contention: Show lock type with address 2023-03-14 08:33:48 -03:00
builtin-mem.c perf tools: Move 'struct perf_sample' to a separate header file to disentangle headers 2022-10-31 11:06:41 -03:00
builtin-probe.c perf probe: Fix usage when libtraceevent is missing 2023-02-02 16:32:19 -03:00
builtin-record.c perf bpf filter: Show warning for missing sample flags 2023-03-15 11:08:36 -03:00
builtin-report.c perf evlist: Remove nr_groups 2023-03-13 17:42:27 -03:00
builtin-sched.c perf tools: Use dedicated non-atomic clear/set bit helpers 2022-12-05 09:29:06 -03:00
builtin-script.c perf script: Fix Python support when no libtraceevent 2023-03-15 10:27:07 -03:00
builtin-stat.c perf stat: Don't remove all grouped events when CPU maps disagree 2023-03-13 15:11:51 -03:00
builtin-timechart.c perf build: Use libtraceevent from the system 2022-12-14 11:16:12 -03:00
builtin-top.c perf evlist: Remove group option. 2022-12-14 15:28:18 -03:00
builtin-trace.c perf record: Reuse target::initial_delay 2023-03-13 14:52:14 -03:00
builtin-version.c perf build: Remove unused HAVE_GLIBC_SUPPORT 2023-03-14 08:29:46 -03:00
builtin.h perf kwork: New tool to trace time properties of kernel work (such as softirq, and workqueue) 2022-07-26 16:01:24 -03:00
check-headers.sh tools headers: Update the copy of x86's memcpy_64.S used in 'perf bench' 2022-10-25 17:40:48 -03:00
command-list.txt perf help: Use HAVE_LIBTRACEEVENT to filter out unsupported commands 2023-01-02 11:51:53 -03:00
CREDITS
design.txt
Makefile perf tools: Use "grep -E" instead of "egrep" 2022-12-14 15:28:19 -03:00
Makefile.config perf build: Error if no libelf and NO_LIBELF isn't set 2023-03-14 08:29:46 -03:00
Makefile.perf perf bpf filter: Implement event sample filtering 2023-03-15 10:34:33 -03:00
MANIFEST tools lib traceevent: Remove libtraceevent 2022-12-14 11:16:12 -03:00
perf-archive.sh
perf-completion.sh perf tools: Fix auto-complete on aarch64 2023-02-08 10:38:10 -03:00
perf-iostat.sh
perf-read-vdso.c
perf-sys.h
perf.c perf build: Use libtraceevent from the system 2022-12-14 11:16:12 -03:00
perf.h