writeback.h (9f4813b531a0b8cc502fcfb142937fe4e9104d77) writeback.h (40363cf13999ee4fb3b5c1e67fa5e6f0e9da34bd)
1/* SPDX-License-Identifier: GPL-2.0 */
2#undef TRACE_SYSTEM
3#define TRACE_SYSTEM writeback
4
5#if !defined(_TRACE_WRITEBACK_H) || defined(TRACE_HEADER_MULTI_READ)
6#define _TRACE_WRITEBACK_H
7
8#include <linux/tracepoint.h>

--- 47 unchanged lines hidden (view full) ---

56DECLARE_EVENT_CLASS(writeback_page_template,
57
58 TP_PROTO(struct page *page, struct address_space *mapping),
59
60 TP_ARGS(page, mapping),
61
62 TP_STRUCT__entry (
63 __array(char, name, 32)
1/* SPDX-License-Identifier: GPL-2.0 */
2#undef TRACE_SYSTEM
3#define TRACE_SYSTEM writeback
4
5#if !defined(_TRACE_WRITEBACK_H) || defined(TRACE_HEADER_MULTI_READ)
6#define _TRACE_WRITEBACK_H
7
8#include <linux/tracepoint.h>

--- 47 unchanged lines hidden (view full) ---

56DECLARE_EVENT_CLASS(writeback_page_template,
57
58 TP_PROTO(struct page *page, struct address_space *mapping),
59
60 TP_ARGS(page, mapping),
61
62 TP_STRUCT__entry (
63 __array(char, name, 32)
64 __field(unsigned long, ino)
64 __field(ino_t, ino)
65 __field(pgoff_t, index)
66 ),
67
68 TP_fast_assign(
69 strscpy_pad(__entry->name,
70 mapping ? dev_name(inode_to_bdi(mapping->host)->dev) : "(unknown)",
71 32);
72 __entry->ino = mapping ? mapping->host->i_ino : 0;
73 __entry->index = page->index;
74 ),
75
76 TP_printk("bdi %s: ino=%lu index=%lu",
77 __entry->name,
65 __field(pgoff_t, index)
66 ),
67
68 TP_fast_assign(
69 strscpy_pad(__entry->name,
70 mapping ? dev_name(inode_to_bdi(mapping->host)->dev) : "(unknown)",
71 32);
72 __entry->ino = mapping ? mapping->host->i_ino : 0;
73 __entry->index = page->index;
74 ),
75
76 TP_printk("bdi %s: ino=%lu index=%lu",
77 __entry->name,
78 __entry->ino,
78 (unsigned long)__entry->ino,
79 __entry->index
80 )
81);
82
83DEFINE_EVENT(writeback_page_template, writeback_dirty_page,
84
85 TP_PROTO(struct page *page, struct address_space *mapping),
86

--- 10 unchanged lines hidden (view full) ---

97DECLARE_EVENT_CLASS(writeback_dirty_inode_template,
98
99 TP_PROTO(struct inode *inode, int flags),
100
101 TP_ARGS(inode, flags),
102
103 TP_STRUCT__entry (
104 __array(char, name, 32)
79 __entry->index
80 )
81);
82
83DEFINE_EVENT(writeback_page_template, writeback_dirty_page,
84
85 TP_PROTO(struct page *page, struct address_space *mapping),
86

--- 10 unchanged lines hidden (view full) ---

97DECLARE_EVENT_CLASS(writeback_dirty_inode_template,
98
99 TP_PROTO(struct inode *inode, int flags),
100
101 TP_ARGS(inode, flags),
102
103 TP_STRUCT__entry (
104 __array(char, name, 32)
105 __field(unsigned long, ino)
105 __field(ino_t, ino)
106 __field(unsigned long, state)
107 __field(unsigned long, flags)
108 ),
109
110 TP_fast_assign(
111 struct backing_dev_info *bdi = inode_to_bdi(inode);
112
113 /* may be called for files on pseudo FSes w/ unregistered bdi */
114 strscpy_pad(__entry->name,
115 bdi->dev ? dev_name(bdi->dev) : "(unknown)", 32);
116 __entry->ino = inode->i_ino;
117 __entry->state = inode->i_state;
118 __entry->flags = flags;
119 ),
120
121 TP_printk("bdi %s: ino=%lu state=%s flags=%s",
122 __entry->name,
106 __field(unsigned long, state)
107 __field(unsigned long, flags)
108 ),
109
110 TP_fast_assign(
111 struct backing_dev_info *bdi = inode_to_bdi(inode);
112
113 /* may be called for files on pseudo FSes w/ unregistered bdi */
114 strscpy_pad(__entry->name,
115 bdi->dev ? dev_name(bdi->dev) : "(unknown)", 32);
116 __entry->ino = inode->i_ino;
117 __entry->state = inode->i_state;
118 __entry->flags = flags;
119 ),
120
121 TP_printk("bdi %s: ino=%lu state=%s flags=%s",
122 __entry->name,
123 __entry->ino,
123 (unsigned long)__entry->ino,
124 show_inode_state(__entry->state),
125 show_inode_state(__entry->flags)
126 )
127);
128
129DEFINE_EVENT(writeback_dirty_inode_template, writeback_mark_inode_dirty,
130
131 TP_PROTO(struct inode *inode, int flags),

--- 13 unchanged lines hidden (view full) ---

145 TP_PROTO(struct inode *inode, int flags),
146
147 TP_ARGS(inode, flags)
148);
149
150#ifdef CREATE_TRACE_POINTS
151#ifdef CONFIG_CGROUP_WRITEBACK
152
124 show_inode_state(__entry->state),
125 show_inode_state(__entry->flags)
126 )
127);
128
129DEFINE_EVENT(writeback_dirty_inode_template, writeback_mark_inode_dirty,
130
131 TP_PROTO(struct inode *inode, int flags),

--- 13 unchanged lines hidden (view full) ---

145 TP_PROTO(struct inode *inode, int flags),
146
147 TP_ARGS(inode, flags)
148);
149
150#ifdef CREATE_TRACE_POINTS
151#ifdef CONFIG_CGROUP_WRITEBACK
152
153static inline unsigned int __trace_wb_assign_cgroup(struct bdi_writeback *wb)
153static inline ino_t __trace_wb_assign_cgroup(struct bdi_writeback *wb)
154{
154{
155 return wb->memcg_css->cgroup->kn->id.ino;
155 return cgroup_ino(wb->memcg_css->cgroup);
156}
157
156}
157
158static inline unsigned int __trace_wbc_assign_cgroup(struct writeback_control *wbc)
158static inline ino_t __trace_wbc_assign_cgroup(struct writeback_control *wbc)
159{
160 if (wbc->wb)
161 return __trace_wb_assign_cgroup(wbc->wb);
162 else
159{
160 if (wbc->wb)
161 return __trace_wb_assign_cgroup(wbc->wb);
162 else
163 return -1U;
163 return 1;
164}
165#else /* CONFIG_CGROUP_WRITEBACK */
166
164}
165#else /* CONFIG_CGROUP_WRITEBACK */
166
167static inline unsigned int __trace_wb_assign_cgroup(struct bdi_writeback *wb)
167static inline ino_t __trace_wb_assign_cgroup(struct bdi_writeback *wb)
168{
168{
169 return -1U;
169 return 1;
170}
171
170}
171
172static inline unsigned int __trace_wbc_assign_cgroup(struct writeback_control *wbc)
172static inline ino_t __trace_wbc_assign_cgroup(struct writeback_control *wbc)
173{
173{
174 return -1U;
174 return 1;
175}
176
177#endif /* CONFIG_CGROUP_WRITEBACK */
178#endif /* CREATE_TRACE_POINTS */
179
180#ifdef CONFIG_CGROUP_WRITEBACK
181TRACE_EVENT(inode_foreign_history,
182
183 TP_PROTO(struct inode *inode, struct writeback_control *wbc,
184 unsigned int history),
185
186 TP_ARGS(inode, wbc, history),
187
188 TP_STRUCT__entry(
189 __array(char, name, 32)
175}
176
177#endif /* CONFIG_CGROUP_WRITEBACK */
178#endif /* CREATE_TRACE_POINTS */
179
180#ifdef CONFIG_CGROUP_WRITEBACK
181TRACE_EVENT(inode_foreign_history,
182
183 TP_PROTO(struct inode *inode, struct writeback_control *wbc,
184 unsigned int history),
185
186 TP_ARGS(inode, wbc, history),
187
188 TP_STRUCT__entry(
189 __array(char, name, 32)
190 __field(unsigned long, ino)
191 __field(unsigned int, cgroup_ino)
190 __field(ino_t, ino)
191 __field(ino_t, cgroup_ino)
192 __field(unsigned int, history)
193 ),
194
195 TP_fast_assign(
196 strncpy(__entry->name, dev_name(inode_to_bdi(inode)->dev), 32);
197 __entry->ino = inode->i_ino;
198 __entry->cgroup_ino = __trace_wbc_assign_cgroup(wbc);
199 __entry->history = history;
200 ),
201
192 __field(unsigned int, history)
193 ),
194
195 TP_fast_assign(
196 strncpy(__entry->name, dev_name(inode_to_bdi(inode)->dev), 32);
197 __entry->ino = inode->i_ino;
198 __entry->cgroup_ino = __trace_wbc_assign_cgroup(wbc);
199 __entry->history = history;
200 ),
201
202 TP_printk("bdi %s: ino=%lu cgroup_ino=%u history=0x%x",
202 TP_printk("bdi %s: ino=%lu cgroup_ino=%lu history=0x%x",
203 __entry->name,
203 __entry->name,
204 __entry->ino,
205 __entry->cgroup_ino,
204 (unsigned long)__entry->ino,
205 (unsigned long)__entry->cgroup_ino,
206 __entry->history
207 )
208);
209
210TRACE_EVENT(inode_switch_wbs,
211
212 TP_PROTO(struct inode *inode, struct bdi_writeback *old_wb,
213 struct bdi_writeback *new_wb),
214
215 TP_ARGS(inode, old_wb, new_wb),
216
217 TP_STRUCT__entry(
218 __array(char, name, 32)
206 __entry->history
207 )
208);
209
210TRACE_EVENT(inode_switch_wbs,
211
212 TP_PROTO(struct inode *inode, struct bdi_writeback *old_wb,
213 struct bdi_writeback *new_wb),
214
215 TP_ARGS(inode, old_wb, new_wb),
216
217 TP_STRUCT__entry(
218 __array(char, name, 32)
219 __field(unsigned long, ino)
220 __field(unsigned int, old_cgroup_ino)
221 __field(unsigned int, new_cgroup_ino)
219 __field(ino_t, ino)
220 __field(ino_t, old_cgroup_ino)
221 __field(ino_t, new_cgroup_ino)
222 ),
223
224 TP_fast_assign(
225 strncpy(__entry->name, dev_name(old_wb->bdi->dev), 32);
226 __entry->ino = inode->i_ino;
227 __entry->old_cgroup_ino = __trace_wb_assign_cgroup(old_wb);
228 __entry->new_cgroup_ino = __trace_wb_assign_cgroup(new_wb);
229 ),
230
222 ),
223
224 TP_fast_assign(
225 strncpy(__entry->name, dev_name(old_wb->bdi->dev), 32);
226 __entry->ino = inode->i_ino;
227 __entry->old_cgroup_ino = __trace_wb_assign_cgroup(old_wb);
228 __entry->new_cgroup_ino = __trace_wb_assign_cgroup(new_wb);
229 ),
230
231 TP_printk("bdi %s: ino=%lu old_cgroup_ino=%u new_cgroup_ino=%u",
231 TP_printk("bdi %s: ino=%lu old_cgroup_ino=%lu new_cgroup_ino=%lu",
232 __entry->name,
232 __entry->name,
233 __entry->ino,
234 __entry->old_cgroup_ino,
235 __entry->new_cgroup_ino
233 (unsigned long)__entry->ino,
234 (unsigned long)__entry->old_cgroup_ino,
235 (unsigned long)__entry->new_cgroup_ino
236 )
237);
238
239TRACE_EVENT(track_foreign_dirty,
240
241 TP_PROTO(struct page *page, struct bdi_writeback *wb),
242
243 TP_ARGS(page, wb),
244
245 TP_STRUCT__entry(
246 __array(char, name, 32)
247 __field(u64, bdi_id)
236 )
237);
238
239TRACE_EVENT(track_foreign_dirty,
240
241 TP_PROTO(struct page *page, struct bdi_writeback *wb),
242
243 TP_ARGS(page, wb),
244
245 TP_STRUCT__entry(
246 __array(char, name, 32)
247 __field(u64, bdi_id)
248 __field(unsigned long, ino)
248 __field(ino_t, ino)
249 __field(unsigned int, memcg_id)
249 __field(unsigned int, memcg_id)
250 __field(unsigned int, cgroup_ino)
251 __field(unsigned int, page_cgroup_ino)
250 __field(ino_t, cgroup_ino)
251 __field(ino_t, page_cgroup_ino)
252 ),
253
254 TP_fast_assign(
255 struct address_space *mapping = page_mapping(page);
256 struct inode *inode = mapping ? mapping->host : NULL;
257
258 strncpy(__entry->name, dev_name(wb->bdi->dev), 32);
259 __entry->bdi_id = wb->bdi->id;
260 __entry->ino = inode ? inode->i_ino : 0;
261 __entry->memcg_id = wb->memcg_css->id;
262 __entry->cgroup_ino = __trace_wb_assign_cgroup(wb);
252 ),
253
254 TP_fast_assign(
255 struct address_space *mapping = page_mapping(page);
256 struct inode *inode = mapping ? mapping->host : NULL;
257
258 strncpy(__entry->name, dev_name(wb->bdi->dev), 32);
259 __entry->bdi_id = wb->bdi->id;
260 __entry->ino = inode ? inode->i_ino : 0;
261 __entry->memcg_id = wb->memcg_css->id;
262 __entry->cgroup_ino = __trace_wb_assign_cgroup(wb);
263 __entry->page_cgroup_ino = page->mem_cgroup->css.cgroup->kn->id.ino;
263 __entry->page_cgroup_ino = cgroup_ino(page->mem_cgroup->css.cgroup);
264 ),
265
264 ),
265
266 TP_printk("bdi %s[%llu]: ino=%lu memcg_id=%u cgroup_ino=%u page_cgroup_ino=%u",
266 TP_printk("bdi %s[%llu]: ino=%lu memcg_id=%u cgroup_ino=%lu page_cgroup_ino=%lu",
267 __entry->name,
268 __entry->bdi_id,
267 __entry->name,
268 __entry->bdi_id,
269 __entry->ino,
269 (unsigned long)__entry->ino,
270 __entry->memcg_id,
270 __entry->memcg_id,
271 __entry->cgroup_ino,
272 __entry->page_cgroup_ino
271 (unsigned long)__entry->cgroup_ino,
272 (unsigned long)__entry->page_cgroup_ino
273 )
274);
275
276TRACE_EVENT(flush_foreign,
277
278 TP_PROTO(struct bdi_writeback *wb, unsigned int frn_bdi_id,
279 unsigned int frn_memcg_id),
280
281 TP_ARGS(wb, frn_bdi_id, frn_memcg_id),
282
283 TP_STRUCT__entry(
284 __array(char, name, 32)
273 )
274);
275
276TRACE_EVENT(flush_foreign,
277
278 TP_PROTO(struct bdi_writeback *wb, unsigned int frn_bdi_id,
279 unsigned int frn_memcg_id),
280
281 TP_ARGS(wb, frn_bdi_id, frn_memcg_id),
282
283 TP_STRUCT__entry(
284 __array(char, name, 32)
285 __field(unsigned int, cgroup_ino)
285 __field(ino_t, cgroup_ino)
286 __field(unsigned int, frn_bdi_id)
287 __field(unsigned int, frn_memcg_id)
288 ),
289
290 TP_fast_assign(
291 strncpy(__entry->name, dev_name(wb->bdi->dev), 32);
292 __entry->cgroup_ino = __trace_wb_assign_cgroup(wb);
293 __entry->frn_bdi_id = frn_bdi_id;
294 __entry->frn_memcg_id = frn_memcg_id;
295 ),
296
286 __field(unsigned int, frn_bdi_id)
287 __field(unsigned int, frn_memcg_id)
288 ),
289
290 TP_fast_assign(
291 strncpy(__entry->name, dev_name(wb->bdi->dev), 32);
292 __entry->cgroup_ino = __trace_wb_assign_cgroup(wb);
293 __entry->frn_bdi_id = frn_bdi_id;
294 __entry->frn_memcg_id = frn_memcg_id;
295 ),
296
297 TP_printk("bdi %s: cgroup_ino=%u frn_bdi_id=%u frn_memcg_id=%u",
297 TP_printk("bdi %s: cgroup_ino=%lu frn_bdi_id=%u frn_memcg_id=%u",
298 __entry->name,
298 __entry->name,
299 __entry->cgroup_ino,
299 (unsigned long)__entry->cgroup_ino,
300 __entry->frn_bdi_id,
301 __entry->frn_memcg_id
302 )
303);
304#endif
305
306DECLARE_EVENT_CLASS(writeback_write_inode_template,
307
308 TP_PROTO(struct inode *inode, struct writeback_control *wbc),
309
310 TP_ARGS(inode, wbc),
311
312 TP_STRUCT__entry (
313 __array(char, name, 32)
300 __entry->frn_bdi_id,
301 __entry->frn_memcg_id
302 )
303);
304#endif
305
306DECLARE_EVENT_CLASS(writeback_write_inode_template,
307
308 TP_PROTO(struct inode *inode, struct writeback_control *wbc),
309
310 TP_ARGS(inode, wbc),
311
312 TP_STRUCT__entry (
313 __array(char, name, 32)
314 __field(unsigned long, ino)
314 __field(ino_t, ino)
315 __field(int, sync_mode)
315 __field(int, sync_mode)
316 __field(unsigned int, cgroup_ino)
316 __field(ino_t, cgroup_ino)
317 ),
318
319 TP_fast_assign(
320 strscpy_pad(__entry->name,
321 dev_name(inode_to_bdi(inode)->dev), 32);
322 __entry->ino = inode->i_ino;
323 __entry->sync_mode = wbc->sync_mode;
324 __entry->cgroup_ino = __trace_wbc_assign_cgroup(wbc);
325 ),
326
317 ),
318
319 TP_fast_assign(
320 strscpy_pad(__entry->name,
321 dev_name(inode_to_bdi(inode)->dev), 32);
322 __entry->ino = inode->i_ino;
323 __entry->sync_mode = wbc->sync_mode;
324 __entry->cgroup_ino = __trace_wbc_assign_cgroup(wbc);
325 ),
326
327 TP_printk("bdi %s: ino=%lu sync_mode=%d cgroup_ino=%u",
327 TP_printk("bdi %s: ino=%lu sync_mode=%d cgroup_ino=%lu",
328 __entry->name,
328 __entry->name,
329 __entry->ino,
329 (unsigned long)__entry->ino,
330 __entry->sync_mode,
330 __entry->sync_mode,
331 __entry->cgroup_ino
331 (unsigned long)__entry->cgroup_ino
332 )
333);
334
335DEFINE_EVENT(writeback_write_inode_template, writeback_write_inode_start,
336
337 TP_PROTO(struct inode *inode, struct writeback_control *wbc),
338
339 TP_ARGS(inode, wbc)

--- 13 unchanged lines hidden (view full) ---

353 __array(char, name, 32)
354 __field(long, nr_pages)
355 __field(dev_t, sb_dev)
356 __field(int, sync_mode)
357 __field(int, for_kupdate)
358 __field(int, range_cyclic)
359 __field(int, for_background)
360 __field(int, reason)
332 )
333);
334
335DEFINE_EVENT(writeback_write_inode_template, writeback_write_inode_start,
336
337 TP_PROTO(struct inode *inode, struct writeback_control *wbc),
338
339 TP_ARGS(inode, wbc)

--- 13 unchanged lines hidden (view full) ---

353 __array(char, name, 32)
354 __field(long, nr_pages)
355 __field(dev_t, sb_dev)
356 __field(int, sync_mode)
357 __field(int, for_kupdate)
358 __field(int, range_cyclic)
359 __field(int, for_background)
360 __field(int, reason)
361 __field(unsigned int, cgroup_ino)
361 __field(ino_t, cgroup_ino)
362 ),
363 TP_fast_assign(
364 strscpy_pad(__entry->name,
365 wb->bdi->dev ? dev_name(wb->bdi->dev) :
366 "(unknown)", 32);
367 __entry->nr_pages = work->nr_pages;
368 __entry->sb_dev = work->sb ? work->sb->s_dev : 0;
369 __entry->sync_mode = work->sync_mode;
370 __entry->for_kupdate = work->for_kupdate;
371 __entry->range_cyclic = work->range_cyclic;
372 __entry->for_background = work->for_background;
373 __entry->reason = work->reason;
374 __entry->cgroup_ino = __trace_wb_assign_cgroup(wb);
375 ),
376 TP_printk("bdi %s: sb_dev %d:%d nr_pages=%ld sync_mode=%d "
362 ),
363 TP_fast_assign(
364 strscpy_pad(__entry->name,
365 wb->bdi->dev ? dev_name(wb->bdi->dev) :
366 "(unknown)", 32);
367 __entry->nr_pages = work->nr_pages;
368 __entry->sb_dev = work->sb ? work->sb->s_dev : 0;
369 __entry->sync_mode = work->sync_mode;
370 __entry->for_kupdate = work->for_kupdate;
371 __entry->range_cyclic = work->range_cyclic;
372 __entry->for_background = work->for_background;
373 __entry->reason = work->reason;
374 __entry->cgroup_ino = __trace_wb_assign_cgroup(wb);
375 ),
376 TP_printk("bdi %s: sb_dev %d:%d nr_pages=%ld sync_mode=%d "
377 "kupdate=%d range_cyclic=%d background=%d reason=%s cgroup_ino=%u",
377 "kupdate=%d range_cyclic=%d background=%d reason=%s cgroup_ino=%lu",
378 __entry->name,
379 MAJOR(__entry->sb_dev), MINOR(__entry->sb_dev),
380 __entry->nr_pages,
381 __entry->sync_mode,
382 __entry->for_kupdate,
383 __entry->range_cyclic,
384 __entry->for_background,
385 __print_symbolic(__entry->reason, WB_WORK_REASON),
378 __entry->name,
379 MAJOR(__entry->sb_dev), MINOR(__entry->sb_dev),
380 __entry->nr_pages,
381 __entry->sync_mode,
382 __entry->for_kupdate,
383 __entry->range_cyclic,
384 __entry->for_background,
385 __print_symbolic(__entry->reason, WB_WORK_REASON),
386 __entry->cgroup_ino
386 (unsigned long)__entry->cgroup_ino
387 )
388);
389#define DEFINE_WRITEBACK_WORK_EVENT(name) \
390DEFINE_EVENT(writeback_work_class, name, \
391 TP_PROTO(struct bdi_writeback *wb, struct wb_writeback_work *work), \
392 TP_ARGS(wb, work))
393DEFINE_WRITEBACK_WORK_EVENT(writeback_queue);
394DEFINE_WRITEBACK_WORK_EVENT(writeback_exec);

--- 13 unchanged lines hidden (view full) ---

408 TP_printk("%ld", __entry->pages)
409);
410
411DECLARE_EVENT_CLASS(writeback_class,
412 TP_PROTO(struct bdi_writeback *wb),
413 TP_ARGS(wb),
414 TP_STRUCT__entry(
415 __array(char, name, 32)
387 )
388);
389#define DEFINE_WRITEBACK_WORK_EVENT(name) \
390DEFINE_EVENT(writeback_work_class, name, \
391 TP_PROTO(struct bdi_writeback *wb, struct wb_writeback_work *work), \
392 TP_ARGS(wb, work))
393DEFINE_WRITEBACK_WORK_EVENT(writeback_queue);
394DEFINE_WRITEBACK_WORK_EVENT(writeback_exec);

--- 13 unchanged lines hidden (view full) ---

408 TP_printk("%ld", __entry->pages)
409);
410
411DECLARE_EVENT_CLASS(writeback_class,
412 TP_PROTO(struct bdi_writeback *wb),
413 TP_ARGS(wb),
414 TP_STRUCT__entry(
415 __array(char, name, 32)
416 __field(unsigned int, cgroup_ino)
416 __field(ino_t, cgroup_ino)
417 ),
418 TP_fast_assign(
419 strscpy_pad(__entry->name, dev_name(wb->bdi->dev), 32);
420 __entry->cgroup_ino = __trace_wb_assign_cgroup(wb);
421 ),
417 ),
418 TP_fast_assign(
419 strscpy_pad(__entry->name, dev_name(wb->bdi->dev), 32);
420 __entry->cgroup_ino = __trace_wb_assign_cgroup(wb);
421 ),
422 TP_printk("bdi %s: cgroup_ino=%u",
422 TP_printk("bdi %s: cgroup_ino=%lu",
423 __entry->name,
423 __entry->name,
424 __entry->cgroup_ino
424 (unsigned long)__entry->cgroup_ino
425 )
426);
427#define DEFINE_WRITEBACK_EVENT(name) \
428DEFINE_EVENT(writeback_class, name, \
429 TP_PROTO(struct bdi_writeback *wb), \
430 TP_ARGS(wb))
431
432DEFINE_WRITEBACK_EVENT(writeback_wake_background);

