diff options
| author | David S. Miller <davem@davemloft.net> | 2015-10-22 16:42:23 +0300 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2015-10-22 16:42:23 +0300 |
| commit | 721daebbdb9ba44756a9695878ecca8aad38009b (patch) | |
| tree | 33c57207f5ed18a5408ed9c25ec0ab169ec0fb5d /include | |
| parent | 63b11e757d6dae570bc22450ec58a5b68cdf5c3c (diff) | |
| parent | 39111695b1b88a21e81983a38786d877e770da81 (diff) | |
| download | linux-721daebbdb9ba44756a9695878ecca8aad38009b.tar.xz | |
Merge branch 'bpf-perf'
Alexei Starovoitov says:
====================
bpf_perf_event_output helper
Over the last year there were multiple attempts to let eBPF programs
output data into perf events by He Kuang and Wangnan.
The last one was:
https://lkml.org/lkml/2015/7/20/736
It was almost perfect with exception that all bpf programs would sent
data into one global perf_event.
This patch set takes different approach by letting user space
open independent PERF_COUNT_SW_BPF_OUTPUT events, so that program
output won't collide.
Wangnan is working on corresponding perf patches.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/uapi/linux/bpf.h | 11 | ||||
| -rw-r--r-- | include/uapi/linux/perf_event.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 564f1f091991..2e032426cfb7 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -287,6 +287,17 @@ enum bpf_func_id { * Return: realm if != 0 */ BPF_FUNC_get_route_realm, + + /** + * bpf_perf_event_output(ctx, map, index, data, size) - output perf raw sample + * @ctx: struct pt_regs* + * @map: pointer to perf_event_array map + * @index: index of event in the map + * @data: data on stack to be output as raw data + * @size: size of data + * Return: 0 on success + */ + BPF_FUNC_perf_event_output, __BPF_FUNC_MAX_ID, }; diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h index 2881145cda86..d3c417615361 100644 --- a/include/uapi/linux/perf_event.h +++ b/include/uapi/linux/perf_event.h @@ -110,6 +110,7 @@ enum perf_sw_ids { PERF_COUNT_SW_ALIGNMENT_FAULTS = 7, PERF_COUNT_SW_EMULATION_FAULTS = 8, PERF_COUNT_SW_DUMMY = 9, + PERF_COUNT_SW_BPF_OUTPUT = 10, PERF_COUNT_SW_MAX, /* non-ABI */ }; |
