1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM oom
5 #if !defined(_TRACE_OOM_H) || defined(TRACE_HEADER_MULTI_READ)
7 #include <linux/tracepoint.h>
8 #include <trace/events/mmflags.h>
10 TRACE_EVENT(oom_score_adj_update
,
12 TP_PROTO(struct task_struct
*task
),
18 __array( char, comm
, TASK_COMM_LEN
)
19 __field( short, oom_score_adj
)
23 __entry
->pid
= task
->pid
;
24 memcpy(__entry
->comm
, task
->comm
, TASK_COMM_LEN
);
25 __entry
->oom_score_adj
= task
->signal
->oom_score_adj
;
28 TP_printk("pid=%d comm=%s oom_score_adj=%hd",
29 __entry
->pid
, __entry
->comm
, __entry
->oom_score_adj
)
32 TRACE_EVENT(reclaim_retry_zone
,
34 TP_PROTO(struct zoneref
*zoneref
,
36 unsigned long reclaimable
,
37 unsigned long available
,
38 unsigned long min_wmark
,
39 int no_progress_loops
,
42 TP_ARGS(zoneref
, order
, reclaimable
, available
, min_wmark
, no_progress_loops
, wmark_check
),
46 __field( int, zone_idx
)
48 __field( unsigned long, reclaimable
)
49 __field( unsigned long, available
)
50 __field( unsigned long, min_wmark
)
51 __field( int, no_progress_loops
)
52 __field( bool, wmark_check
)
56 __entry
->node
= zone_to_nid(zoneref
->zone
);
57 __entry
->zone_idx
= zoneref
->zone_idx
;
58 __entry
->order
= order
;
59 __entry
->reclaimable
= reclaimable
;
60 __entry
->available
= available
;
61 __entry
->min_wmark
= min_wmark
;
62 __entry
->no_progress_loops
= no_progress_loops
;
63 __entry
->wmark_check
= wmark_check
;
66 TP_printk("node=%d zone=%-8s order=%d reclaimable=%lu available=%lu min_wmark=%lu no_progress_loops=%d wmark_check=%d",
67 __entry
->node
, __print_symbolic(__entry
->zone_idx
, ZONE_TYPE
),
69 __entry
->reclaimable
, __entry
->available
, __entry
->min_wmark
,
70 __entry
->no_progress_loops
,
74 TRACE_EVENT(mark_victim
,
87 TP_printk("pid=%d", __entry
->pid
)
90 TRACE_EVENT(wake_reaper
,
103 TP_printk("pid=%d", __entry
->pid
)
106 TRACE_EVENT(start_task_reaping
,
119 TP_printk("pid=%d", __entry
->pid
)
122 TRACE_EVENT(finish_task_reaping
,
135 TP_printk("pid=%d", __entry
->pid
)
138 TRACE_EVENT(skip_task_reaping
,
151 TP_printk("pid=%d", __entry
->pid
)
154 #ifdef CONFIG_COMPACTION
155 TRACE_EVENT(compact_retry
,
158 enum compact_priority priority
,
159 enum compact_result result
,
164 TP_ARGS(order
, priority
, result
, retries
, max_retries
, ret
),
168 __field( int, priority
)
169 __field( int, result
)
170 __field( int, retries
)
171 __field( int, max_retries
)
176 __entry
->order
= order
;
177 __entry
->priority
= priority
;
178 __entry
->result
= compact_result_to_feedback(result
);
179 __entry
->retries
= retries
;
180 __entry
->max_retries
= max_retries
;
184 TP_printk("order=%d priority=%s compaction_result=%s retries=%d max_retries=%d should_retry=%d",
186 __print_symbolic(__entry
->priority
, COMPACTION_PRIORITY
),
187 __print_symbolic(__entry
->result
, COMPACTION_FEEDBACK
),
188 __entry
->retries
, __entry
->max_retries
,
191 #endif /* CONFIG_COMPACTION */
194 /* This part must be outside protection */
195 #include <trace/define_trace.h>