--- 21 unchanged lines hidden (view full) ---

454 __field(long, pages_skipped)
455 __field(int, sync_mode)
456 __field(int, for_kupdate)
457 __field(int, for_background)
458 __field(int, for_reclaim)
459 __field(int, range_cyclic)
460 __field(long, range_start)
461 __field(long, range_end)
425 )
426);
427#define DEFINE_WRITEBACK_EVENT(name) \
428DEFINE_EVENT(writeback_class, name, \
429 TP_PROTO(struct bdi_writeback *wb), \
430 TP_ARGS(wb))
431
432DEFINE_WRITEBACK_EVENT(writeback_wake_background);

--- 21 unchanged lines hidden (view full) ---

454 __field(long, pages_skipped)
455 __field(int, sync_mode)
456 __field(int, for_kupdate)
457 __field(int, for_background)
458 __field(int, for_reclaim)
459 __field(int, range_cyclic)
460 __field(long, range_start)
461 __field(long, range_end)
462 __field(unsigned int, cgroup_ino)
462 __field(ino_t, cgroup_ino)
463 ),
464
465 TP_fast_assign(
466 strscpy_pad(__entry->name, dev_name(bdi->dev), 32);
467 __entry->nr_to_write = wbc->nr_to_write;
468 __entry->pages_skipped = wbc->pages_skipped;
469 __entry->sync_mode = wbc->sync_mode;
470 __entry->for_kupdate = wbc->for_kupdate;
471 __entry->for_background = wbc->for_background;
472 __entry->for_reclaim = wbc->for_reclaim;
473 __entry->range_cyclic = wbc->range_cyclic;
474 __entry->range_start = (long)wbc->range_start;
475 __entry->range_end = (long)wbc->range_end;
476 __entry->cgroup_ino = __trace_wbc_assign_cgroup(wbc);
477 ),
478
479 TP_printk("bdi %s: towrt=%ld skip=%ld mode=%d kupd=%d "
480 "bgrd=%d reclm=%d cyclic=%d "
463 ),
464
465 TP_fast_assign(
466 strscpy_pad(__entry->name, dev_name(bdi->dev), 32);
467 __entry->nr_to_write = wbc->nr_to_write;
468 __entry->pages_skipped = wbc->pages_skipped;
469 __entry->sync_mode = wbc->sync_mode;
470 __entry->for_kupdate = wbc->for_kupdate;
471 __entry->for_background = wbc->for_background;
472 __entry->for_reclaim = wbc->for_reclaim;
473 __entry->range_cyclic = wbc->range_cyclic;
474 __entry->range_start = (long)wbc->range_start;
475 __entry->range_end = (long)wbc->range_end;
476 __entry->cgroup_ino = __trace_wbc_assign_cgroup(wbc);
477 ),
478
479 TP_printk("bdi %s: towrt=%ld skip=%ld mode=%d kupd=%d "
480 "bgrd=%d reclm=%d cyclic=%d "
481 "start=0x%lx end=0x%lx cgroup_ino=%u",
481 "start=0x%lx end=0x%lx cgroup_ino=%lu",
482 __entry->name,
483 __entry->nr_to_write,
484 __entry->pages_skipped,
485 __entry->sync_mode,
486 __entry->for_kupdate,
487 __entry->for_background,
488 __entry->for_reclaim,
489 __entry->range_cyclic,
490 __entry->range_start,
491 __entry->range_end,
482 __entry->name,
483 __entry->nr_to_write,
484 __entry->pages_skipped,
485 __entry->sync_mode,
486 __entry->for_kupdate,
487 __entry->for_background,
488 __entry->for_reclaim,
489 __entry->range_cyclic,
490 __entry->range_start,
491 __entry->range_end,
492 __entry->cgroup_ino
492 (unsigned long)__entry->cgroup_ino
493 )
494)
495
496#define DEFINE_WBC_EVENT(name) \
497DEFINE_EVENT(wbc_class, name, \
498 TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \
499 TP_ARGS(wbc, bdi))
500DEFINE_WBC_EVENT(wbc_writepage);

