diff options
author | Kaixu Xia <xiakaixu@huawei.com> | 2015-08-06 09:02:36 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-08-10 07:50:06 +0200 |
commit | 47efb30274cbec1bd3c0c980a7ece328df2c16a8 (patch) | |
tree | 1393486ec4906557cdb1d9173e6e2e675bab3354 /samples/bpf/bpf_helpers.h | |
parent | bpf: Implement function bpf_perf_event_read() that get the selected hardware ... (diff) | |
download | linux-47efb30274cbec1bd3c0c980a7ece328df2c16a8.tar.xz linux-47efb30274cbec1bd3c0c980a7ece328df2c16a8.zip |
samples/bpf: example of get selected PMU counter value
This is a simple example and shows how to use the new ability
to get the selected Hardware PMU counter value.
Signed-off-by: Kaixu Xia <xiakaixu@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples/bpf/bpf_helpers.h')
-rw-r--r-- | samples/bpf/bpf_helpers.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/samples/bpf/bpf_helpers.h b/samples/bpf/bpf_helpers.h index c77c872fe8ee..3a44d3a272af 100644 --- a/samples/bpf/bpf_helpers.h +++ b/samples/bpf/bpf_helpers.h @@ -31,6 +31,8 @@ static unsigned long long (*bpf_get_current_uid_gid)(void) = (void *) BPF_FUNC_get_current_uid_gid; static int (*bpf_get_current_comm)(void *buf, int buf_size) = (void *) BPF_FUNC_get_current_comm; +static int (*bpf_perf_event_read)(void *map, int index) = + (void *) BPF_FUNC_perf_event_read; /* llvm builtin functions that eBPF C program may use to * emit BPF_LD_ABS and BPF_LD_IND instructions |