test_overhead_tp_kern.c 832 B

123456789101112131415161718192021222324252627282930313233343536
  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 <uapi/linux/bpf.h>
  8. #include <bpf/bpf_helpers.h>
  9. /* from /sys/kernel/debug/tracing/events/task/task_rename/format */
  10. struct task_rename {
  11. __u64 pad;
  12. __u32 pid;
  13. char oldcomm[16];
  14. char newcomm[16];
  15. __u16 oom_score_adj;
  16. };
  17. SEC("tracepoint/task/task_rename")
  18. int prog(struct task_rename *ctx)
  19. {
  20. return 0;
  21. }
  22. /* from /sys/kernel/debug/tracing/events/random/urandom_read/format */
  23. struct urandom_read {
  24. __u64 pad;
  25. int got_bits;
  26. int pool_left;
  27. int input_left;
  28. };
  29. SEC("tracepoint/random/urandom_read")
  30. int prog2(struct urandom_read *ctx)
  31. {
  32. return 0;
  33. }
  34. char _license[] SEC("license") = "GPL";