--- 4 unchanged lines hidden (view full) ---

505 int moved),
506 TP_ARGS(wb, work, moved),
507 TP_STRUCT__entry(
508 __array(char, name, 32)
509 __field(unsigned long, older)
510 __field(long, age)
511 __field(int, moved)
512 __field(int, reason)
493 )
494)
495
496#define DEFINE_WBC_EVENT(name) \
497DEFINE_EVENT(wbc_class, name, \
498 TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \
499 TP_ARGS(wbc, bdi))
500DEFINE_WBC_EVENT(wbc_writepage);

--- 4 unchanged lines hidden (view full) ---

505 int moved),
506 TP_ARGS(wb, work, moved),
507 TP_STRUCT__entry(
508 __array(char, name, 32)
509 __field(unsigned long, older)
510 __field(long, age)
511 __field(int, moved)
512 __field(int, reason)
513 __field(unsigned int, cgroup_ino)
513 __field(ino_t, cgroup_ino)
514 ),
515 TP_fast_assign(
516 unsigned long *older_than_this = work->older_than_this;
517 strscpy_pad(__entry->name, dev_name(wb->bdi->dev), 32);
518 __entry->older = older_than_this ? *older_than_this : 0;
519 __entry->age = older_than_this ?
520 (jiffies - *older_than_this) * 1000 / HZ : -1;
521 __entry->moved = moved;
522 __entry->reason = work->reason;
523 __entry->cgroup_ino = __trace_wb_assign_cgroup(wb);
524 ),
514 ),
515 TP_fast_assign(
516 unsigned long *older_than_this = work->older_than_this;
517 strscpy_pad(__entry->name, dev_name(wb->bdi->dev), 32);
518 __entry->older = older_than_this ? *older_than_this : 0;
519 __entry->age = older_than_this ?
520 (jiffies - *older_than_this) * 1000 / HZ : -1;
521 __entry->moved = moved;
522 __entry->reason = work->reason;
523 __entry->cgroup_ino = __trace_wb_assign_cgroup(wb);
524 ),
525 TP_printk("bdi %s: older=%lu age=%ld enqueue=%d reason=%s cgroup_ino=%u",
525 TP_printk("bdi %s: older=%lu age=%ld enqueue=%d reason=%s cgroup_ino=%lu",
526 __entry->name,
527 __entry->older, /* older_than_this in jiffies */
528 __entry->age, /* older_than_this in relative milliseconds */
529 __entry->moved,
530 __print_symbolic(__entry->reason, WB_WORK_REASON),
526 __entry->name,
527 __entry->older, /* older_than_this in jiffies */
528 __entry->age, /* older_than_this in relative milliseconds */
529 __entry->moved,
530 __print_symbolic(__entry->reason, WB_WORK_REASON),
531 __entry->cgroup_ino
531 (unsigned long)__entry->cgroup_ino
532 )
533);
534
535TRACE_EVENT(global_dirty_state,
536
537 TP_PROTO(unsigned long background_thresh,
538 unsigned long dirty_thresh
539 ),

--- 51 unchanged lines hidden (view full) ---

591 TP_STRUCT__entry(
592 __array(char, bdi, 32)
593 __field(unsigned long, write_bw)
594 __field(unsigned long, avg_write_bw)
595 __field(unsigned long, dirty_rate)
596 __field(unsigned long, dirty_ratelimit)
597 __field(unsigned long, task_ratelimit)
598 __field(unsigned long, balanced_dirty_ratelimit)
532 )
533);
534
535TRACE_EVENT(global_dirty_state,
536
537 TP_PROTO(unsigned long background_thresh,
538 unsigned long dirty_thresh
539 ),

--- 51 unchanged lines hidden (view full) ---

591 TP_STRUCT__entry(
592 __array(char, bdi, 32)
593 __field(unsigned long, write_bw)
594 __field(unsigned long, avg_write_bw)
595 __field(unsigned long, dirty_rate)
596 __field(unsigned long, dirty_ratelimit)
597 __field(unsigned long, task_ratelimit)
598 __field(unsigned long, balanced_dirty_ratelimit)
599 __field(unsigned int, cgroup_ino)
599 __field(ino_t, cgroup_ino)
600 ),
601
602 TP_fast_assign(
603 strscpy_pad(__entry->bdi, dev_name(wb->bdi->dev), 32);
604 __entry->write_bw = KBps(wb->write_bandwidth);
605 __entry->avg_write_bw = KBps(wb->avg_write_bandwidth);
606 __entry->dirty_rate = KBps(dirty_rate);
607 __entry->dirty_ratelimit = KBps(wb->dirty_ratelimit);
608 __entry->task_ratelimit = KBps(task_ratelimit);
609 __entry->balanced_dirty_ratelimit =
610 KBps(wb->balanced_dirty_ratelimit);
611 __entry->cgroup_ino = __trace_wb_assign_cgroup(wb);
612 ),
613
614 TP_printk("bdi %s: "
615 "write_bw=%lu awrite_bw=%lu dirty_rate=%lu "
616 "dirty_ratelimit=%lu task_ratelimit=%lu "
600 ),
601
602 TP_fast_assign(
603 strscpy_pad(__entry->bdi, dev_name(wb->bdi->dev), 32);
604 __entry->write_bw = KBps(wb->write_bandwidth);
605 __entry->avg_write_bw = KBps(wb->avg_write_bandwidth);
606 __entry->dirty_rate = KBps(dirty_rate);
607 __entry->dirty_ratelimit = KBps(wb->dirty_ratelimit);
608 __entry->task_ratelimit = KBps(task_ratelimit);
609 __entry->balanced_dirty_ratelimit =
610 KBps(wb->balanced_dirty_ratelimit);
611 __entry->cgroup_ino = __trace_wb_assign_cgroup(wb);
612 ),
613
614 TP_printk("bdi %s: "
615 "write_bw=%lu awrite_bw=%lu dirty_rate=%lu "
616 "dirty_ratelimit=%lu task_ratelimit=%lu "
617 "balanced_dirty_ratelimit=%lu cgroup_ino=%u",
617 "balanced_dirty_ratelimit=%lu cgroup_ino=%lu",
618 __entry->bdi,
619 __entry->write_bw, /* write bandwidth */
620 __entry->avg_write_bw, /* avg write bandwidth */
621 __entry->dirty_rate, /* bdi dirty rate */
622 __entry->dirty_ratelimit, /* base ratelimit */
623 __entry->task_ratelimit, /* ratelimit with position control */
624 __entry->balanced_dirty_ratelimit, /* the balanced ratelimit */
618 __entry->bdi,
619 __entry->write_bw, /* write bandwidth */
620 __entry->avg_write_bw, /* avg write bandwidth */
621 __entry->dirty_rate, /* bdi dirty rate */
622 __entry->dirty_ratelimit, /* base ratelimit */
623 __entry->task_ratelimit, /* ratelimit with position control */
624 __entry->balanced_dirty_ratelimit, /* the balanced ratelimit */
625 __entry->cgroup_ino
625 (unsigned long)__entry->cgroup_ino
626 )
627);
628
629TRACE_EVENT(balance_dirty_pages,
630
631 TP_PROTO(struct bdi_writeback *wb,
632 unsigned long thresh,
633 unsigned long bg_thresh,

--- 21 unchanged lines hidden (view full) ---

655 __field(unsigned long, dirty_ratelimit)
656 __field(unsigned long, task_ratelimit)
657 __field(unsigned int, dirtied)
658 __field(unsigned int, dirtied_pause)
659 __field(unsigned long, paused)
660 __field( long, pause)
661 __field(unsigned long, period)
662 __field( long, think)
626 )
627);
628
629TRACE_EVENT(balance_dirty_pages,
630
631 TP_PROTO(struct bdi_writeback *wb,
632 unsigned long thresh,
633 unsigned long bg_thresh,

--- 21 unchanged lines hidden (view full) ---

655 __field(unsigned long, dirty_ratelimit)
656 __field(unsigned long, task_ratelimit)
657 __field(unsigned int, dirtied)
658 __field(unsigned int, dirtied_pause)
659 __field(unsigned long, paused)
660 __field( long, pause)
661 __field(unsigned long, period)
662 __field( long, think)
663 __field(unsigned int, cgroup_ino)
663 __field(ino_t, cgroup_ino)
664 ),
665
666 TP_fast_assign(
667 unsigned long freerun = (thresh + bg_thresh) / 2;
668 strscpy_pad(__entry->bdi, dev_name(wb->bdi->dev), 32);
669
670 __entry->limit = global_wb_domain.dirty_limit;
671 __entry->setpoint = (global_wb_domain.dirty_limit +

--- 15 unchanged lines hidden (view full) ---

687 ),
688
689
690 TP_printk("bdi %s: "
691 "limit=%lu setpoint=%lu dirty=%lu "
692 "bdi_setpoint=%lu bdi_dirty=%lu "
693 "dirty_ratelimit=%lu task_ratelimit=%lu "
694 "dirtied=%u dirtied_pause=%u "
664 ),
665
666 TP_fast_assign(
667 unsigned long freerun = (thresh + bg_thresh) / 2;
668 strscpy_pad(__entry->bdi, dev_name(wb->bdi->dev), 32);
669
670 __entry->limit = global_wb_domain.dirty_limit;
671 __entry->setpoint = (global_wb_domain.dirty_limit +

--- 15 unchanged lines hidden (view full) ---

687 ),
688
689
690 TP_printk("bdi %s: "
691 "limit=%lu setpoint=%lu dirty=%lu "
692 "bdi_setpoint=%lu bdi_dirty=%lu "
693 "dirty_ratelimit=%lu task_ratelimit=%lu "
694 "dirtied=%u dirtied_pause=%u "
695 "paused=%lu pause=%ld period=%lu think=%ld cgroup_ino=%u",
695 "paused=%lu pause=%ld period=%lu think=%ld cgroup_ino=%lu",
696 __entry->bdi,
697 __entry->limit,
698 __entry->setpoint,
699 __entry->dirty,
700 __entry->bdi_setpoint,
701 __entry->bdi_dirty,
702 __entry->dirty_ratelimit,
703 __entry->task_ratelimit,
704 __entry->dirtied,
705 __entry->dirtied_pause,
706 __entry->paused, /* ms */
707 __entry->pause, /* ms */
708 __entry->period, /* ms */
709 __entry->think, /* ms */
696 __entry->bdi,
697 __entry->limit,
698 __entry->setpoint,
699 __entry->dirty,
700 __entry->bdi_setpoint,
701 __entry->bdi_dirty,
702 __entry->dirty_ratelimit,
703 __entry->task_ratelimit,
704 __entry->dirtied,
705 __entry->dirtied_pause,
706 __entry->paused, /* ms */
707 __entry->pause, /* ms */
708 __entry->period, /* ms */
709 __entry->think, /* ms */
710 __entry->cgroup_ino
710 (unsigned long)__entry->cgroup_ino
711 )
712);
713
714TRACE_EVENT(writeback_sb_inodes_requeue,
715
716 TP_PROTO(struct inode *inode),
717 TP_ARGS(inode),
718
719 TP_STRUCT__entry(
720 __array(char, name, 32)
711 )
712);
713
714TRACE_EVENT(writeback_sb_inodes_requeue,
715
716 TP_PROTO(struct inode *inode),
717 TP_ARGS(inode),
718
719 TP_STRUCT__entry(
720 __array(char, name, 32)
721 __field(unsigned long, ino)
721 __field(ino_t, ino)
722 __field(unsigned long, state)
723 __field(unsigned long, dirtied_when)
722 __field(unsigned long, state)
723 __field(unsigned long, dirtied_when)
724 __field(unsigned int, cgroup_ino)
724 __field(ino_t, cgroup_ino)
725 ),
726
727 TP_fast_assign(
728 strscpy_pad(__entry->name,
729 dev_name(inode_to_bdi(inode)->dev), 32);
730 __entry->ino = inode->i_ino;
731 __entry->state = inode->i_state;
732 __entry->dirtied_when = inode->dirtied_when;
733 __entry->cgroup_ino = __trace_wb_assign_cgroup(inode_to_wb(inode));
734 ),
735
725 ),
726
727 TP_fast_assign(
728 strscpy_pad(__entry->name,
729 dev_name(inode_to_bdi(inode)->dev), 32);
730 __entry->ino = inode->i_ino;
731 __entry->state = inode->i_state;
732 __entry->dirtied_when = inode->dirtied_when;
733 __entry->cgroup_ino = __trace_wb_assign_cgroup(inode_to_wb(inode));
734 ),
735
736 TP_printk("bdi %s: ino=%lu state=%s dirtied_when=%lu age=%lu cgroup_ino=%u",
736 TP_printk("bdi %s: ino=%lu state=%s dirtied_when=%lu age=%lu cgroup_ino=%lu",
737 __entry->name,
737 __entry->name,
738 __entry->ino,
738 (unsigned long)__entry->ino,
739 show_inode_state(__entry->state),
740 __entry->dirtied_when,
741 (jiffies - __entry->dirtied_when) / HZ,
739 show_inode_state(__entry->state),
740 __entry->dirtied_when,
741 (jiffies - __entry->dirtied_when) / HZ,
742 __entry->cgroup_ino
742 (unsigned long)__entry->cgroup_ino
743 )
744);
745
746DECLARE_EVENT_CLASS(writeback_congest_waited_template,
747
748 TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed),
749
750 TP_ARGS(usec_timeout, usec_delayed),

--- 33 unchanged lines hidden (view full) ---

784 struct writeback_control *wbc,
785 unsigned long nr_to_write
786 ),
787
788 TP_ARGS(inode, wbc, nr_to_write),
789
790 TP_STRUCT__entry(
791 __array(char, name, 32)
743 )
744);
745
746DECLARE_EVENT_CLASS(writeback_congest_waited_template,
747
748 TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed),
749
750 TP_ARGS(usec_timeout, usec_delayed),

