test_overhead_tp_kern.c 879 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* Copyright (c) 2016 Facebook
  2. *
  3. * This program is free software; you can redistribute it and/or
  4. * modify it under the terms of version 2 of the GNU General Public
  5. * License as published by the Free Software Foundation.
  6. */
  7. #include <linux/sched.h>
  8. #include <uapi/linux/bpf.h>
  9. #include <bpf/bpf_helpers.h>
  10. /* from /sys/kernel/debug/tracing/events/task/task_rename/format */
  11. struct task_rename {
  12. __u64 pad;
  13. __u32 pid;
  14. char oldcomm[TASK_COMM_LEN];
  15. char newcomm[TASK_COMM_LEN];
  16. __u16 oom_score_adj;
  17. };
  18. SEC("tracepoint/task/task_rename")
  19. int prog(struct task_rename *ctx)
  20. {
  21. return 0;
  22. }
  23. /* from /sys/kernel/debug/tracing/events/random/urandom_read/format */
  24. struct urandom_read {
  25. __u64 pad;
  26. int got_bits;
  27. int pool_left;
  28. int input_left;
  29. };
  30. SEC("tracepoint/random/urandom_read")
  31. int prog2(struct urandom_read *ctx)
  32. {
  33. return 0;
  34. }
  35. char _license[] SEC("license") = "GPL";