summaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorYonghong Song <yhs@fb.com>2017-10-05 18:19:22 +0200
committerDavid S. Miller <davem@davemloft.net>2017-10-08 00:05:57 +0200
commit4bebdc7a85aa400c0222b5329861e4ad9252f1e5 (patch)
tree59151679b652bacaf545664158a85b0a4c7c75fe /samples
parentbpf: add a test case for helper bpf_perf_event_read_value (diff)
downloadlinux-4bebdc7a85aa400c0222b5329861e4ad9252f1e5.tar.xz
linux-4bebdc7a85aa400c0222b5329861e4ad9252f1e5.zip
bpf: add helper bpf_perf_prog_read_value
This patch adds helper bpf_perf_prog_read_cvalue for perf event based bpf programs, to read event counter and enabled/running time. The enabled/running time is accumulated since the perf event open. The typical use case for perf event based bpf program is to attach itself to a single event. In such cases, if it is desirable to get scaling factor between two bpf invocations, users can can save the time values in a map, and use the value from the map and the current value to calculate the scaling factor. Signed-off-by: Yonghong Song <yhs@fb.com> Acked-by: Alexei Starovoitov <ast@fb.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples')
0 files changed, 0 insertions, 0 deletions