KAMEZAWA Hiroyuki | 43d2b11 | 2012-01-10 15:08:09 -0800 | [diff] [blame] | 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM oom |
| 3 | |
| 4 | #if !defined(_TRACE_OOM_H) || defined(TRACE_HEADER_MULTI_READ) |
| 5 | #define _TRACE_OOM_H |
| 6 | #include <linux/tracepoint.h> |
| 7 | |
| 8 | TRACE_EVENT(oom_score_adj_update, |
| 9 | |
| 10 | TP_PROTO(struct task_struct *task), |
| 11 | |
| 12 | TP_ARGS(task), |
| 13 | |
| 14 | TP_STRUCT__entry( |
| 15 | __field( pid_t, pid) |
| 16 | __array( char, comm, TASK_COMM_LEN ) |
David Rientjes | a9c58b90 | 2012-12-11 16:02:54 -0800 | [diff] [blame] | 17 | __field( short, oom_score_adj) |
KAMEZAWA Hiroyuki | 43d2b11 | 2012-01-10 15:08:09 -0800 | [diff] [blame] | 18 | ), |
| 19 | |
| 20 | TP_fast_assign( |
| 21 | __entry->pid = task->pid; |
| 22 | memcpy(__entry->comm, task->comm, TASK_COMM_LEN); |
| 23 | __entry->oom_score_adj = task->signal->oom_score_adj; |
| 24 | ), |
| 25 | |
David Rientjes | a9c58b90 | 2012-12-11 16:02:54 -0800 | [diff] [blame] | 26 | TP_printk("pid=%d comm=%s oom_score_adj=%hd", |
KAMEZAWA Hiroyuki | 43d2b11 | 2012-01-10 15:08:09 -0800 | [diff] [blame] | 27 | __entry->pid, __entry->comm, __entry->oom_score_adj) |
| 28 | ); |
| 29 | |
Roman Gushchin | 1a83e5c | 2017-07-10 15:49:05 -0700 | [diff] [blame] | 30 | TRACE_EVENT(mark_victim, |
| 31 | TP_PROTO(int pid), |
| 32 | |
| 33 | TP_ARGS(pid), |
| 34 | |
| 35 | TP_STRUCT__entry( |
| 36 | __field(int, pid) |
| 37 | ), |
| 38 | |
| 39 | TP_fast_assign( |
| 40 | __entry->pid = pid; |
| 41 | ), |
| 42 | |
| 43 | TP_printk("pid=%d", __entry->pid) |
| 44 | ); |
| 45 | |
| 46 | TRACE_EVENT(wake_reaper, |
| 47 | TP_PROTO(int pid), |
| 48 | |
| 49 | TP_ARGS(pid), |
| 50 | |
| 51 | TP_STRUCT__entry( |
| 52 | __field(int, pid) |
| 53 | ), |
| 54 | |
| 55 | TP_fast_assign( |
| 56 | __entry->pid = pid; |
| 57 | ), |
| 58 | |
| 59 | TP_printk("pid=%d", __entry->pid) |
| 60 | ); |
| 61 | |
| 62 | TRACE_EVENT(start_task_reaping, |
| 63 | TP_PROTO(int pid), |
| 64 | |
| 65 | TP_ARGS(pid), |
| 66 | |
| 67 | TP_STRUCT__entry( |
| 68 | __field(int, pid) |
| 69 | ), |
| 70 | |
| 71 | TP_fast_assign( |
| 72 | __entry->pid = pid; |
| 73 | ), |
| 74 | |
| 75 | TP_printk("pid=%d", __entry->pid) |
| 76 | ); |
| 77 | |
| 78 | TRACE_EVENT(finish_task_reaping, |
| 79 | TP_PROTO(int pid), |
| 80 | |
| 81 | TP_ARGS(pid), |
| 82 | |
| 83 | TP_STRUCT__entry( |
| 84 | __field(int, pid) |
| 85 | ), |
| 86 | |
| 87 | TP_fast_assign( |
| 88 | __entry->pid = pid; |
| 89 | ), |
| 90 | |
| 91 | TP_printk("pid=%d", __entry->pid) |
| 92 | ); |
| 93 | |
| 94 | TRACE_EVENT(skip_task_reaping, |
| 95 | TP_PROTO(int pid), |
| 96 | |
| 97 | TP_ARGS(pid), |
| 98 | |
| 99 | TP_STRUCT__entry( |
| 100 | __field(int, pid) |
| 101 | ), |
| 102 | |
| 103 | TP_fast_assign( |
| 104 | __entry->pid = pid; |
| 105 | ), |
| 106 | |
| 107 | TP_printk("pid=%d", __entry->pid) |
| 108 | ); |
KAMEZAWA Hiroyuki | 43d2b11 | 2012-01-10 15:08:09 -0800 | [diff] [blame] | 109 | #endif |
| 110 | |
| 111 | /* This part must be outside protection */ |
| 112 | #include <trace/define_trace.h> |