timerlat_bpf_action.c 413 B

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