linux/tools/perf/util/bpf_skel
Namhyung Kim 8db1d77248 perf ftrace latency: Add -e option to measure time between two events
In addition to the function latency, it can measure events latencies.
Some kernel tracepoints are paired and it's menningful to measure how
long it takes between the two events.  The latency is tracked for the
same thread.

Currently it only uses BPF to do the work but it can be lifted later.
Instead of having separate a BPF program for each tracepoint, it only
uses generic 'event_begin' and 'event_end' programs to attach to any
(raw) tracepoints.

  $ sudo perf ftrace latency -a -b --hide-empty \
    -e i915_request_wait_begin,i915_request_wait_end -- sleep 1
  #   DURATION     |      COUNT | GRAPH                                |
     256 -  512 us |          4 | ######                               |
       2 -    4 ms |          2 | ###                                  |
       4 -    8 ms |         12 | ###################                  |
       8 -   16 ms |         10 | ################                     |

  # statistics  (in usec)
    total time:               194915
      avg time:                 6961
      max time:                12855
      min time:                  373
         count:                   28

Reviewed-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250714052143.342851-1-namhyung@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
2025-07-14 22:51:58 -07:00
..
vmlinux perf lock contention: Symbolize zone->lock using BTF 2025-04-29 12:23:53 -03:00
.gitignore
augmented_raw_syscalls.bpf.c perf trace: Split BPF skel code to util/bpf_trace_augment.c 2025-06-26 10:31:05 -07:00
bench_uprobe.bpf.c perf bench uprobe: Add uretprobe variant of uprobe benchmarks 2024-04-12 17:54:02 -03:00
bperf_cgroup.bpf.c perf stat: Constify control data for BPF 2024-09-03 11:43:16 -03:00
bperf_follower.bpf.c perf stat: Support inherit events during fork() for bperf 2024-11-01 23:31:08 -07:00
bperf_leader.bpf.c
bperf_u.h perf stat: Support inherit events during fork() for bperf 2024-11-01 23:31:08 -07:00
bpf_prog_profiler.bpf.c
func_latency.bpf.c perf ftrace latency: Add -e option to measure time between two events 2025-07-14 22:51:58 -07:00
kwork_top.bpf.c perf: Increase MAX_NR_CPUS to 4096 2024-12-09 17:52:41 -03:00
kwork_trace.bpf.c perf kwork: Remove unreachable judgments 2025-03-18 16:55:30 -07:00
lock_contention.bpf.c perf lock contention: Add -J/--inject-delay option 2025-05-09 14:32:15 -03:00
lock_data.h perf lock contention: Symbolize zone->lock using BTF 2025-04-29 12:23:53 -03:00
off_cpu.bpf.c perf record --off-cpu: Add --off-cpu-thresh option 2025-05-05 21:51:54 -03:00
perf_version.h perf test: add test for BPF metadata collection 2025-06-20 14:55:24 -07:00
sample-filter.h perf bpf-filter: Support filtering on cgroups 2024-08-28 18:21:49 -03:00
sample_filter.bpf.c perf bpf-filter: Support filtering on cgroups 2024-08-28 18:21:49 -03:00
syscall_summary.bpf.c perf trace: Support --summary-mode=cgroup 2025-05-13 18:20:46 -03:00
syscall_summary.h perf trace: Support --summary-mode=cgroup 2025-05-13 18:20:46 -03:00