xref: /linux/tools/tracing/rtla/example/timerlat_bpf_action.c (revision 582a1ef360a05bff4350bbf6e383f61d26b804f0)
1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/bpf.h>
3 #include <bpf/bpf_tracing.h>
4 
5 char LICENSE[] SEC("license") = "GPL";
6 
7 struct trace_event_raw_timerlat_sample {
8 	unsigned long long timer_latency;
9 } __attribute__((preserve_access_index));
10 
11 SEC("tp/timerlat_action")
12 int action_handler(struct trace_event_raw_timerlat_sample *tp_args)
13 {
14 	bpf_printk("Latency: %lld\n", tp_args->timer_latency);
15 	return 0;
16 }
17