linux-stable/tools/perf
Namhyung Kim 2d656b0f81 perf stat: Fix handling of unsupported cgroup events when using BPF counters
When --for-each-cgroup option is used, it fails when any of events is
not supported and exits immediately.  This is not how 'perf stat'
handles unsupported events.

Let's ignore the failure and proceed with others so that the output is
similar to when BPF counters are not used:

Before:

  $ sudo ./perf stat -a --bpf-counters -e L1-icache-loads,L1-dcache-loads --for-each-cgroup system.slice,user.slice sleep 1
  Failed to open first cgroup events
  $

After it shows output similat to when --bpf-counters isn't specified:

  $ sudo ./perf stat -a --bpf-counters -e L1-icache-loads,L1-dcache-loads --for-each-cgroup system.slice,user.slice sleep 1

   Performance counter stats for 'system wide':

     <not supported>      L1-icache-loads                  system.slice
          29,892,418      L1-dcache-loads                  system.slice
     <not supported>      L1-icache-loads                  user.slice
          52,497,220      L1-dcache-loads                  user.slice
  $

Fixes: 944138f048 ("perf stat: Enable BPF counter with --for-each-cgroup")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/r/20230104064402.1551516-4-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2023-01-04 10:52:07 -03:00
..
arch perf tools riscv: Fix build error on riscv due to missing header for 'struct perf_sample' 2023-01-02 11:47:22 -03:00
bench parisc architecture fixes for kernel v6.2-rc1: 2022-12-20 08:43:53 -06:00
dlfilters perf tools: Fix usage of the verbose variable 2022-12-20 15:16:33 -03:00
Documentation perf tools: Don't include signature in version strings 2023-01-02 12:34:06 -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 amd: Add Zen 4 mapping 2022-12-21 14:52:42 -03:00
python
scripts perf script: task-analyzer add csv support 2022-12-14 11:24:31 -03:00
tests perf test record_probe_libc_inet_pton: Fix test on s/390 where 'text_to_binary_address' now appears on the backtrace 2023-01-04 10:04:08 -03:00
trace perf tools: Use "grep -E" instead of "egrep" 2022-12-14 15:28:19 -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 stat: Fix handling of unsupported cgroup events when using BPF counters 2023-01-04 10:52:07 -03:00
.gitignore perf build: Install libsymbol locally when building 2022-11-16 12:17:15 -03:00
Build perf build: Use libtraceevent from the system 2022-12-14 11:16:12 -03:00
builtin-annotate.c perf build: Use libtraceevent from the system 2022-12-14 11:16:12 -03:00
builtin-bench.c
builtin-buildid-cache.c
builtin-buildid-list.c
builtin-c2c.c perf tools: Use dedicated non-atomic clear/set bit helpers 2022-12-05 09:29:06 -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: Use sig_atomic_t to avoid UB 2022-11-03 09:36:09 -03:00
builtin-help.c
builtin-inject.c perf build: Use libtraceevent from the system 2022-12-14 11:16:12 -03:00
builtin-kallsyms.c
builtin-kmem.c perf build: Use libtraceevent from the system 2022-12-14 11:16:12 -03: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: JSON escape encoding improvements 2022-11-24 10:03:03 -03:00
builtin-lock.c perf lock contention: Fix core dump related to not finding the "__sched_text_end" symbol on s/390 2023-01-03 15:48:23 -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: Check -v and -q options in the right place 2022-12-20 15:16:33 -03:00
builtin-record.c perf tools: Fix usage of the verbose variable 2022-12-20 15:16:33 -03:00
builtin-report.c perf build: Use libtraceevent from the system 2022-12-14 11:16:12 -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 tools: Fix usage of the verbose variable 2022-12-20 15:16:33 -03:00
builtin-stat.c perf tools: Fix usage of the verbose variable 2022-12-20 15:16:33 -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 tools: Use "grep -E" instead of "egrep" 2022-12-14 15:28:19 -03:00
builtin-version.c perf build: Use libtraceevent from the system 2022-12-14 11:16:12 -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: Remove explicit reference to python 2.x devel files 2022-12-21 14:52:42 -03:00
Makefile.perf perf build: Don't propagate subdir to submakes for install_headers 2023-01-03 15:35:01 -03:00
MANIFEST tools lib traceevent: Remove libtraceevent 2022-12-14 11:16:12 -03:00
perf-archive.sh
perf-completion.sh
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