]> git.baikalelectronics.ru Git - kernel.git/commit
samples/bpf: add perf_event+bpf example
authorAlexei Starovoitov <ast@fb.com>
Fri, 2 Sep 2016 01:37:25 +0000 (18:37 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 2 Sep 2016 17:46:45 +0000 (10:46 -0700)
commit7936b5e32c70e8248027438dbbaf366f14cc66e7
tree95066aef056b16a4e5e477c7f277cc69db418e5c
parent37856c5f9664689ebf45dbb420e9d6f19d8bd013
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>
samples/bpf/Makefile
samples/bpf/bpf_helpers.h
samples/bpf/bpf_load.c
samples/bpf/trace_event_kern.c [new file with mode: 0644]
samples/bpf/trace_event_user.c [new file with mode: 0644]