diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2024-03-26 17:21:50 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2024-03-29 02:31:40 +0100 |
commit | 3124591f686115aca25d772c2ccb7b1e202c3197 (patch) | |
tree | e761705a15312f4cf7423a40035c3e78bb8e4901 /include/trace/events/bpf_test_run.h | |
parent | selftests/bpf: lazy-load trigger bench BPF programs (diff) | |
download | linux-3124591f686115aca25d772c2ccb7b1e202c3197.tar.xz linux-3124591f686115aca25d772c2ccb7b1e202c3197.zip |
bpf: add bpf_modify_return_test_tp() kfunc triggering tracepoint
Add a simple bpf_modify_return_test_tp() kfunc, available to all program
types, that is useful for various testing and benchmarking scenarios, as
it allows to trigger most tracing BPF program types from BPF side,
allowing to do complex testing and benchmarking scenarios.
It is also attachable to for fmod_ret programs, making it a good and
simple way to trigger fmod_ret program under test/benchmark.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20240326162151.3981687-6-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/trace/events/bpf_test_run.h')
-rw-r--r-- | include/trace/events/bpf_test_run.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/trace/events/bpf_test_run.h b/include/trace/events/bpf_test_run.h index 265447e3f71a..0c924d39b7cb 100644 --- a/include/trace/events/bpf_test_run.h +++ b/include/trace/events/bpf_test_run.h @@ -7,6 +7,23 @@ #include <linux/tracepoint.h> +TRACE_EVENT(bpf_trigger_tp, + + TP_PROTO(int nonce), + + TP_ARGS(nonce), + + TP_STRUCT__entry( + __field(int, nonce) + ), + + TP_fast_assign( + __entry->nonce = nonce; + ), + + TP_printk("nonce %d", __entry->nonce) +); + DECLARE_EVENT_CLASS(bpf_test_finish, TP_PROTO(int *err), |