samples/bpf: add perf_event+bpf example
The bpf program is called 50 times a second and does hashmap[kern&user_stackid]++ It's primary purpose to check that key bpf helpers like map lookup, update, get_stackid, trace_printk and ctx access are all working. It checks: - PERF_COUNT_HW_CPU_CYCLES on all cpus - PERF_COUNT_HW_CPU_CYCLES for current process and inherited perf_events to children - PERF_COUNT_SW_CPU_CLOCK on all cpus - PERF_COUNT_SW_CPU_CLOCK for current process Signed-off-by:Alexei Starovoitov <ast@kernel.org> Signed-off-by:
David S. Miller <davem@davemloft.net>
Showing
- samples/bpf/Makefile 4 additions, 0 deletionssamples/bpf/Makefile
- samples/bpf/bpf_helpers.h 2 additions, 0 deletionssamples/bpf/bpf_helpers.h
- samples/bpf/bpf_load.c 6 additions, 1 deletionsamples/bpf/bpf_load.c
- samples/bpf/trace_event_kern.c 65 additions, 0 deletionssamples/bpf/trace_event_kern.c
- samples/bpf/trace_event_user.c 213 additions, 0 deletionssamples/bpf/trace_event_user.c
Loading
Please register or sign in to comment