vmscan: tracing: add trace events for LRU page isolation
[linux-2.6.git] / include / trace / events / vmscan.h
1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM vmscan
3
4 #if !defined(_TRACE_VMSCAN_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_VMSCAN_H
6
7 #include <linux/types.h>
8 #include <linux/tracepoint.h>
9 #include "gfpflags.h"
10
11 TRACE_EVENT(mm_vmscan_kswapd_sleep,
12
13         TP_PROTO(int nid),
14
15         TP_ARGS(nid),
16
17         TP_STRUCT__entry(
18                 __field(        int,    nid     )
19         ),
20
21         TP_fast_assign(
22                 __entry->nid    = nid;
23         ),
24
25         TP_printk("nid=%d", __entry->nid)
26 );
27
28 TRACE_EVENT(mm_vmscan_kswapd_wake,
29
30         TP_PROTO(int nid, int order),
31
32         TP_ARGS(nid, order),
33
34         TP_STRUCT__entry(
35                 __field(        int,    nid     )
36                 __field(        int,    order   )
37         ),
38
39         TP_fast_assign(
40                 __entry->nid    = nid;
41                 __entry->order  = order;
42         ),
43
44         TP_printk("nid=%d order=%d", __entry->nid, __entry->order)
45 );
46
47 TRACE_EVENT(mm_vmscan_wakeup_kswapd,
48
49         TP_PROTO(int nid, int zid, int order),
50
51         TP_ARGS(nid, zid, order),
52
53         TP_STRUCT__entry(
54                 __field(        int,            nid     )
55                 __field(        int,            zid     )
56                 __field(        int,            order   )
57         ),
58
59         TP_fast_assign(
60                 __entry->nid            = nid;
61                 __entry->zid            = zid;
62                 __entry->order          = order;
63         ),
64
65         TP_printk("nid=%d zid=%d order=%d",
66                 __entry->nid,
67                 __entry->zid,
68                 __entry->order)
69 );
70
71 TRACE_EVENT(mm_vmscan_direct_reclaim_begin,
72
73         TP_PROTO(int order, int may_writepage, gfp_t gfp_flags),
74
75         TP_ARGS(order, may_writepage, gfp_flags),
76
77         TP_STRUCT__entry(
78                 __field(        int,    order           )
79                 __field(        int,    may_writepage   )
80                 __field(        gfp_t,  gfp_flags       )
81         ),
82
83         TP_fast_assign(
84                 __entry->order          = order;
85                 __entry->may_writepage  = may_writepage;
86                 __entry->gfp_flags      = gfp_flags;
87         ),
88
89         TP_printk("order=%d may_writepage=%d gfp_flags=%s",
90                 __entry->order,
91                 __entry->may_writepage,
92                 show_gfp_flags(__entry->gfp_flags))
93 );
94
95 TRACE_EVENT(mm_vmscan_direct_reclaim_end,
96
97         TP_PROTO(unsigned long nr_reclaimed),
98
99         TP_ARGS(nr_reclaimed),
100
101         TP_STRUCT__entry(
102                 __field(        unsigned long,  nr_reclaimed    )
103         ),
104
105         TP_fast_assign(
106                 __entry->nr_reclaimed   = nr_reclaimed;
107         ),
108
109         TP_printk("nr_reclaimed=%lu", __entry->nr_reclaimed)
110 );
111
112 TRACE_EVENT(mm_vmscan_lru_isolate,
113
114         TP_PROTO(int order,
115                 unsigned long nr_requested,
116                 unsigned long nr_scanned,
117                 unsigned long nr_taken,
118                 unsigned long nr_lumpy_taken,
119                 unsigned long nr_lumpy_dirty,
120                 unsigned long nr_lumpy_failed,
121                 int isolate_mode),
122
123         TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode),
124
125         TP_STRUCT__entry(
126                 __field(int, order)
127                 __field(unsigned long, nr_requested)
128                 __field(unsigned long, nr_scanned)
129                 __field(unsigned long, nr_taken)
130                 __field(unsigned long, nr_lumpy_taken)
131                 __field(unsigned long, nr_lumpy_dirty)
132                 __field(unsigned long, nr_lumpy_failed)
133                 __field(int, isolate_mode)
134         ),
135
136         TP_fast_assign(
137                 __entry->order = order;
138                 __entry->nr_requested = nr_requested;
139                 __entry->nr_scanned = nr_scanned;
140                 __entry->nr_taken = nr_taken;
141                 __entry->nr_lumpy_taken = nr_lumpy_taken;
142                 __entry->nr_lumpy_dirty = nr_lumpy_dirty;
143                 __entry->nr_lumpy_failed = nr_lumpy_failed;
144                 __entry->isolate_mode = isolate_mode;
145         ),
146
147         TP_printk("isolate_mode=%d order=%d nr_requested=%lu nr_scanned=%lu nr_taken=%lu contig_taken=%lu contig_dirty=%lu contig_failed=%lu",
148                 __entry->isolate_mode,
149                 __entry->order,
150                 __entry->nr_requested,
151                 __entry->nr_scanned,
152                 __entry->nr_taken,
153                 __entry->nr_lumpy_taken,
154                 __entry->nr_lumpy_dirty,
155                 __entry->nr_lumpy_failed)
156 );
157
158 #endif /* _TRACE_VMSCAN_H */
159
160 /* This part must be outside protection */
161 #include <trace/define_trace.h>