linux/tools/perf
Namhyung Kim 4afdc00c37 perf lock contention: Constify control data for BPF
The control knobs set before loading BPF programs should be declared as
'const volatile' so that it can be optimized by the BPF core.

Committer testing:

  root@x1:~# perf lock contention --use-bpf
   contended   total wait     max wait     avg wait         type   caller

           5     31.57 us     14.93 us      6.31 us        mutex   btrfs_delayed_update_inode+0x43
           1     16.91 us     16.91 us     16.91 us      rwsem:R   btrfs_tree_read_lock_nested+0x1b
           1     15.13 us     15.13 us     15.13 us     spinlock   btrfs_getattr+0xd1
           1      6.65 us      6.65 us      6.65 us      rwsem:R   btrfs_tree_read_lock_nested+0x1b
           1      4.34 us      4.34 us      4.34 us     spinlock   process_one_work+0x1a9
  root@x1:~#
  root@x1:~# perf trace -e bpf --max-events 10 perf lock contention --use-bpf
       0.000 ( 0.013 ms): :2948281/2948281 bpf(cmd: 36, uattr: 0x7ffd5f12d730, size: 8)          = -1 EOPNOTSUPP (Operation not supported)
       0.024 ( 0.120 ms): :2948281/2948281 bpf(cmd: PROG_LOAD, uattr: 0x7ffd5f12d460, size: 148) = 16
       0.158 ( 0.034 ms): :2948281/2948281 bpf(cmd: PROG_LOAD, uattr: 0x7ffd5f12d520, size: 148) = 16
      26.653 ( 0.154 ms): perf/2948281 bpf(cmd: PROG_LOAD, uattr: 0x7ffd5f12d3d0, size: 148)     = 16
      26.825 ( 0.014 ms): perf/2948281 bpf(uattr: 0x7ffd5f12d580, size: 80)                      = 16
      87.924 ( 0.038 ms): perf/2948281 bpf(cmd: BTF_LOAD, uattr: 0x7ffd5f12d400, size: 40)       = 16
      87.988 ( 0.006 ms): perf/2948281 bpf(cmd: BTF_LOAD, uattr: 0x7ffd5f12d470, size: 40)       = 16
      88.019 ( 0.006 ms): perf/2948281 bpf(cmd: BTF_LOAD, uattr: 0x7ffd5f12d250, size: 40)       = 16
      88.029 ( 0.172 ms): perf/2948281 bpf(cmd: PROG_LOAD, uattr: 0x7ffd5f12d320, size: 148)     = 17
      88.217 ( 0.005 ms): perf/2948281 bpf(cmd: BTF_LOAD, uattr: 0x7ffd5f12d4d0, size: 40)       = 16
  root@x1:~#

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: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20240902200515.2103769-5-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2024-09-03 11:53:15 -03:00
..
arch perf tools: Build x86 32-bit syscall table from arch/x86/entry/syscalls/syscall_32.tbl 2024-09-02 11:13:40 -03:00
bench perf tool: Constify tool pointers 2024-08-12 18:05:14 -03:00
dlfilters perf dlfilter: Add a test for object_code() 2023-09-30 00:09:06 -07:00
Documentation perf script: Add branch counters 2024-08-14 10:20:40 -03:00
include/perf perf dlfilter: Add al_cleanup() 2023-08-15 16:41:49 -03:00
jvmti
pmu-events perf vendor events arm64: Move Yitian 710 DDR PMU into T-Head directory 2024-08-28 18:12:20 -03: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 test: Make watchpoint data 32-bits on i386 2024-09-03 11:26:53 -03:00
trace Merge remote-tracking branch 'torvalds/master' into perf-tools-next 2024-08-16 19:43:16 -03:00
ui perf tools: Print lost samples due to BPF filter 2024-08-28 18:07:20 -03:00
util perf lock contention: Constify control data for BPF 2024-09-03 11:53:15 -03:00
.gitignore perf build: Shellcheck support for OUTPUT directory 2023-12-05 15:46:43 -03:00
Build perf util: Make util its own library 2024-06-26 11:07:42 -07: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 c2c: Use perf_tool__init() 2024-08-12 18:09:32 -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: Use perf_tool__init() 2024-08-12 18:08:35 -03:00
builtin-ftrace.c perf cap: Tidy up and improve capability testing 2024-08-20 17:53:12 -03:00
builtin-help.c
builtin-inject.c perf inject: Overhaul handling of pipe files 2024-08-30 09:23:51 -03:00
builtin-kallsyms.c perf dso: Add reference count checking and accessor functions 2024-05-06 15:28:49 -03:00
builtin-kmem.c perf kmem: Use perf_tool__init 2024-08-12 18:06:48 -03:00
builtin-kvm.c perf kvm: Use perf_tool__init() 2024-08-12 18:07:40 -03:00
builtin-kwork.c perf kwork: Use perf_tool__init() 2024-08-12 18:13:39 -03:00
builtin-list.c perf list: Fix the --no-desc option 2024-05-28 11:29:49 -07:00
builtin-lock.c perf lock: Use perf_tool__init() 2024-08-12 18:08:08 -03:00
builtin-mem.c perf mem: Use perf_tool__init() 2024-08-12 18:11:49 -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: Name events in stats for pipe mode 2024-08-28 18:07:21 -03:00
builtin-sched.c perf sched timehist: Fixed timestamp error when unable to confirm event sched_in time 2024-08-30 10:31:57 -03:00
builtin-script.c perf script: Add branch counters 2024-08-14 10:20:40 -03:00
builtin-stat.c perf stat: Add command line option for enabling TPEBS recording 2024-08-13 15:25:32 -03:00
builtin-timechart.c perf timechart: Use perf_tool__init() 2024-08-12 18:12:06 -03:00
builtin-top.c perf map: API clean up 2024-08-19 14:49:53 -03:00
builtin-trace.c perf trace: Pass the richer 'struct syscall_arg' pointer to trace__btf_scnprintf() 2024-08-28 18:07:21 -03:00
builtin-version.c perf report: Support LLVM for addr2line() 2024-09-03 10:15:16 -03:00
builtin.h perf tools: Suggest inbuilt commands for unknown command 2024-03-21 13:54:40 -03:00
check-headers.sh perf tools: Build x86 32-bit syscall table from arch/x86/entry/syscalls/syscall_32.tbl 2024-09-02 11:13:40 -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 report: Support LLVM for addr2line() 2024-09-03 10:15:16 -03:00
Makefile.perf perf testsuite: Install perf-report tests in the 'make install-tests -C tools/perf' target 2024-08-28 18:07:21 -03:00
MANIFEST tools perf: Add arm64 sysreg files to MANIFEST 2023-11-22 11:17:53 -08: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 tools: Suggest inbuilt commands for unknown command 2024-03-21 13:54:40 -03:00
perf.h