--- 33 unchanged lines hidden (view full) ---

784 struct writeback_control *wbc,
785 unsigned long nr_to_write
786 ),
787
788 TP_ARGS(inode, wbc, nr_to_write),
789
790 TP_STRUCT__entry(
791 __array(char, name, 32)
792 __field(unsigned long, ino)
792 __field(ino_t, ino)
793 __field(unsigned long, state)
794 __field(unsigned long, dirtied_when)
795 __field(unsigned long, writeback_index)
796 __field(long, nr_to_write)
797 __field(unsigned long, wrote)
793 __field(unsigned long, state)
794 __field(unsigned long, dirtied_when)
795 __field(unsigned long, writeback_index)
796 __field(long, nr_to_write)
797 __field(unsigned long, wrote)
798 __field(unsigned int, cgroup_ino)
798 __field(ino_t, cgroup_ino)
799 ),
800
801 TP_fast_assign(
802 strscpy_pad(__entry->name,
803 dev_name(inode_to_bdi(inode)->dev), 32);
804 __entry->ino = inode->i_ino;
805 __entry->state = inode->i_state;
806 __entry->dirtied_when = inode->dirtied_when;
807 __entry->writeback_index = inode->i_mapping->writeback_index;
808 __entry->nr_to_write = nr_to_write;
809 __entry->wrote = nr_to_write - wbc->nr_to_write;
810 __entry->cgroup_ino = __trace_wbc_assign_cgroup(wbc);
811 ),
812
813 TP_printk("bdi %s: ino=%lu state=%s dirtied_when=%lu age=%lu "
799 ),
800
801 TP_fast_assign(
802 strscpy_pad(__entry->name,
803 dev_name(inode_to_bdi(inode)->dev), 32);
804 __entry->ino = inode->i_ino;
805 __entry->state = inode->i_state;
806 __entry->dirtied_when = inode->dirtied_when;
807 __entry->writeback_index = inode->i_mapping->writeback_index;
808 __entry->nr_to_write = nr_to_write;
809 __entry->wrote = nr_to_write - wbc->nr_to_write;
810 __entry->cgroup_ino = __trace_wbc_assign_cgroup(wbc);
811 ),
812
813 TP_printk("bdi %s: ino=%lu state=%s dirtied_when=%lu age=%lu "
814 "index=%lu to_write=%ld wrote=%lu cgroup_ino=%u",
814 "index=%lu to_write=%ld wrote=%lu cgroup_ino=%lu",
815 __entry->name,
815 __entry->name,
816 __entry->ino,
816 (unsigned long)__entry->ino,
817 show_inode_state(__entry->state),
818 __entry->dirtied_when,
819 (jiffies - __entry->dirtied_when) / HZ,
820 __entry->writeback_index,
821 __entry->nr_to_write,
822 __entry->wrote,
817 show_inode_state(__entry->state),
818 __entry->dirtied_when,
819 (jiffies - __entry->dirtied_when) / HZ,
820 __entry->writeback_index,
821 __entry->nr_to_write,
822 __entry->wrote,
823 __entry->cgroup_ino
823 (unsigned long)__entry->cgroup_ino
824 )
825);
826
827DEFINE_EVENT(writeback_single_inode_template, writeback_single_inode_start,
828 TP_PROTO(struct inode *inode,
829 struct writeback_control *wbc,
830 unsigned long nr_to_write),
831 TP_ARGS(inode, wbc, nr_to_write)

--- 8 unchanged lines hidden (view full) ---

840
841DECLARE_EVENT_CLASS(writeback_inode_template,
842 TP_PROTO(struct inode *inode),
843
844 TP_ARGS(inode),
845
846 TP_STRUCT__entry(
847 __field( dev_t, dev )
824 )
825);
826
827DEFINE_EVENT(writeback_single_inode_template, writeback_single_inode_start,
828 TP_PROTO(struct inode *inode,
829 struct writeback_control *wbc,
830 unsigned long nr_to_write),
831 TP_ARGS(inode, wbc, nr_to_write)

--- 8 unchanged lines hidden (view full) ---

840
841DECLARE_EVENT_CLASS(writeback_inode_template,
842 TP_PROTO(struct inode *inode),
843
844 TP_ARGS(inode),
845
846 TP_STRUCT__entry(
847 __field( dev_t, dev )
848 __field(unsigned long, ino )
848 __field( ino_t, ino )
849 __field(unsigned long, state )
850 __field( __u16, mode )
851 __field(unsigned long, dirtied_when )
852 ),
853
854 TP_fast_assign(
855 __entry->dev = inode->i_sb->s_dev;
856 __entry->ino = inode->i_ino;
857 __entry->state = inode->i_state;
858 __entry->mode = inode->i_mode;
859 __entry->dirtied_when = inode->dirtied_when;
860 ),
861
862 TP_printk("dev %d,%d ino %lu dirtied %lu state %s mode 0%o",
863 MAJOR(__entry->dev), MINOR(__entry->dev),
849 __field(unsigned long, state )
850 __field( __u16, mode )
851 __field(unsigned long, dirtied_when )
852 ),
853
854 TP_fast_assign(
855 __entry->dev = inode->i_sb->s_dev;
856 __entry->ino = inode->i_ino;
857 __entry->state = inode->i_state;
858 __entry->mode = inode->i_mode;
859 __entry->dirtied_when = inode->dirtied_when;
860 ),
861
862 TP_printk("dev %d,%d ino %lu dirtied %lu state %s mode 0%o",
863 MAJOR(__entry->dev), MINOR(__entry->dev),
864 __entry->ino, __entry->dirtied_when,
864 (unsigned long)__entry->ino, __entry->dirtied_when,
865 show_inode_state(__entry->state), __entry->mode)
866);
867
868DEFINE_EVENT(writeback_inode_template, writeback_lazytime,
869 TP_PROTO(struct inode *inode),
870
871 TP_ARGS(inode)
872);

--- 32 unchanged lines hidden ---
865 show_inode_state(__entry->state), __entry->mode)
866);
867
868DEFINE_EVENT(writeback_inode_template, writeback_lazytime,
869 TP_PROTO(struct inode *inode),
870
871 TP_ARGS(inode)
872);

--- 32 unchanged lines hidden ---