summaryrefslogtreecommitdiffstats
path: root/tools/tracing/rtla/example/timerlat_bpf_action.c
blob: ac1be049a8480ef609e9bc95fcace00ee37238a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// SPDX-License-Identifier: GPL-2.0
#include <linux/bpf.h>
#include <bpf/bpf_tracing.h>

char LICENSE[] SEC("license") = "GPL";

struct trace_event_raw_timerlat_sample {
	unsigned long long timer_latency;
} __attribute__((preserve_access_index));

SEC("tp/timerlat_action")
int action_handler(struct trace_event_raw_timerlat_sample *tp_args)
{
	bpf_printk("Latency: %lld\n", tp_args->timer_latency);
	return 0;
}