oom.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM oom
  3. #if !defined(_TRACE_OOM_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_OOM_H
  5. #include <linux/tracepoint.h>
  6. TRACE_EVENT(oom_score_adj_update,
  7. TP_PROTO(struct task_struct *task),
  8. TP_ARGS(task),
  9. TP_STRUCT__entry(
  10. __field( pid_t, pid)
  11. __array( char, comm, TASK_COMM_LEN )
  12. __field( short, oom_score_adj)
  13. ),
  14. TP_fast_assign(
  15. __entry->pid = task->pid;
  16. memcpy(__entry->comm, task->comm, TASK_COMM_LEN);
  17. __entry->oom_score_adj = task->signal->oom_score_adj;
  18. ),
  19. TP_printk("pid=%d comm=%s oom_score_adj=%hd",
  20. __entry->pid, __entry->comm, __entry->oom_score_adj)
  21. );
  22. TRACE_EVENT(mark_victim,
  23. TP_PROTO(int pid),
  24. TP_ARGS(pid),
  25. TP_STRUCT__entry(
  26. __field(int, pid)
  27. ),
  28. TP_fast_assign(
  29. __entry->pid = pid;
  30. ),
  31. TP_printk("pid=%d", __entry->pid)
  32. );
  33. TRACE_EVENT(wake_reaper,
  34. TP_PROTO(int pid),
  35. TP_ARGS(pid),
  36. TP_STRUCT__entry(
  37. __field(int, pid)
  38. ),
  39. TP_fast_assign(
  40. __entry->pid = pid;
  41. ),
  42. TP_printk("pid=%d", __entry->pid)
  43. );
  44. TRACE_EVENT(start_task_reaping,
  45. TP_PROTO(int pid),
  46. TP_ARGS(pid),
  47. TP_STRUCT__entry(
  48. __field(int, pid)
  49. ),
  50. TP_fast_assign(
  51. __entry->pid = pid;
  52. ),
  53. TP_printk("pid=%d", __entry->pid)
  54. );
  55. TRACE_EVENT(finish_task_reaping,
  56. TP_PROTO(int pid),
  57. TP_ARGS(pid),
  58. TP_STRUCT__entry(
  59. __field(int, pid)
  60. ),
  61. TP_fast_assign(
  62. __entry->pid = pid;
  63. ),
  64. TP_printk("pid=%d", __entry->pid)
  65. );
  66. TRACE_EVENT(skip_task_reaping,
  67. TP_PROTO(int pid),
  68. TP_ARGS(pid),
  69. TP_STRUCT__entry(
  70. __field(int, pid)
  71. ),
  72. TP_fast_assign(
  73. __entry->pid = pid;
  74. ),
  75. TP_printk("pid=%d", __entry->pid)
  76. );
  77. #endif
  78. /* This part must be outside protection */
  79. #include <trace/define_trace.h>