aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/block.h30
-rw-r--r--include/trace/events/btrfs.h667
-rw-r--r--include/trace/events/ext4.h775
-rw-r--r--include/trace/events/jbd2.h78
4 files changed, 1285 insertions, 265 deletions
diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index 78f18adb49c8..bf366547da25 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -401,9 +401,9 @@ TRACE_EVENT(block_plug,
401 401
402DECLARE_EVENT_CLASS(block_unplug, 402DECLARE_EVENT_CLASS(block_unplug,
403 403
404 TP_PROTO(struct request_queue *q), 404 TP_PROTO(struct request_queue *q, unsigned int depth, bool explicit),
405 405
406 TP_ARGS(q), 406 TP_ARGS(q, depth, explicit),
407 407
408 TP_STRUCT__entry( 408 TP_STRUCT__entry(
409 __field( int, nr_rq ) 409 __field( int, nr_rq )
@@ -411,7 +411,7 @@ DECLARE_EVENT_CLASS(block_unplug,
411 ), 411 ),
412 412
413 TP_fast_assign( 413 TP_fast_assign(
414 __entry->nr_rq = q->rq.count[READ] + q->rq.count[WRITE]; 414 __entry->nr_rq = depth;
415 memcpy(__entry->comm, current->comm, TASK_COMM_LEN); 415 memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
416 ), 416 ),
417 417
@@ -419,31 +419,19 @@ DECLARE_EVENT_CLASS(block_unplug,
419); 419);
420 420
421/** 421/**
422 * block_unplug_timer - timed release of operations requests in queue to device driver 422 * block_unplug - release of operations requests in request queue
423 * @q: request queue to unplug
424 *
425 * Unplug the request queue @q because a timer expired and allow block
426 * operation requests to be sent to the device driver.
427 */
428DEFINE_EVENT(block_unplug, block_unplug_timer,
429
430 TP_PROTO(struct request_queue *q),
431
432 TP_ARGS(q)
433);
434
435/**
436 * block_unplug_io - release of operations requests in request queue
437 * @q: request queue to unplug 423 * @q: request queue to unplug
424 * @depth: number of requests just added to the queue
425 * @explicit: whether this was an explicit unplug, or one from schedule()
438 * 426 *
439 * Unplug request queue @q because device driver is scheduled to work 427 * Unplug request queue @q because device driver is scheduled to work
440 * on elements in the request queue. 428 * on elements in the request queue.
441 */ 429 */
442DEFINE_EVENT(block_unplug, block_unplug_io, 430DEFINE_EVENT(block_unplug, block_unplug,
443 431
444 TP_PROTO(struct request_queue *q), 432 TP_PROTO(struct request_queue *q, unsigned int depth, bool explicit),
445 433
446 TP_ARGS(q) 434 TP_ARGS(q, depth, explicit)
447); 435);
448 436
449/** 437/**
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h
new file mode 100644
index 000000000000..f445cff66ab7
--- /dev/null
+++ b/include/trace/events/btrfs.h
@@ -0,0 +1,667 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM btrfs
3
4#if !defined(_TRACE_BTRFS_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_BTRFS_H
6
7#include <linux/writeback.h>
8#include <linux/tracepoint.h>
9
10struct btrfs_root;
11struct btrfs_fs_info;
12struct btrfs_inode;
13struct extent_map;
14struct btrfs_ordered_extent;
15struct btrfs_delayed_ref_node;
16struct btrfs_delayed_tree_ref;
17struct btrfs_delayed_data_ref;
18struct btrfs_delayed_ref_head;
19struct map_lookup;
20struct extent_buffer;
21
22#define show_ref_type(type) \
23 __print_symbolic(type, \
24 { BTRFS_TREE_BLOCK_REF_KEY, "TREE_BLOCK_REF" }, \
25 { BTRFS_EXTENT_DATA_REF_KEY, "EXTENT_DATA_REF" }, \
26 { BTRFS_EXTENT_REF_V0_KEY, "EXTENT_REF_V0" }, \
27 { BTRFS_SHARED_BLOCK_REF_KEY, "SHARED_BLOCK_REF" }, \
28 { BTRFS_SHARED_DATA_REF_KEY, "SHARED_DATA_REF" })
29
30#define __show_root_type(obj) \
31 __print_symbolic(obj, \
32 { BTRFS_ROOT_TREE_OBJECTID, "ROOT_TREE" }, \
33 { BTRFS_EXTENT_TREE_OBJECTID, "EXTENT_TREE" }, \
34 { BTRFS_CHUNK_TREE_OBJECTID, "CHUNK_TREE" }, \
35 { BTRFS_DEV_TREE_OBJECTID, "DEV_TREE" }, \
36 { BTRFS_FS_TREE_OBJECTID, "FS_TREE" }, \
37 { BTRFS_ROOT_TREE_DIR_OBJECTID, "ROOT_TREE_DIR" }, \
38 { BTRFS_CSUM_TREE_OBJECTID, "CSUM_TREE" }, \
39 { BTRFS_TREE_LOG_OBJECTID, "TREE_LOG" }, \
40 { BTRFS_TREE_RELOC_OBJECTID, "TREE_RELOC" }, \
41 { BTRFS_DATA_RELOC_TREE_OBJECTID, "DATA_RELOC_TREE" })
42
43#define show_root_type(obj) \
44 obj, ((obj >= BTRFS_DATA_RELOC_TREE_OBJECTID) || \
45 (obj <= BTRFS_CSUM_TREE_OBJECTID )) ? __show_root_type(obj) : "-"
46
47TRACE_EVENT(btrfs_transaction_commit,
48
49 TP_PROTO(struct btrfs_root *root),
50
51 TP_ARGS(root),
52
53 TP_STRUCT__entry(
54 __field( u64, generation )
55 __field( u64, root_objectid )
56 ),
57
58 TP_fast_assign(
59 __entry->generation = root->fs_info->generation;
60 __entry->root_objectid = root->root_key.objectid;
61 ),
62
63 TP_printk("root = %llu(%s), gen = %llu",
64 show_root_type(__entry->root_objectid),
65 (unsigned long long)__entry->generation)
66);
67
68DECLARE_EVENT_CLASS(btrfs__inode,
69
70 TP_PROTO(struct inode *inode),
71
72 TP_ARGS(inode),
73
74 TP_STRUCT__entry(
75 __field( ino_t, ino )
76 __field( blkcnt_t, blocks )
77 __field( u64, disk_i_size )
78 __field( u64, generation )
79 __field( u64, last_trans )
80 __field( u64, logged_trans )
81 __field( u64, root_objectid )
82 ),
83
84 TP_fast_assign(
85 __entry->ino = inode->i_ino;
86 __entry->blocks = inode->i_blocks;
87 __entry->disk_i_size = BTRFS_I(inode)->disk_i_size;
88 __entry->generation = BTRFS_I(inode)->generation;
89 __entry->last_trans = BTRFS_I(inode)->last_trans;
90 __entry->logged_trans = BTRFS_I(inode)->logged_trans;
91 __entry->root_objectid =
92 BTRFS_I(inode)->root->root_key.objectid;
93 ),
94
95 TP_printk("root = %llu(%s), gen = %llu, ino = %lu, blocks = %llu, "
96 "disk_i_size = %llu, last_trans = %llu, logged_trans = %llu",
97 show_root_type(__entry->root_objectid),
98 (unsigned long long)__entry->generation,
99 (unsigned long)__entry->ino,
100 (unsigned long long)__entry->blocks,
101 (unsigned long long)__entry->disk_i_size,
102 (unsigned long long)__entry->last_trans,
103 (unsigned long long)__entry->logged_trans)
104);
105
106DEFINE_EVENT(btrfs__inode, btrfs_inode_new,
107
108 TP_PROTO(struct inode *inode),
109
110 TP_ARGS(inode)
111);
112
113DEFINE_EVENT(btrfs__inode, btrfs_inode_request,
114
115 TP_PROTO(struct inode *inode),
116
117 TP_ARGS(inode)
118);
119
120DEFINE_EVENT(btrfs__inode, btrfs_inode_evict,
121
122 TP_PROTO(struct inode *inode),
123
124 TP_ARGS(inode)
125);
126
127#define __show_map_type(type) \
128 __print_symbolic(type, \
129 { EXTENT_MAP_LAST_BYTE, "LAST_BYTE" }, \
130 { EXTENT_MAP_HOLE, "HOLE" }, \
131 { EXTENT_MAP_INLINE, "INLINE" }, \
132 { EXTENT_MAP_DELALLOC, "DELALLOC" })
133
134#define show_map_type(type) \
135 type, (type >= EXTENT_MAP_LAST_BYTE) ? "-" : __show_map_type(type)
136
137#define show_map_flags(flag) \
138 __print_flags(flag, "|", \
139 { EXTENT_FLAG_PINNED, "PINNED" }, \
140 { EXTENT_FLAG_COMPRESSED, "COMPRESSED" }, \
141 { EXTENT_FLAG_VACANCY, "VACANCY" }, \
142 { EXTENT_FLAG_PREALLOC, "PREALLOC" })
143
144TRACE_EVENT(btrfs_get_extent,
145
146 TP_PROTO(struct btrfs_root *root, struct extent_map *map),
147
148 TP_ARGS(root, map),
149
150 TP_STRUCT__entry(
151 __field( u64, root_objectid )
152 __field( u64, start )
153 __field( u64, len )
154 __field( u64, orig_start )
155 __field( u64, block_start )
156 __field( u64, block_len )
157 __field( unsigned long, flags )
158 __field( int, refs )
159 __field( unsigned int, compress_type )
160 ),
161
162 TP_fast_assign(
163 __entry->root_objectid = root->root_key.objectid;
164 __entry->start = map->start;
165 __entry->len = map->len;
166 __entry->orig_start = map->orig_start;
167 __entry->block_start = map->block_start;
168 __entry->block_len = map->block_len;
169 __entry->flags = map->flags;
170 __entry->refs = atomic_read(&map->refs);
171 __entry->compress_type = map->compress_type;
172 ),
173
174 TP_printk("root = %llu(%s), start = %llu, len = %llu, "
175 "orig_start = %llu, block_start = %llu(%s), "
176 "block_len = %llu, flags = %s, refs = %u, "
177 "compress_type = %u",
178 show_root_type(__entry->root_objectid),
179 (unsigned long long)__entry->start,
180 (unsigned long long)__entry->len,
181 (unsigned long long)__entry->orig_start,
182 show_map_type(__entry->block_start),
183 (unsigned long long)__entry->block_len,
184 show_map_flags(__entry->flags),
185 __entry->refs, __entry->compress_type)
186);
187
188#define show_ordered_flags(flags) \
189 __print_symbolic(flags, \
190 { BTRFS_ORDERED_IO_DONE, "IO_DONE" }, \
191 { BTRFS_ORDERED_COMPLETE, "COMPLETE" }, \
192 { BTRFS_ORDERED_NOCOW, "NOCOW" }, \
193 { BTRFS_ORDERED_COMPRESSED, "COMPRESSED" }, \
194 { BTRFS_ORDERED_PREALLOC, "PREALLOC" }, \
195 { BTRFS_ORDERED_DIRECT, "DIRECT" })
196
197DECLARE_EVENT_CLASS(btrfs__ordered_extent,
198
199 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
200
201 TP_ARGS(inode, ordered),
202
203 TP_STRUCT__entry(
204 __field( ino_t, ino )
205 __field( u64, file_offset )
206 __field( u64, start )
207 __field( u64, len )
208 __field( u64, disk_len )
209 __field( u64, bytes_left )
210 __field( unsigned long, flags )
211 __field( int, compress_type )
212 __field( int, refs )
213 __field( u64, root_objectid )
214 ),
215
216 TP_fast_assign(
217 __entry->ino = inode->i_ino;
218 __entry->file_offset = ordered->file_offset;
219 __entry->start = ordered->start;
220 __entry->len = ordered->len;
221 __entry->disk_len = ordered->disk_len;
222 __entry->bytes_left = ordered->bytes_left;
223 __entry->flags = ordered->flags;
224 __entry->compress_type = ordered->compress_type;
225 __entry->refs = atomic_read(&ordered->refs);
226 __entry->root_objectid =
227 BTRFS_I(inode)->root->root_key.objectid;
228 ),
229
230 TP_printk("root = %llu(%s), ino = %llu, file_offset = %llu, "
231 "start = %llu, len = %llu, disk_len = %llu, "
232 "bytes_left = %llu, flags = %s, compress_type = %d, "
233 "refs = %d",
234 show_root_type(__entry->root_objectid),
235 (unsigned long long)__entry->ino,
236 (unsigned long long)__entry->file_offset,
237 (unsigned long long)__entry->start,
238 (unsigned long long)__entry->len,
239 (unsigned long long)__entry->disk_len,
240 (unsigned long long)__entry->bytes_left,
241 show_ordered_flags(__entry->flags),
242 __entry->compress_type, __entry->refs)
243);
244
245DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_add,
246
247 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
248
249 TP_ARGS(inode, ordered)
250);
251
252DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_remove,
253
254 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
255
256 TP_ARGS(inode, ordered)
257);
258
259DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_start,
260
261 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
262
263 TP_ARGS(inode, ordered)
264);
265
266DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_put,
267
268 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
269
270 TP_ARGS(inode, ordered)
271);
272
273DECLARE_EVENT_CLASS(btrfs__writepage,
274
275 TP_PROTO(struct page *page, struct inode *inode,
276 struct writeback_control *wbc),
277
278 TP_ARGS(page, inode, wbc),
279
280 TP_STRUCT__entry(
281 __field( ino_t, ino )
282 __field( pgoff_t, index )
283 __field( long, nr_to_write )
284 __field( long, pages_skipped )
285 __field( loff_t, range_start )
286 __field( loff_t, range_end )
287 __field( char, nonblocking )
288 __field( char, for_kupdate )
289 __field( char, for_reclaim )
290 __field( char, range_cyclic )
291 __field( pgoff_t, writeback_index )
292 __field( u64, root_objectid )
293 ),
294
295 TP_fast_assign(
296 __entry->ino = inode->i_ino;
297 __entry->index = page->index;
298 __entry->nr_to_write = wbc->nr_to_write;
299 __entry->pages_skipped = wbc->pages_skipped;
300 __entry->range_start = wbc->range_start;
301 __entry->range_end = wbc->range_end;
302 __entry->nonblocking = wbc->nonblocking;
303 __entry->for_kupdate = wbc->for_kupdate;
304 __entry->for_reclaim = wbc->for_reclaim;
305 __entry->range_cyclic = wbc->range_cyclic;
306 __entry->writeback_index = inode->i_mapping->writeback_index;
307 __entry->root_objectid =
308 BTRFS_I(inode)->root->root_key.objectid;
309 ),
310
311 TP_printk("root = %llu(%s), ino = %lu, page_index = %lu, "
312 "nr_to_write = %ld, pages_skipped = %ld, range_start = %llu, "
313 "range_end = %llu, nonblocking = %d, for_kupdate = %d, "
314 "for_reclaim = %d, range_cyclic = %d, writeback_index = %lu",
315 show_root_type(__entry->root_objectid),
316 (unsigned long)__entry->ino, __entry->index,
317 __entry->nr_to_write, __entry->pages_skipped,
318 __entry->range_start, __entry->range_end,
319 __entry->nonblocking, __entry->for_kupdate,
320 __entry->for_reclaim, __entry->range_cyclic,
321 (unsigned long)__entry->writeback_index)
322);
323
324DEFINE_EVENT(btrfs__writepage, __extent_writepage,
325
326 TP_PROTO(struct page *page, struct inode *inode,
327 struct writeback_control *wbc),
328
329 TP_ARGS(page, inode, wbc)
330);
331
332TRACE_EVENT(btrfs_writepage_end_io_hook,
333
334 TP_PROTO(struct page *page, u64 start, u64 end, int uptodate),
335
336 TP_ARGS(page, start, end, uptodate),
337
338 TP_STRUCT__entry(
339 __field( ino_t, ino )
340 __field( pgoff_t, index )
341 __field( u64, start )
342 __field( u64, end )
343 __field( int, uptodate )
344 __field( u64, root_objectid )
345 ),
346
347 TP_fast_assign(
348 __entry->ino = page->mapping->host->i_ino;
349 __entry->index = page->index;
350 __entry->start = start;
351 __entry->end = end;
352 __entry->uptodate = uptodate;
353 __entry->root_objectid =
354 BTRFS_I(page->mapping->host)->root->root_key.objectid;
355 ),
356
357 TP_printk("root = %llu(%s), ino = %lu, page_index = %lu, start = %llu, "
358 "end = %llu, uptodate = %d",
359 show_root_type(__entry->root_objectid),
360 (unsigned long)__entry->ino, (unsigned long)__entry->index,
361 (unsigned long long)__entry->start,
362 (unsigned long long)__entry->end, __entry->uptodate)
363);
364
365TRACE_EVENT(btrfs_sync_file,
366
367 TP_PROTO(struct file *file, int datasync),
368
369 TP_ARGS(file, datasync),
370
371 TP_STRUCT__entry(
372 __field( ino_t, ino )
373 __field( ino_t, parent )
374 __field( int, datasync )
375 __field( u64, root_objectid )
376 ),
377
378 TP_fast_assign(
379 struct dentry *dentry = file->f_path.dentry;
380 struct inode *inode = dentry->d_inode;
381
382 __entry->ino = inode->i_ino;
383 __entry->parent = dentry->d_parent->d_inode->i_ino;
384 __entry->datasync = datasync;
385 __entry->root_objectid =
386 BTRFS_I(inode)->root->root_key.objectid;
387 ),
388
389 TP_printk("root = %llu(%s), ino = %ld, parent = %ld, datasync = %d",
390 show_root_type(__entry->root_objectid),
391 (unsigned long)__entry->ino, (unsigned long)__entry->parent,
392 __entry->datasync)
393);
394
395TRACE_EVENT(btrfs_sync_fs,
396
397 TP_PROTO(int wait),
398
399 TP_ARGS(wait),
400
401 TP_STRUCT__entry(
402 __field( int, wait )
403 ),
404
405 TP_fast_assign(
406 __entry->wait = wait;
407 ),
408
409 TP_printk("wait = %d", __entry->wait)
410);
411
412#define show_ref_action(action) \
413 __print_symbolic(action, \
414 { BTRFS_ADD_DELAYED_REF, "ADD_DELAYED_REF" }, \
415 { BTRFS_DROP_DELAYED_REF, "DROP_DELAYED_REF" }, \
416 { BTRFS_ADD_DELAYED_EXTENT, "ADD_DELAYED_EXTENT" }, \
417 { BTRFS_UPDATE_DELAYED_HEAD, "UPDATE_DELAYED_HEAD" })
418
419
420TRACE_EVENT(btrfs_delayed_tree_ref,
421
422 TP_PROTO(struct btrfs_delayed_ref_node *ref,
423 struct btrfs_delayed_tree_ref *full_ref,
424 int action),
425
426 TP_ARGS(ref, full_ref, action),
427
428 TP_STRUCT__entry(
429 __field( u64, bytenr )
430 __field( u64, num_bytes )
431 __field( int, action )
432 __field( u64, parent )
433 __field( u64, ref_root )
434 __field( int, level )
435 __field( int, type )
436 ),
437
438 TP_fast_assign(
439 __entry->bytenr = ref->bytenr;
440 __entry->num_bytes = ref->num_bytes;
441 __entry->action = action;
442 __entry->parent = full_ref->parent;
443 __entry->ref_root = full_ref->root;
444 __entry->level = full_ref->level;
445 __entry->type = ref->type;
446 ),
447
448 TP_printk("bytenr = %llu, num_bytes = %llu, action = %s, "
449 "parent = %llu(%s), ref_root = %llu(%s), level = %d, "
450 "type = %s",
451 (unsigned long long)__entry->bytenr,
452 (unsigned long long)__entry->num_bytes,
453 show_ref_action(__entry->action),
454 show_root_type(__entry->parent),
455 show_root_type(__entry->ref_root),
456 __entry->level, show_ref_type(__entry->type))
457);
458
459TRACE_EVENT(btrfs_delayed_data_ref,
460
461 TP_PROTO(struct btrfs_delayed_ref_node *ref,
462 struct btrfs_delayed_data_ref *full_ref,
463 int action),
464
465 TP_ARGS(ref, full_ref, action),
466
467 TP_STRUCT__entry(
468 __field( u64, bytenr )
469 __field( u64, num_bytes )
470 __field( int, action )
471 __field( u64, parent )
472 __field( u64, ref_root )
473 __field( u64, owner )
474 __field( u64, offset )
475 __field( int, type )
476 ),
477
478 TP_fast_assign(
479 __entry->bytenr = ref->bytenr;
480 __entry->num_bytes = ref->num_bytes;
481 __entry->action = action;
482 __entry->parent = full_ref->parent;
483 __entry->ref_root = full_ref->root;
484 __entry->owner = full_ref->objectid;
485 __entry->offset = full_ref->offset;
486 __entry->type = ref->type;
487 ),
488
489 TP_printk("bytenr = %llu, num_bytes = %llu, action = %s, "
490 "parent = %llu(%s), ref_root = %llu(%s), owner = %llu, "
491 "offset = %llu, type = %s",
492 (unsigned long long)__entry->bytenr,
493 (unsigned long long)__entry->num_bytes,
494 show_ref_action(__entry->action),
495 show_root_type(__entry->parent),
496 show_root_type(__entry->ref_root),
497 (unsigned long long)__entry->owner,
498 (unsigned long long)__entry->offset,
499 show_ref_type(__entry->type))
500);
501
502TRACE_EVENT(btrfs_delayed_ref_head,
503
504 TP_PROTO(struct btrfs_delayed_ref_node *ref,
505 struct btrfs_delayed_ref_head *head_ref,
506 int action),
507
508 TP_ARGS(ref, head_ref, action),
509
510 TP_STRUCT__entry(
511 __field( u64, bytenr )
512 __field( u64, num_bytes )
513 __field( int, action )
514 __field( int, is_data )
515 ),
516
517 TP_fast_assign(
518 __entry->bytenr = ref->bytenr;
519 __entry->num_bytes = ref->num_bytes;
520 __entry->action = action;
521 __entry->is_data = head_ref->is_data;
522 ),
523
524 TP_printk("bytenr = %llu, num_bytes = %llu, action = %s, is_data = %d",
525 (unsigned long long)__entry->bytenr,
526 (unsigned long long)__entry->num_bytes,
527 show_ref_action(__entry->action),
528 __entry->is_data)
529);
530
531#define show_chunk_type(type) \
532 __print_flags(type, "|", \
533 { BTRFS_BLOCK_GROUP_DATA, "DATA" }, \
534 { BTRFS_BLOCK_GROUP_SYSTEM, "SYSTEM"}, \
535 { BTRFS_BLOCK_GROUP_METADATA, "METADATA"}, \
536 { BTRFS_BLOCK_GROUP_RAID0, "RAID0" }, \
537 { BTRFS_BLOCK_GROUP_RAID1, "RAID1" }, \
538 { BTRFS_BLOCK_GROUP_DUP, "DUP" }, \
539 { BTRFS_BLOCK_GROUP_RAID10, "RAID10"})
540
541DECLARE_EVENT_CLASS(btrfs__chunk,
542
543 TP_PROTO(struct btrfs_root *root, struct map_lookup *map,
544 u64 offset, u64 size),
545
546 TP_ARGS(root, map, offset, size),
547
548 TP_STRUCT__entry(
549 __field( int, num_stripes )
550 __field( u64, type )
551 __field( int, sub_stripes )
552 __field( u64, offset )
553 __field( u64, size )
554 __field( u64, root_objectid )
555 ),
556
557 TP_fast_assign(
558 __entry->num_stripes = map->num_stripes;
559 __entry->type = map->type;
560 __entry->sub_stripes = map->sub_stripes;
561 __entry->offset = offset;
562 __entry->size = size;
563 __entry->root_objectid = root->root_key.objectid;
564 ),
565
566 TP_printk("root = %llu(%s), offset = %llu, size = %llu, "
567 "num_stripes = %d, sub_stripes = %d, type = %s",
568 show_root_type(__entry->root_objectid),
569 (unsigned long long)__entry->offset,
570 (unsigned long long)__entry->size,
571 __entry->num_stripes, __entry->sub_stripes,
572 show_chunk_type(__entry->type))
573);
574
575DEFINE_EVENT(btrfs__chunk, btrfs_chunk_alloc,
576
577 TP_PROTO(struct btrfs_root *root, struct map_lookup *map,
578 u64 offset, u64 size),
579
580 TP_ARGS(root, map, offset, size)
581);
582
583DEFINE_EVENT(btrfs__chunk, btrfs_chunk_free,
584
585 TP_PROTO(struct btrfs_root *root, struct map_lookup *map,
586 u64 offset, u64 size),
587
588 TP_ARGS(root, map, offset, size)
589);
590
591TRACE_EVENT(btrfs_cow_block,
592
593 TP_PROTO(struct btrfs_root *root, struct extent_buffer *buf,
594 struct extent_buffer *cow),
595
596 TP_ARGS(root, buf, cow),
597
598 TP_STRUCT__entry(
599 __field( u64, root_objectid )
600 __field( u64, buf_start )
601 __field( int, refs )
602 __field( u64, cow_start )
603 __field( int, buf_level )
604 __field( int, cow_level )
605 ),
606
607 TP_fast_assign(
608 __entry->root_objectid = root->root_key.objectid;
609 __entry->buf_start = buf->start;
610 __entry->refs = atomic_read(&buf->refs);
611 __entry->cow_start = cow->start;
612 __entry->buf_level = btrfs_header_level(buf);
613 __entry->cow_level = btrfs_header_level(cow);
614 ),
615
616 TP_printk("root = %llu(%s), refs = %d, orig_buf = %llu "
617 "(orig_level = %d), cow_buf = %llu (cow_level = %d)",
618 show_root_type(__entry->root_objectid),
619 __entry->refs,
620 (unsigned long long)__entry->buf_start,
621 __entry->buf_level,
622 (unsigned long long)__entry->cow_start,
623 __entry->cow_level)
624);
625
626DECLARE_EVENT_CLASS(btrfs__reserved_extent,
627
628 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
629
630 TP_ARGS(root, start, len),
631
632 TP_STRUCT__entry(
633 __field( u64, root_objectid )
634 __field( u64, start )
635 __field( u64, len )
636 ),
637
638 TP_fast_assign(
639 __entry->root_objectid = root->root_key.objectid;
640 __entry->start = start;
641 __entry->len = len;
642 ),
643
644 TP_printk("root = %llu(%s), start = %llu, len = %llu",
645 show_root_type(__entry->root_objectid),
646 (unsigned long long)__entry->start,
647 (unsigned long long)__entry->len)
648);
649
650DEFINE_EVENT(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
651
652 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
653
654 TP_ARGS(root, start, len)
655);
656
657DEFINE_EVENT(btrfs__reserved_extent, btrfs_reserved_extent_free,
658
659 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
660
661 TP_ARGS(root, start, len)
662);
663
664#endif /* _TRACE_BTRFS_H */
665
666/* This part must be outside protection */
667#include <trace/define_trace.h>
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index e5e345fb2a5c..e09592d2f916 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -21,8 +21,7 @@ TRACE_EVENT(ext4_free_inode,
21 TP_ARGS(inode), 21 TP_ARGS(inode),
22 22
23 TP_STRUCT__entry( 23 TP_STRUCT__entry(
24 __field( int, dev_major ) 24 __field( dev_t, dev )
25 __field( int, dev_minor )
26 __field( ino_t, ino ) 25 __field( ino_t, ino )
27 __field( umode_t, mode ) 26 __field( umode_t, mode )
28 __field( uid_t, uid ) 27 __field( uid_t, uid )
@@ -31,8 +30,7 @@ TRACE_EVENT(ext4_free_inode,
31 ), 30 ),
32 31
33 TP_fast_assign( 32 TP_fast_assign(
34 __entry->dev_major = MAJOR(inode->i_sb->s_dev); 33 __entry->dev = inode->i_sb->s_dev;
35 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
36 __entry->ino = inode->i_ino; 34 __entry->ino = inode->i_ino;
37 __entry->mode = inode->i_mode; 35 __entry->mode = inode->i_mode;
38 __entry->uid = inode->i_uid; 36 __entry->uid = inode->i_uid;
@@ -41,9 +39,9 @@ TRACE_EVENT(ext4_free_inode,
41 ), 39 ),
42 40
43 TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %llu", 41 TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %llu",
44 __entry->dev_major, __entry->dev_minor, 42 MAJOR(__entry->dev), MINOR(__entry->dev),
45 (unsigned long) __entry->ino, __entry->mode, 43 (unsigned long) __entry->ino,
46 __entry->uid, __entry->gid, 44 __entry->mode, __entry->uid, __entry->gid,
47 (unsigned long long) __entry->blocks) 45 (unsigned long long) __entry->blocks)
48); 46);
49 47
@@ -53,21 +51,19 @@ TRACE_EVENT(ext4_request_inode,
53 TP_ARGS(dir, mode), 51 TP_ARGS(dir, mode),
54 52
55 TP_STRUCT__entry( 53 TP_STRUCT__entry(
56 __field( int, dev_major ) 54 __field( dev_t, dev )
57 __field( int, dev_minor )
58 __field( ino_t, dir ) 55 __field( ino_t, dir )
59 __field( umode_t, mode ) 56 __field( umode_t, mode )
60 ), 57 ),
61 58
62 TP_fast_assign( 59 TP_fast_assign(
63 __entry->dev_major = MAJOR(dir->i_sb->s_dev); 60 __entry->dev = dir->i_sb->s_dev;
64 __entry->dev_minor = MINOR(dir->i_sb->s_dev);
65 __entry->dir = dir->i_ino; 61 __entry->dir = dir->i_ino;
66 __entry->mode = mode; 62 __entry->mode = mode;
67 ), 63 ),
68 64
69 TP_printk("dev %d,%d dir %lu mode 0%o", 65 TP_printk("dev %d,%d dir %lu mode 0%o",
70 __entry->dev_major, __entry->dev_minor, 66 MAJOR(__entry->dev), MINOR(__entry->dev),
71 (unsigned long) __entry->dir, __entry->mode) 67 (unsigned long) __entry->dir, __entry->mode)
72); 68);
73 69
@@ -77,23 +73,21 @@ TRACE_EVENT(ext4_allocate_inode,
77 TP_ARGS(inode, dir, mode), 73 TP_ARGS(inode, dir, mode),
78 74
79 TP_STRUCT__entry( 75 TP_STRUCT__entry(
80 __field( int, dev_major ) 76 __field( dev_t, dev )
81 __field( int, dev_minor )
82 __field( ino_t, ino ) 77 __field( ino_t, ino )
83 __field( ino_t, dir ) 78 __field( ino_t, dir )
84 __field( umode_t, mode ) 79 __field( umode_t, mode )
85 ), 80 ),
86 81
87 TP_fast_assign( 82 TP_fast_assign(
88 __entry->dev_major = MAJOR(inode->i_sb->s_dev); 83 __entry->dev = inode->i_sb->s_dev;
89 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
90 __entry->ino = inode->i_ino; 84 __entry->ino = inode->i_ino;
91 __entry->dir = dir->i_ino; 85 __entry->dir = dir->i_ino;
92 __entry->mode = mode; 86 __entry->mode = mode;
93 ), 87 ),
94 88
95 TP_printk("dev %d,%d ino %lu dir %lu mode 0%o", 89 TP_printk("dev %d,%d ino %lu dir %lu mode 0%o",
96 __entry->dev_major, __entry->dev_minor, 90 MAJOR(__entry->dev), MINOR(__entry->dev),
97 (unsigned long) __entry->ino, 91 (unsigned long) __entry->ino,
98 (unsigned long) __entry->dir, __entry->mode) 92 (unsigned long) __entry->dir, __entry->mode)
99); 93);
@@ -104,21 +98,19 @@ TRACE_EVENT(ext4_evict_inode,
104 TP_ARGS(inode), 98 TP_ARGS(inode),
105 99
106 TP_STRUCT__entry( 100 TP_STRUCT__entry(
107 __field( int, dev_major ) 101 __field( dev_t, dev )
108 __field( int, dev_minor )
109 __field( ino_t, ino ) 102 __field( ino_t, ino )
110 __field( int, nlink ) 103 __field( int, nlink )
111 ), 104 ),
112 105
113 TP_fast_assign( 106 TP_fast_assign(
114 __entry->dev_major = MAJOR(inode->i_sb->s_dev); 107 __entry->dev = inode->i_sb->s_dev;
115 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
116 __entry->ino = inode->i_ino; 108 __entry->ino = inode->i_ino;
117 __entry->nlink = inode->i_nlink; 109 __entry->nlink = inode->i_nlink;
118 ), 110 ),
119 111
120 TP_printk("dev %d,%d ino %lu nlink %d", 112 TP_printk("dev %d,%d ino %lu nlink %d",
121 __entry->dev_major, __entry->dev_minor, 113 MAJOR(__entry->dev), MINOR(__entry->dev),
122 (unsigned long) __entry->ino, __entry->nlink) 114 (unsigned long) __entry->ino, __entry->nlink)
123); 115);
124 116
@@ -128,21 +120,19 @@ TRACE_EVENT(ext4_drop_inode,
128 TP_ARGS(inode, drop), 120 TP_ARGS(inode, drop),
129 121
130 TP_STRUCT__entry( 122 TP_STRUCT__entry(
131 __field( int, dev_major ) 123 __field( dev_t, dev )
132 __field( int, dev_minor )
133 __field( ino_t, ino ) 124 __field( ino_t, ino )
134 __field( int, drop ) 125 __field( int, drop )
135 ), 126 ),
136 127
137 TP_fast_assign( 128 TP_fast_assign(
138 __entry->dev_major = MAJOR(inode->i_sb->s_dev); 129 __entry->dev = inode->i_sb->s_dev;
139 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
140 __entry->ino = inode->i_ino; 130 __entry->ino = inode->i_ino;
141 __entry->drop = drop; 131 __entry->drop = drop;
142 ), 132 ),
143 133
144 TP_printk("dev %d,%d ino %lu drop %d", 134 TP_printk("dev %d,%d ino %lu drop %d",
145 __entry->dev_major, __entry->dev_minor, 135 MAJOR(__entry->dev), MINOR(__entry->dev),
146 (unsigned long) __entry->ino, __entry->drop) 136 (unsigned long) __entry->ino, __entry->drop)
147); 137);
148 138
@@ -152,21 +142,19 @@ TRACE_EVENT(ext4_mark_inode_dirty,
152 TP_ARGS(inode, IP), 142 TP_ARGS(inode, IP),
153 143
154 TP_STRUCT__entry( 144 TP_STRUCT__entry(
155 __field( int, dev_major ) 145 __field( dev_t, dev )
156 __field( int, dev_minor )
157 __field( ino_t, ino ) 146 __field( ino_t, ino )
158 __field(unsigned long, ip ) 147 __field(unsigned long, ip )
159 ), 148 ),
160 149
161 TP_fast_assign( 150 TP_fast_assign(
162 __entry->dev_major = MAJOR(inode->i_sb->s_dev); 151 __entry->dev = inode->i_sb->s_dev;
163 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
164 __entry->ino = inode->i_ino; 152 __entry->ino = inode->i_ino;
165 __entry->ip = IP; 153 __entry->ip = IP;
166 ), 154 ),
167 155
168 TP_printk("dev %d,%d ino %lu caller %pF", 156 TP_printk("dev %d,%d ino %lu caller %pF",
169 __entry->dev_major, __entry->dev_minor, 157 MAJOR(__entry->dev), MINOR(__entry->dev),
170 (unsigned long) __entry->ino, (void *)__entry->ip) 158 (unsigned long) __entry->ino, (void *)__entry->ip)
171); 159);
172 160
@@ -176,21 +164,19 @@ TRACE_EVENT(ext4_begin_ordered_truncate,
176 TP_ARGS(inode, new_size), 164 TP_ARGS(inode, new_size),
177 165
178 TP_STRUCT__entry( 166 TP_STRUCT__entry(
179 __field( int, dev_major ) 167 __field( dev_t, dev )
180 __field( int, dev_minor )
181 __field( ino_t, ino ) 168 __field( ino_t, ino )
182 __field( loff_t, new_size ) 169 __field( loff_t, new_size )
183 ), 170 ),
184 171
185 TP_fast_assign( 172 TP_fast_assign(
186 __entry->dev_major = MAJOR(inode->i_sb->s_dev); 173 __entry->dev = inode->i_sb->s_dev;
187 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
188 __entry->ino = inode->i_ino; 174 __entry->ino = inode->i_ino;
189 __entry->new_size = new_size; 175 __entry->new_size = new_size;
190 ), 176 ),
191 177
192 TP_printk("dev %d,%d ino %lu new_size %lld", 178 TP_printk("dev %d,%d ino %lu new_size %lld",
193 __entry->dev_major, __entry->dev_minor, 179 MAJOR(__entry->dev), MINOR(__entry->dev),
194 (unsigned long) __entry->ino, 180 (unsigned long) __entry->ino,
195 (long long) __entry->new_size) 181 (long long) __entry->new_size)
196); 182);
@@ -203,8 +189,7 @@ DECLARE_EVENT_CLASS(ext4__write_begin,
203 TP_ARGS(inode, pos, len, flags), 189 TP_ARGS(inode, pos, len, flags),
204 190
205 TP_STRUCT__entry( 191 TP_STRUCT__entry(
206 __field( int, dev_major ) 192 __field( dev_t, dev )
207 __field( int, dev_minor )
208 __field( ino_t, ino ) 193 __field( ino_t, ino )
209 __field( loff_t, pos ) 194 __field( loff_t, pos )
210 __field( unsigned int, len ) 195 __field( unsigned int, len )
@@ -212,8 +197,7 @@ DECLARE_EVENT_CLASS(ext4__write_begin,
212 ), 197 ),
213 198
214 TP_fast_assign( 199 TP_fast_assign(
215 __entry->dev_major = MAJOR(inode->i_sb->s_dev); 200 __entry->dev = inode->i_sb->s_dev;
216 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
217 __entry->ino = inode->i_ino; 201 __entry->ino = inode->i_ino;
218 __entry->pos = pos; 202 __entry->pos = pos;
219 __entry->len = len; 203 __entry->len = len;
@@ -221,7 +205,7 @@ DECLARE_EVENT_CLASS(ext4__write_begin,
221 ), 205 ),
222 206
223 TP_printk("dev %d,%d ino %lu pos %llu len %u flags %u", 207 TP_printk("dev %d,%d ino %lu pos %llu len %u flags %u",
224 __entry->dev_major, __entry->dev_minor, 208 MAJOR(__entry->dev), MINOR(__entry->dev),
225 (unsigned long) __entry->ino, 209 (unsigned long) __entry->ino,
226 __entry->pos, __entry->len, __entry->flags) 210 __entry->pos, __entry->len, __entry->flags)
227); 211);
@@ -249,8 +233,7 @@ DECLARE_EVENT_CLASS(ext4__write_end,
249 TP_ARGS(inode, pos, len, copied), 233 TP_ARGS(inode, pos, len, copied),
250 234
251 TP_STRUCT__entry( 235 TP_STRUCT__entry(
252 __field( int, dev_major ) 236 __field( dev_t, dev )
253 __field( int, dev_minor )
254 __field( ino_t, ino ) 237 __field( ino_t, ino )
255 __field( loff_t, pos ) 238 __field( loff_t, pos )
256 __field( unsigned int, len ) 239 __field( unsigned int, len )
@@ -258,8 +241,7 @@ DECLARE_EVENT_CLASS(ext4__write_end,
258 ), 241 ),
259 242
260 TP_fast_assign( 243 TP_fast_assign(
261 __entry->dev_major = MAJOR(inode->i_sb->s_dev); 244 __entry->dev = inode->i_sb->s_dev;
262 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
263 __entry->ino = inode->i_ino; 245 __entry->ino = inode->i_ino;
264 __entry->pos = pos; 246 __entry->pos = pos;
265 __entry->len = len; 247 __entry->len = len;
@@ -267,9 +249,9 @@ DECLARE_EVENT_CLASS(ext4__write_end,
267 ), 249 ),
268 250
269 TP_printk("dev %d,%d ino %lu pos %llu len %u copied %u", 251 TP_printk("dev %d,%d ino %lu pos %llu len %u copied %u",
270 __entry->dev_major, __entry->dev_minor, 252 MAJOR(__entry->dev), MINOR(__entry->dev),
271 (unsigned long) __entry->ino, __entry->pos, 253 (unsigned long) __entry->ino,
272 __entry->len, __entry->copied) 254 __entry->pos, __entry->len, __entry->copied)
273); 255);
274 256
275DEFINE_EVENT(ext4__write_end, ext4_ordered_write_end, 257DEFINE_EVENT(ext4__write_end, ext4_ordered_write_end,
@@ -310,22 +292,20 @@ TRACE_EVENT(ext4_writepage,
310 TP_ARGS(inode, page), 292 TP_ARGS(inode, page),
311 293
312 TP_STRUCT__entry( 294 TP_STRUCT__entry(
313 __field( int, dev_major ) 295 __field( dev_t, dev )
314 __field( int, dev_minor )
315 __field( ino_t, ino ) 296 __field( ino_t, ino )
316 __field( pgoff_t, index ) 297 __field( pgoff_t, index )
317 298
318 ), 299 ),
319 300
320 TP_fast_assign( 301 TP_fast_assign(
321 __entry->dev_major = MAJOR(inode->i_sb->s_dev); 302 __entry->dev = inode->i_sb->s_dev;
322 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
323 __entry->ino = inode->i_ino; 303 __entry->ino = inode->i_ino;
324 __entry->index = page->index; 304 __entry->index = page->index;
325 ), 305 ),
326 306
327 TP_printk("dev %d,%d ino %lu page_index %lu", 307 TP_printk("dev %d,%d ino %lu page_index %lu",
328 __entry->dev_major, __entry->dev_minor, 308 MAJOR(__entry->dev), MINOR(__entry->dev),
329 (unsigned long) __entry->ino, __entry->index) 309 (unsigned long) __entry->ino, __entry->index)
330); 310);
331 311
@@ -335,43 +315,39 @@ TRACE_EVENT(ext4_da_writepages,
335 TP_ARGS(inode, wbc), 315 TP_ARGS(inode, wbc),
336 316
337 TP_STRUCT__entry( 317 TP_STRUCT__entry(
338 __field( int, dev_major ) 318 __field( dev_t, dev )
339 __field( int, dev_minor )
340 __field( ino_t, ino ) 319 __field( ino_t, ino )
341 __field( long, nr_to_write ) 320 __field( long, nr_to_write )
342 __field( long, pages_skipped ) 321 __field( long, pages_skipped )
343 __field( loff_t, range_start ) 322 __field( loff_t, range_start )
344 __field( loff_t, range_end ) 323 __field( loff_t, range_end )
324 __field( int, sync_mode )
345 __field( char, for_kupdate ) 325 __field( char, for_kupdate )
346 __field( char, for_reclaim )
347 __field( char, range_cyclic ) 326 __field( char, range_cyclic )
348 __field( pgoff_t, writeback_index ) 327 __field( pgoff_t, writeback_index )
349 ), 328 ),
350 329
351 TP_fast_assign( 330 TP_fast_assign(
352 __entry->dev_major = MAJOR(inode->i_sb->s_dev); 331 __entry->dev = inode->i_sb->s_dev;
353 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
354 __entry->ino = inode->i_ino; 332 __entry->ino = inode->i_ino;
355 __entry->nr_to_write = wbc->nr_to_write; 333 __entry->nr_to_write = wbc->nr_to_write;
356 __entry->pages_skipped = wbc->pages_skipped; 334 __entry->pages_skipped = wbc->pages_skipped;
357 __entry->range_start = wbc->range_start; 335 __entry->range_start = wbc->range_start;
358 __entry->range_end = wbc->range_end; 336 __entry->range_end = wbc->range_end;
337 __entry->sync_mode = wbc->sync_mode;
359 __entry->for_kupdate = wbc->for_kupdate; 338 __entry->for_kupdate = wbc->for_kupdate;
360 __entry->for_reclaim = wbc->for_reclaim;
361 __entry->range_cyclic = wbc->range_cyclic; 339 __entry->range_cyclic = wbc->range_cyclic;
362 __entry->writeback_index = inode->i_mapping->writeback_index; 340 __entry->writeback_index = inode->i_mapping->writeback_index;
363 ), 341 ),
364 342
365 TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld " 343 TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld "
366 "range_start %llu range_end %llu " 344 "range_start %llu range_end %llu sync_mode %d"
367 "for_kupdate %d for_reclaim %d " 345 "for_kupdate %d range_cyclic %d writeback_index %lu",
368 "range_cyclic %d writeback_index %lu", 346 MAJOR(__entry->dev), MINOR(__entry->dev),
369 __entry->dev_major, __entry->dev_minor,
370 (unsigned long) __entry->ino, __entry->nr_to_write, 347 (unsigned long) __entry->ino, __entry->nr_to_write,
371 __entry->pages_skipped, __entry->range_start, 348 __entry->pages_skipped, __entry->range_start,
372 __entry->range_end, 349 __entry->range_end, __entry->sync_mode,
373 __entry->for_kupdate, __entry->for_reclaim, 350 __entry->for_kupdate, __entry->range_cyclic,
374 __entry->range_cyclic,
375 (unsigned long) __entry->writeback_index) 351 (unsigned long) __entry->writeback_index)
376); 352);
377 353
@@ -381,8 +357,7 @@ TRACE_EVENT(ext4_da_write_pages,
381 TP_ARGS(inode, mpd), 357 TP_ARGS(inode, mpd),
382 358
383 TP_STRUCT__entry( 359 TP_STRUCT__entry(
384 __field( int, dev_major ) 360 __field( dev_t, dev )
385 __field( int, dev_minor )
386 __field( ino_t, ino ) 361 __field( ino_t, ino )
387 __field( __u64, b_blocknr ) 362 __field( __u64, b_blocknr )
388 __field( __u32, b_size ) 363 __field( __u32, b_size )
@@ -390,11 +365,11 @@ TRACE_EVENT(ext4_da_write_pages,
390 __field( unsigned long, first_page ) 365 __field( unsigned long, first_page )
391 __field( int, io_done ) 366 __field( int, io_done )
392 __field( int, pages_written ) 367 __field( int, pages_written )
368 __field( int, sync_mode )
393 ), 369 ),
394 370
395 TP_fast_assign( 371 TP_fast_assign(
396 __entry->dev_major = MAJOR(inode->i_sb->s_dev); 372 __entry->dev = inode->i_sb->s_dev;
397 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
398 __entry->ino = inode->i_ino; 373 __entry->ino = inode->i_ino;
399 __entry->b_blocknr = mpd->b_blocknr; 374 __entry->b_blocknr = mpd->b_blocknr;
400 __entry->b_size = mpd->b_size; 375 __entry->b_size = mpd->b_size;
@@ -402,14 +377,18 @@ TRACE_EVENT(ext4_da_write_pages,
402 __entry->first_page = mpd->first_page; 377 __entry->first_page = mpd->first_page;
403 __entry->io_done = mpd->io_done; 378 __entry->io_done = mpd->io_done;
404 __entry->pages_written = mpd->pages_written; 379 __entry->pages_written = mpd->pages_written;
380 __entry->sync_mode = mpd->wbc->sync_mode;
405 ), 381 ),
406 382
407 TP_printk("dev %d,%d ino %lu b_blocknr %llu b_size %u b_state 0x%04x first_page %lu io_done %d pages_written %d", 383 TP_printk("dev %d,%d ino %lu b_blocknr %llu b_size %u b_state 0x%04x "
408 __entry->dev_major, __entry->dev_minor, 384 "first_page %lu io_done %d pages_written %d sync_mode %d",
385 MAJOR(__entry->dev), MINOR(__entry->dev),
409 (unsigned long) __entry->ino, 386 (unsigned long) __entry->ino,
410 __entry->b_blocknr, __entry->b_size, 387 __entry->b_blocknr, __entry->b_size,
411 __entry->b_state, __entry->first_page, 388 __entry->b_state, __entry->first_page,
412 __entry->io_done, __entry->pages_written) 389 __entry->io_done, __entry->pages_written,
390 __entry->sync_mode
391 )
413); 392);
414 393
415TRACE_EVENT(ext4_da_writepages_result, 394TRACE_EVENT(ext4_da_writepages_result,
@@ -419,35 +398,100 @@ TRACE_EVENT(ext4_da_writepages_result,
419 TP_ARGS(inode, wbc, ret, pages_written), 398 TP_ARGS(inode, wbc, ret, pages_written),
420 399
421 TP_STRUCT__entry( 400 TP_STRUCT__entry(
422 __field( int, dev_major ) 401 __field( dev_t, dev )
423 __field( int, dev_minor )
424 __field( ino_t, ino ) 402 __field( ino_t, ino )
425 __field( int, ret ) 403 __field( int, ret )
426 __field( int, pages_written ) 404 __field( int, pages_written )
427 __field( long, pages_skipped ) 405 __field( long, pages_skipped )
406 __field( int, sync_mode )
428 __field( char, more_io ) 407 __field( char, more_io )
429 __field( pgoff_t, writeback_index ) 408 __field( pgoff_t, writeback_index )
430 ), 409 ),
431 410
432 TP_fast_assign( 411 TP_fast_assign(
433 __entry->dev_major = MAJOR(inode->i_sb->s_dev); 412 __entry->dev = inode->i_sb->s_dev;
434 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
435 __entry->ino = inode->i_ino; 413 __entry->ino = inode->i_ino;
436 __entry->ret = ret; 414 __entry->ret = ret;
437 __entry->pages_written = pages_written; 415 __entry->pages_written = pages_written;
438 __entry->pages_skipped = wbc->pages_skipped; 416 __entry->pages_skipped = wbc->pages_skipped;
417 __entry->sync_mode = wbc->sync_mode;
439 __entry->more_io = wbc->more_io; 418 __entry->more_io = wbc->more_io;
440 __entry->writeback_index = inode->i_mapping->writeback_index; 419 __entry->writeback_index = inode->i_mapping->writeback_index;
441 ), 420 ),
442 421
443 TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld more_io %d writeback_index %lu", 422 TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld "
444 __entry->dev_major, __entry->dev_minor, 423 " more_io %d sync_mode %d writeback_index %lu",
424 MAJOR(__entry->dev), MINOR(__entry->dev),
445 (unsigned long) __entry->ino, __entry->ret, 425 (unsigned long) __entry->ino, __entry->ret,
446 __entry->pages_written, __entry->pages_skipped, 426 __entry->pages_written, __entry->pages_skipped,
447 __entry->more_io, 427 __entry->more_io, __entry->sync_mode,
448 (unsigned long) __entry->writeback_index) 428 (unsigned long) __entry->writeback_index)
449); 429);
450 430
431DECLARE_EVENT_CLASS(ext4__page_op,
432 TP_PROTO(struct page *page),
433
434 TP_ARGS(page),
435
436 TP_STRUCT__entry(
437 __field( pgoff_t, index )
438 __field( ino_t, ino )
439 __field( dev_t, dev )
440
441 ),
442
443 TP_fast_assign(
444 __entry->index = page->index;
445 __entry->ino = page->mapping->host->i_ino;
446 __entry->dev = page->mapping->host->i_sb->s_dev;
447 ),
448
449 TP_printk("dev %d,%d ino %lu page_index %lu",
450 MAJOR(__entry->dev), MINOR(__entry->dev),
451 (unsigned long) __entry->ino,
452 __entry->index)
453);
454
455DEFINE_EVENT(ext4__page_op, ext4_readpage,
456
457 TP_PROTO(struct page *page),
458
459 TP_ARGS(page)
460);
461
462DEFINE_EVENT(ext4__page_op, ext4_releasepage,
463
464 TP_PROTO(struct page *page),
465
466 TP_ARGS(page)
467);
468
469TRACE_EVENT(ext4_invalidatepage,
470 TP_PROTO(struct page *page, unsigned long offset),
471
472 TP_ARGS(page, offset),
473
474 TP_STRUCT__entry(
475 __field( pgoff_t, index )
476 __field( unsigned long, offset )
477 __field( ino_t, ino )
478 __field( dev_t, dev )
479
480 ),
481
482 TP_fast_assign(
483 __entry->index = page->index;
484 __entry->offset = offset;
485 __entry->ino = page->mapping->host->i_ino;
486 __entry->dev = page->mapping->host->i_sb->s_dev;
487 ),
488
489 TP_printk("dev %d,%d ino %lu page_index %lu offset %lu",
490 MAJOR(__entry->dev), MINOR(__entry->dev),
491 (unsigned long) __entry->ino,
492 __entry->index, __entry->offset)
493);
494
451TRACE_EVENT(ext4_discard_blocks, 495TRACE_EVENT(ext4_discard_blocks,
452 TP_PROTO(struct super_block *sb, unsigned long long blk, 496 TP_PROTO(struct super_block *sb, unsigned long long blk,
453 unsigned long long count), 497 unsigned long long count),
@@ -455,22 +499,20 @@ TRACE_EVENT(ext4_discard_blocks,
455 TP_ARGS(sb, blk, count), 499 TP_ARGS(sb, blk, count),
456 500
457 TP_STRUCT__entry( 501 TP_STRUCT__entry(
458 __field( int, dev_major ) 502 __field( dev_t, dev )
459 __field( int, dev_minor )
460 __field( __u64, blk ) 503 __field( __u64, blk )
461 __field( __u64, count ) 504 __field( __u64, count )
462 505
463 ), 506 ),
464 507
465 TP_fast_assign( 508 TP_fast_assign(
466 __entry->dev_major = MAJOR(sb->s_dev); 509 __entry->dev = sb->s_dev;
467 __entry->dev_minor = MINOR(sb->s_dev);
468 __entry->blk = blk; 510 __entry->blk = blk;
469 __entry->count = count; 511 __entry->count = count;
470 ), 512 ),
471 513
472 TP_printk("dev %d,%d blk %llu count %llu", 514 TP_printk("dev %d,%d blk %llu count %llu",
473 __entry->dev_major, __entry->dev_minor, 515 MAJOR(__entry->dev), MINOR(__entry->dev),
474 __entry->blk, __entry->count) 516 __entry->blk, __entry->count)
475); 517);
476 518
@@ -481,8 +523,7 @@ DECLARE_EVENT_CLASS(ext4__mb_new_pa,
481 TP_ARGS(ac, pa), 523 TP_ARGS(ac, pa),
482 524
483 TP_STRUCT__entry( 525 TP_STRUCT__entry(
484 __field( int, dev_major ) 526 __field( dev_t, dev )
485 __field( int, dev_minor )
486 __field( ino_t, ino ) 527 __field( ino_t, ino )
487 __field( __u64, pa_pstart ) 528 __field( __u64, pa_pstart )
488 __field( __u32, pa_len ) 529 __field( __u32, pa_len )
@@ -491,8 +532,7 @@ DECLARE_EVENT_CLASS(ext4__mb_new_pa,
491 ), 532 ),
492 533
493 TP_fast_assign( 534 TP_fast_assign(
494 __entry->dev_major = MAJOR(ac->ac_sb->s_dev); 535 __entry->dev = ac->ac_sb->s_dev;
495 __entry->dev_minor = MINOR(ac->ac_sb->s_dev);
496 __entry->ino = ac->ac_inode->i_ino; 536 __entry->ino = ac->ac_inode->i_ino;
497 __entry->pa_pstart = pa->pa_pstart; 537 __entry->pa_pstart = pa->pa_pstart;
498 __entry->pa_len = pa->pa_len; 538 __entry->pa_len = pa->pa_len;
@@ -500,9 +540,9 @@ DECLARE_EVENT_CLASS(ext4__mb_new_pa,
500 ), 540 ),
501 541
502 TP_printk("dev %d,%d ino %lu pstart %llu len %u lstart %llu", 542 TP_printk("dev %d,%d ino %lu pstart %llu len %u lstart %llu",
503 __entry->dev_major, __entry->dev_minor, 543 MAJOR(__entry->dev), MINOR(__entry->dev),
504 (unsigned long) __entry->ino, __entry->pa_pstart, 544 (unsigned long) __entry->ino,
505 __entry->pa_len, __entry->pa_lstart) 545 __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart)
506); 546);
507 547
508DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_inode_pa, 548DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_inode_pa,
@@ -530,8 +570,7 @@ TRACE_EVENT(ext4_mb_release_inode_pa,
530 TP_ARGS(sb, inode, pa, block, count), 570 TP_ARGS(sb, inode, pa, block, count),
531 571
532 TP_STRUCT__entry( 572 TP_STRUCT__entry(
533 __field( int, dev_major ) 573 __field( dev_t, dev )
534 __field( int, dev_minor )
535 __field( ino_t, ino ) 574 __field( ino_t, ino )
536 __field( __u64, block ) 575 __field( __u64, block )
537 __field( __u32, count ) 576 __field( __u32, count )
@@ -539,16 +578,16 @@ TRACE_EVENT(ext4_mb_release_inode_pa,
539 ), 578 ),
540 579
541 TP_fast_assign( 580 TP_fast_assign(
542 __entry->dev_major = MAJOR(sb->s_dev); 581 __entry->dev = sb->s_dev;
543 __entry->dev_minor = MINOR(sb->s_dev);
544 __entry->ino = inode->i_ino; 582 __entry->ino = inode->i_ino;
545 __entry->block = block; 583 __entry->block = block;
546 __entry->count = count; 584 __entry->count = count;
547 ), 585 ),
548 586
549 TP_printk("dev %d,%d ino %lu block %llu count %u", 587 TP_printk("dev %d,%d ino %lu block %llu count %u",
550 __entry->dev_major, __entry->dev_minor, 588 MAJOR(__entry->dev), MINOR(__entry->dev),
551 (unsigned long) __entry->ino, __entry->block, __entry->count) 589 (unsigned long) __entry->ino,
590 __entry->block, __entry->count)
552); 591);
553 592
554TRACE_EVENT(ext4_mb_release_group_pa, 593TRACE_EVENT(ext4_mb_release_group_pa,
@@ -558,22 +597,20 @@ TRACE_EVENT(ext4_mb_release_group_pa,
558 TP_ARGS(sb, pa), 597 TP_ARGS(sb, pa),
559 598
560 TP_STRUCT__entry( 599 TP_STRUCT__entry(
561 __field( int, dev_major ) 600 __field( dev_t, dev )
562 __field( int, dev_minor )
563 __field( __u64, pa_pstart ) 601 __field( __u64, pa_pstart )
564 __field( __u32, pa_len ) 602 __field( __u32, pa_len )
565 603
566 ), 604 ),
567 605
568 TP_fast_assign( 606 TP_fast_assign(
569 __entry->dev_major = MAJOR(sb->s_dev); 607 __entry->dev = sb->s_dev;
570 __entry->dev_minor = MINOR(sb->s_dev);
571 __entry->pa_pstart = pa->pa_pstart; 608 __entry->pa_pstart = pa->pa_pstart;
572 __entry->pa_len = pa->pa_len; 609 __entry->pa_len = pa->pa_len;
573 ), 610 ),
574 611
575 TP_printk("dev %d,%d pstart %llu len %u", 612 TP_printk("dev %d,%d pstart %llu len %u",
576 __entry->dev_major, __entry->dev_minor, 613 MAJOR(__entry->dev), MINOR(__entry->dev),
577 __entry->pa_pstart, __entry->pa_len) 614 __entry->pa_pstart, __entry->pa_len)
578); 615);
579 616
@@ -583,20 +620,18 @@ TRACE_EVENT(ext4_discard_preallocations,
583 TP_ARGS(inode), 620 TP_ARGS(inode),
584 621
585 TP_STRUCT__entry( 622 TP_STRUCT__entry(
586 __field( int, dev_major ) 623 __field( dev_t, dev )
587 __field( int, dev_minor )
588 __field( ino_t, ino ) 624 __field( ino_t, ino )
589 625
590 ), 626 ),
591 627
592 TP_fast_assign( 628 TP_fast_assign(
593 __entry->dev_major = MAJOR(inode->i_sb->s_dev); 629 __entry->dev = inode->i_sb->s_dev;
594 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
595 __entry->ino = inode->i_ino; 630 __entry->ino = inode->i_ino;
596 ), 631 ),
597 632
598 TP_printk("dev %d,%d ino %lu", 633 TP_printk("dev %d,%d ino %lu",
599 __entry->dev_major, __entry->dev_minor, 634 MAJOR(__entry->dev), MINOR(__entry->dev),
600 (unsigned long) __entry->ino) 635 (unsigned long) __entry->ino)
601); 636);
602 637
@@ -606,20 +641,19 @@ TRACE_EVENT(ext4_mb_discard_preallocations,
606 TP_ARGS(sb, needed), 641 TP_ARGS(sb, needed),
607 642
608 TP_STRUCT__entry( 643 TP_STRUCT__entry(
609 __field( int, dev_major ) 644 __field( dev_t, dev )
610 __field( int, dev_minor )
611 __field( int, needed ) 645 __field( int, needed )
612 646
613 ), 647 ),
614 648
615 TP_fast_assign( 649 TP_fast_assign(
616 __entry->dev_major = MAJOR(sb->s_dev); 650 __entry->dev = sb->s_dev;
617 __entry->dev_minor = MINOR(sb->s_dev);
618 __entry->needed = needed; 651 __entry->needed = needed;
619 ), 652 ),
620 653
621 TP_printk("dev %d,%d needed %d", 654 TP_printk("dev %d,%d needed %d",
622 __entry->dev_major, __entry->dev_minor, __entry->needed) 655 MAJOR(__entry->dev), MINOR(__entry->dev),
656 __entry->needed)
623); 657);
624 658
625TRACE_EVENT(ext4_request_blocks, 659TRACE_EVENT(ext4_request_blocks,
@@ -628,8 +662,7 @@ TRACE_EVENT(ext4_request_blocks,
628 TP_ARGS(ar), 662 TP_ARGS(ar),
629 663
630 TP_STRUCT__entry( 664 TP_STRUCT__entry(
631 __field( int, dev_major ) 665 __field( dev_t, dev )
632 __field( int, dev_minor )
633 __field( ino_t, ino ) 666 __field( ino_t, ino )
634 __field( unsigned int, flags ) 667 __field( unsigned int, flags )
635 __field( unsigned int, len ) 668 __field( unsigned int, len )
@@ -642,8 +675,7 @@ TRACE_EVENT(ext4_request_blocks,
642 ), 675 ),
643 676
644 TP_fast_assign( 677 TP_fast_assign(
645 __entry->dev_major = MAJOR(ar->inode->i_sb->s_dev); 678 __entry->dev = ar->inode->i_sb->s_dev;
646 __entry->dev_minor = MINOR(ar->inode->i_sb->s_dev);
647 __entry->ino = ar->inode->i_ino; 679 __entry->ino = ar->inode->i_ino;
648 __entry->flags = ar->flags; 680 __entry->flags = ar->flags;
649 __entry->len = ar->len; 681 __entry->len = ar->len;
@@ -655,8 +687,9 @@ TRACE_EVENT(ext4_request_blocks,
655 __entry->pright = ar->pright; 687 __entry->pright = ar->pright;
656 ), 688 ),
657 689
658 TP_printk("dev %d,%d ino %lu flags %u len %u lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ", 690 TP_printk("dev %d,%d ino %lu flags %u len %u lblk %llu goal %llu "
659 __entry->dev_major, __entry->dev_minor, 691 "lleft %llu lright %llu pleft %llu pright %llu ",
692 MAJOR(__entry->dev), MINOR(__entry->dev),
660 (unsigned long) __entry->ino, 693 (unsigned long) __entry->ino,
661 __entry->flags, __entry->len, 694 __entry->flags, __entry->len,
662 (unsigned long long) __entry->logical, 695 (unsigned long long) __entry->logical,
@@ -673,8 +706,7 @@ TRACE_EVENT(ext4_allocate_blocks,
673 TP_ARGS(ar, block), 706 TP_ARGS(ar, block),
674 707
675 TP_STRUCT__entry( 708 TP_STRUCT__entry(
676 __field( int, dev_major ) 709 __field( dev_t, dev )
677 __field( int, dev_minor )
678 __field( ino_t, ino ) 710 __field( ino_t, ino )
679 __field( __u64, block ) 711 __field( __u64, block )
680 __field( unsigned int, flags ) 712 __field( unsigned int, flags )
@@ -688,8 +720,7 @@ TRACE_EVENT(ext4_allocate_blocks,
688 ), 720 ),
689 721
690 TP_fast_assign( 722 TP_fast_assign(
691 __entry->dev_major = MAJOR(ar->inode->i_sb->s_dev); 723 __entry->dev = ar->inode->i_sb->s_dev;
692 __entry->dev_minor = MINOR(ar->inode->i_sb->s_dev);
693 __entry->ino = ar->inode->i_ino; 724 __entry->ino = ar->inode->i_ino;
694 __entry->block = block; 725 __entry->block = block;
695 __entry->flags = ar->flags; 726 __entry->flags = ar->flags;
@@ -702,10 +733,11 @@ TRACE_EVENT(ext4_allocate_blocks,
702 __entry->pright = ar->pright; 733 __entry->pright = ar->pright;
703 ), 734 ),
704 735
705 TP_printk("dev %d,%d ino %lu flags %u len %u block %llu lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ", 736 TP_printk("dev %d,%d ino %lu flags %u len %u block %llu lblk %llu "
706 __entry->dev_major, __entry->dev_minor, 737 "goal %llu lleft %llu lright %llu pleft %llu pright %llu",
707 (unsigned long) __entry->ino, __entry->flags, 738 MAJOR(__entry->dev), MINOR(__entry->dev),
708 __entry->len, __entry->block, 739 (unsigned long) __entry->ino,
740 __entry->flags, __entry->len, __entry->block,
709 (unsigned long long) __entry->logical, 741 (unsigned long long) __entry->logical,
710 (unsigned long long) __entry->goal, 742 (unsigned long long) __entry->goal,
711 (unsigned long long) __entry->lleft, 743 (unsigned long long) __entry->lleft,
@@ -721,8 +753,7 @@ TRACE_EVENT(ext4_free_blocks,
721 TP_ARGS(inode, block, count, flags), 753 TP_ARGS(inode, block, count, flags),
722 754
723 TP_STRUCT__entry( 755 TP_STRUCT__entry(
724 __field( int, dev_major ) 756 __field( dev_t, dev )
725 __field( int, dev_minor )
726 __field( ino_t, ino ) 757 __field( ino_t, ino )
727 __field( umode_t, mode ) 758 __field( umode_t, mode )
728 __field( __u64, block ) 759 __field( __u64, block )
@@ -731,8 +762,7 @@ TRACE_EVENT(ext4_free_blocks,
731 ), 762 ),
732 763
733 TP_fast_assign( 764 TP_fast_assign(
734 __entry->dev_major = MAJOR(inode->i_sb->s_dev); 765 __entry->dev = inode->i_sb->s_dev;
735 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
736 __entry->ino = inode->i_ino; 766 __entry->ino = inode->i_ino;
737 __entry->mode = inode->i_mode; 767 __entry->mode = inode->i_mode;
738 __entry->block = block; 768 __entry->block = block;
@@ -741,20 +771,19 @@ TRACE_EVENT(ext4_free_blocks,
741 ), 771 ),
742 772
743 TP_printk("dev %d,%d ino %lu mode 0%o block %llu count %lu flags %d", 773 TP_printk("dev %d,%d ino %lu mode 0%o block %llu count %lu flags %d",
744 __entry->dev_major, __entry->dev_minor, 774 MAJOR(__entry->dev), MINOR(__entry->dev),
745 (unsigned long) __entry->ino, 775 (unsigned long) __entry->ino,
746 __entry->mode, __entry->block, __entry->count, 776 __entry->mode, __entry->block, __entry->count,
747 __entry->flags) 777 __entry->flags)
748); 778);
749 779
750TRACE_EVENT(ext4_sync_file, 780TRACE_EVENT(ext4_sync_file_enter,
751 TP_PROTO(struct file *file, int datasync), 781 TP_PROTO(struct file *file, int datasync),
752 782
753 TP_ARGS(file, datasync), 783 TP_ARGS(file, datasync),
754 784
755 TP_STRUCT__entry( 785 TP_STRUCT__entry(
756 __field( int, dev_major ) 786 __field( dev_t, dev )
757 __field( int, dev_minor )
758 __field( ino_t, ino ) 787 __field( ino_t, ino )
759 __field( ino_t, parent ) 788 __field( ino_t, parent )
760 __field( int, datasync ) 789 __field( int, datasync )
@@ -763,39 +792,60 @@ TRACE_EVENT(ext4_sync_file,
763 TP_fast_assign( 792 TP_fast_assign(
764 struct dentry *dentry = file->f_path.dentry; 793 struct dentry *dentry = file->f_path.dentry;
765 794
766 __entry->dev_major = MAJOR(dentry->d_inode->i_sb->s_dev); 795 __entry->dev = dentry->d_inode->i_sb->s_dev;
767 __entry->dev_minor = MINOR(dentry->d_inode->i_sb->s_dev);
768 __entry->ino = dentry->d_inode->i_ino; 796 __entry->ino = dentry->d_inode->i_ino;
769 __entry->datasync = datasync; 797 __entry->datasync = datasync;
770 __entry->parent = dentry->d_parent->d_inode->i_ino; 798 __entry->parent = dentry->d_parent->d_inode->i_ino;
771 ), 799 ),
772 800
773 TP_printk("dev %d,%d ino %ld parent %ld datasync %d ", 801 TP_printk("dev %d,%d ino %ld parent %ld datasync %d ",
774 __entry->dev_major, __entry->dev_minor, 802 MAJOR(__entry->dev), MINOR(__entry->dev),
775 (unsigned long) __entry->ino, 803 (unsigned long) __entry->ino,
776 (unsigned long) __entry->parent, __entry->datasync) 804 (unsigned long) __entry->parent, __entry->datasync)
777); 805);
778 806
807TRACE_EVENT(ext4_sync_file_exit,
808 TP_PROTO(struct inode *inode, int ret),
809
810 TP_ARGS(inode, ret),
811
812 TP_STRUCT__entry(
813 __field( int, ret )
814 __field( ino_t, ino )
815 __field( dev_t, dev )
816 ),
817
818 TP_fast_assign(
819 __entry->ret = ret;
820 __entry->ino = inode->i_ino;
821 __entry->dev = inode->i_sb->s_dev;
822 ),
823
824 TP_printk("dev %d,%d ino %ld ret %d",
825 MAJOR(__entry->dev), MINOR(__entry->dev),
826 (unsigned long) __entry->ino,
827 __entry->ret)
828);
829
779TRACE_EVENT(ext4_sync_fs, 830TRACE_EVENT(ext4_sync_fs,
780 TP_PROTO(struct super_block *sb, int wait), 831 TP_PROTO(struct super_block *sb, int wait),
781 832
782 TP_ARGS(sb, wait), 833 TP_ARGS(sb, wait),
783 834
784 TP_STRUCT__entry( 835 TP_STRUCT__entry(
785 __field( int, dev_major ) 836 __field( dev_t, dev )
786 __field( int, dev_minor )
787 __field( int, wait ) 837 __field( int, wait )
788 838
789 ), 839 ),
790 840
791 TP_fast_assign( 841 TP_fast_assign(
792 __entry->dev_major = MAJOR(sb->s_dev); 842 __entry->dev = sb->s_dev;
793 __entry->dev_minor = MINOR(sb->s_dev);
794 __entry->wait = wait; 843 __entry->wait = wait;
795 ), 844 ),
796 845
797 TP_printk("dev %d,%d wait %d", __entry->dev_major, 846 TP_printk("dev %d,%d wait %d",
798 __entry->dev_minor, __entry->wait) 847 MAJOR(__entry->dev), MINOR(__entry->dev),
848 __entry->wait)
799); 849);
800 850
801TRACE_EVENT(ext4_alloc_da_blocks, 851TRACE_EVENT(ext4_alloc_da_blocks,
@@ -804,23 +854,21 @@ TRACE_EVENT(ext4_alloc_da_blocks,
804 TP_ARGS(inode), 854 TP_ARGS(inode),
805 855
806 TP_STRUCT__entry( 856 TP_STRUCT__entry(
807 __field( int, dev_major ) 857 __field( dev_t, dev )
808 __field( int, dev_minor )
809 __field( ino_t, ino ) 858 __field( ino_t, ino )
810 __field( unsigned int, data_blocks ) 859 __field( unsigned int, data_blocks )
811 __field( unsigned int, meta_blocks ) 860 __field( unsigned int, meta_blocks )
812 ), 861 ),
813 862
814 TP_fast_assign( 863 TP_fast_assign(
815 __entry->dev_major = MAJOR(inode->i_sb->s_dev); 864 __entry->dev = inode->i_sb->s_dev;
816 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
817 __entry->ino = inode->i_ino; 865 __entry->ino = inode->i_ino;
818 __entry->data_blocks = EXT4_I(inode)->i_reserved_data_blocks; 866 __entry->data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
819 __entry->meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks; 867 __entry->meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
820 ), 868 ),
821 869
822 TP_printk("dev %d,%d ino %lu data_blocks %u meta_blocks %u", 870 TP_printk("dev %d,%d ino %lu data_blocks %u meta_blocks %u",
823 __entry->dev_major, __entry->dev_minor, 871 MAJOR(__entry->dev), MINOR(__entry->dev),
824 (unsigned long) __entry->ino, 872 (unsigned long) __entry->ino,
825 __entry->data_blocks, __entry->meta_blocks) 873 __entry->data_blocks, __entry->meta_blocks)
826); 874);
@@ -831,8 +879,7 @@ TRACE_EVENT(ext4_mballoc_alloc,
831 TP_ARGS(ac), 879 TP_ARGS(ac),
832 880
833 TP_STRUCT__entry( 881 TP_STRUCT__entry(
834 __field( int, dev_major ) 882 __field( dev_t, dev )
835 __field( int, dev_minor )
836 __field( ino_t, ino ) 883 __field( ino_t, ino )
837 __field( __u16, found ) 884 __field( __u16, found )
838 __field( __u16, groups ) 885 __field( __u16, groups )
@@ -855,8 +902,7 @@ TRACE_EVENT(ext4_mballoc_alloc,
855 ), 902 ),
856 903
857 TP_fast_assign( 904 TP_fast_assign(
858 __entry->dev_major = MAJOR(ac->ac_inode->i_sb->s_dev); 905 __entry->dev = ac->ac_inode->i_sb->s_dev;
859 __entry->dev_minor = MINOR(ac->ac_inode->i_sb->s_dev);
860 __entry->ino = ac->ac_inode->i_ino; 906 __entry->ino = ac->ac_inode->i_ino;
861 __entry->found = ac->ac_found; 907 __entry->found = ac->ac_found;
862 __entry->flags = ac->ac_flags; 908 __entry->flags = ac->ac_flags;
@@ -881,7 +927,7 @@ TRACE_EVENT(ext4_mballoc_alloc,
881 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u " 927 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u "
882 "result %u/%d/%u@%u blks %u grps %u cr %u flags 0x%04x " 928 "result %u/%d/%u@%u blks %u grps %u cr %u flags 0x%04x "
883 "tail %u broken %u", 929 "tail %u broken %u",
884 __entry->dev_major, __entry->dev_minor, 930 MAJOR(__entry->dev), MINOR(__entry->dev),
885 (unsigned long) __entry->ino, 931 (unsigned long) __entry->ino,
886 __entry->orig_group, __entry->orig_start, 932 __entry->orig_group, __entry->orig_start,
887 __entry->orig_len, __entry->orig_logical, 933 __entry->orig_len, __entry->orig_logical,
@@ -900,8 +946,7 @@ TRACE_EVENT(ext4_mballoc_prealloc,
900 TP_ARGS(ac), 946 TP_ARGS(ac),
901 947
902 TP_STRUCT__entry( 948 TP_STRUCT__entry(
903 __field( int, dev_major ) 949 __field( dev_t, dev )
904 __field( int, dev_minor )
905 __field( ino_t, ino ) 950 __field( ino_t, ino )
906 __field( __u32, orig_logical ) 951 __field( __u32, orig_logical )
907 __field( int, orig_start ) 952 __field( int, orig_start )
@@ -914,8 +959,7 @@ TRACE_EVENT(ext4_mballoc_prealloc,
914 ), 959 ),
915 960
916 TP_fast_assign( 961 TP_fast_assign(
917 __entry->dev_major = MAJOR(ac->ac_inode->i_sb->s_dev); 962 __entry->dev = ac->ac_inode->i_sb->s_dev;
918 __entry->dev_minor = MINOR(ac->ac_inode->i_sb->s_dev);
919 __entry->ino = ac->ac_inode->i_ino; 963 __entry->ino = ac->ac_inode->i_ino;
920 __entry->orig_logical = ac->ac_o_ex.fe_logical; 964 __entry->orig_logical = ac->ac_o_ex.fe_logical;
921 __entry->orig_start = ac->ac_o_ex.fe_start; 965 __entry->orig_start = ac->ac_o_ex.fe_start;
@@ -928,7 +972,7 @@ TRACE_EVENT(ext4_mballoc_prealloc,
928 ), 972 ),
929 973
930 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u", 974 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u",
931 __entry->dev_major, __entry->dev_minor, 975 MAJOR(__entry->dev), MINOR(__entry->dev),
932 (unsigned long) __entry->ino, 976 (unsigned long) __entry->ino,
933 __entry->orig_group, __entry->orig_start, 977 __entry->orig_group, __entry->orig_start,
934 __entry->orig_len, __entry->orig_logical, 978 __entry->orig_len, __entry->orig_logical,
@@ -946,8 +990,7 @@ DECLARE_EVENT_CLASS(ext4__mballoc,
946 TP_ARGS(sb, inode, group, start, len), 990 TP_ARGS(sb, inode, group, start, len),
947 991
948 TP_STRUCT__entry( 992 TP_STRUCT__entry(
949 __field( int, dev_major ) 993 __field( dev_t, dev )
950 __field( int, dev_minor )
951 __field( ino_t, ino ) 994 __field( ino_t, ino )
952 __field( int, result_start ) 995 __field( int, result_start )
953 __field( __u32, result_group ) 996 __field( __u32, result_group )
@@ -955,8 +998,7 @@ DECLARE_EVENT_CLASS(ext4__mballoc,
955 ), 998 ),
956 999
957 TP_fast_assign( 1000 TP_fast_assign(
958 __entry->dev_major = MAJOR(sb->s_dev); 1001 __entry->dev = sb->s_dev;
959 __entry->dev_minor = MINOR(sb->s_dev);
960 __entry->ino = inode ? inode->i_ino : 0; 1002 __entry->ino = inode ? inode->i_ino : 0;
961 __entry->result_start = start; 1003 __entry->result_start = start;
962 __entry->result_group = group; 1004 __entry->result_group = group;
@@ -964,7 +1006,7 @@ DECLARE_EVENT_CLASS(ext4__mballoc,
964 ), 1006 ),
965 1007
966 TP_printk("dev %d,%d inode %lu extent %u/%d/%u ", 1008 TP_printk("dev %d,%d inode %lu extent %u/%d/%u ",
967 __entry->dev_major, __entry->dev_minor, 1009 MAJOR(__entry->dev), MINOR(__entry->dev),
968 (unsigned long) __entry->ino, 1010 (unsigned long) __entry->ino,
969 __entry->result_group, __entry->result_start, 1011 __entry->result_group, __entry->result_start,
970 __entry->result_len) 1012 __entry->result_len)
@@ -998,8 +1040,7 @@ TRACE_EVENT(ext4_forget,
998 TP_ARGS(inode, is_metadata, block), 1040 TP_ARGS(inode, is_metadata, block),
999 1041
1000 TP_STRUCT__entry( 1042 TP_STRUCT__entry(
1001 __field( int, dev_major ) 1043 __field( dev_t, dev )
1002 __field( int, dev_minor )
1003 __field( ino_t, ino ) 1044 __field( ino_t, ino )
1004 __field( umode_t, mode ) 1045 __field( umode_t, mode )
1005 __field( int, is_metadata ) 1046 __field( int, is_metadata )
@@ -1007,8 +1048,7 @@ TRACE_EVENT(ext4_forget,
1007 ), 1048 ),
1008 1049
1009 TP_fast_assign( 1050 TP_fast_assign(
1010 __entry->dev_major = MAJOR(inode->i_sb->s_dev); 1051 __entry->dev = inode->i_sb->s_dev;
1011 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
1012 __entry->ino = inode->i_ino; 1052 __entry->ino = inode->i_ino;
1013 __entry->mode = inode->i_mode; 1053 __entry->mode = inode->i_mode;
1014 __entry->is_metadata = is_metadata; 1054 __entry->is_metadata = is_metadata;
@@ -1016,9 +1056,9 @@ TRACE_EVENT(ext4_forget,
1016 ), 1056 ),
1017 1057
1018 TP_printk("dev %d,%d ino %lu mode 0%o is_metadata %d block %llu", 1058 TP_printk("dev %d,%d ino %lu mode 0%o is_metadata %d block %llu",
1019 __entry->dev_major, __entry->dev_minor, 1059 MAJOR(__entry->dev), MINOR(__entry->dev),
1020 (unsigned long) __entry->ino, __entry->mode, 1060 (unsigned long) __entry->ino,
1021 __entry->is_metadata, __entry->block) 1061 __entry->mode, __entry->is_metadata, __entry->block)
1022); 1062);
1023 1063
1024TRACE_EVENT(ext4_da_update_reserve_space, 1064TRACE_EVENT(ext4_da_update_reserve_space,
@@ -1027,8 +1067,7 @@ TRACE_EVENT(ext4_da_update_reserve_space,
1027 TP_ARGS(inode, used_blocks), 1067 TP_ARGS(inode, used_blocks),
1028 1068
1029 TP_STRUCT__entry( 1069 TP_STRUCT__entry(
1030 __field( int, dev_major ) 1070 __field( dev_t, dev )
1031 __field( int, dev_minor )
1032 __field( ino_t, ino ) 1071 __field( ino_t, ino )
1033 __field( umode_t, mode ) 1072 __field( umode_t, mode )
1034 __field( __u64, i_blocks ) 1073 __field( __u64, i_blocks )
@@ -1039,8 +1078,7 @@ TRACE_EVENT(ext4_da_update_reserve_space,
1039 ), 1078 ),
1040 1079
1041 TP_fast_assign( 1080 TP_fast_assign(
1042 __entry->dev_major = MAJOR(inode->i_sb->s_dev); 1081 __entry->dev = inode->i_sb->s_dev;
1043 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
1044 __entry->ino = inode->i_ino; 1082 __entry->ino = inode->i_ino;
1045 __entry->mode = inode->i_mode; 1083 __entry->mode = inode->i_mode;
1046 __entry->i_blocks = inode->i_blocks; 1084 __entry->i_blocks = inode->i_blocks;
@@ -1050,10 +1088,12 @@ TRACE_EVENT(ext4_da_update_reserve_space,
1050 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks; 1088 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks;
1051 ), 1089 ),
1052 1090
1053 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d reserved_data_blocks %d reserved_meta_blocks %d allocated_meta_blocks %d", 1091 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d "
1054 __entry->dev_major, __entry->dev_minor, 1092 "reserved_data_blocks %d reserved_meta_blocks %d "
1055 (unsigned long) __entry->ino, __entry->mode, 1093 "allocated_meta_blocks %d",
1056 (unsigned long long) __entry->i_blocks, 1094 MAJOR(__entry->dev), MINOR(__entry->dev),
1095 (unsigned long) __entry->ino,
1096 __entry->mode, (unsigned long long) __entry->i_blocks,
1057 __entry->used_blocks, __entry->reserved_data_blocks, 1097 __entry->used_blocks, __entry->reserved_data_blocks,
1058 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks) 1098 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks)
1059); 1099);
@@ -1064,8 +1104,7 @@ TRACE_EVENT(ext4_da_reserve_space,
1064 TP_ARGS(inode, md_needed), 1104 TP_ARGS(inode, md_needed),
1065 1105
1066 TP_STRUCT__entry( 1106 TP_STRUCT__entry(
1067 __field( int, dev_major ) 1107 __field( dev_t, dev )
1068 __field( int, dev_minor )
1069 __field( ino_t, ino ) 1108 __field( ino_t, ino )
1070 __field( umode_t, mode ) 1109 __field( umode_t, mode )
1071 __field( __u64, i_blocks ) 1110 __field( __u64, i_blocks )
@@ -1075,8 +1114,7 @@ TRACE_EVENT(ext4_da_reserve_space,
1075 ), 1114 ),
1076 1115
1077 TP_fast_assign( 1116 TP_fast_assign(
1078 __entry->dev_major = MAJOR(inode->i_sb->s_dev); 1117 __entry->dev = inode->i_sb->s_dev;
1079 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
1080 __entry->ino = inode->i_ino; 1118 __entry->ino = inode->i_ino;
1081 __entry->mode = inode->i_mode; 1119 __entry->mode = inode->i_mode;
1082 __entry->i_blocks = inode->i_blocks; 1120 __entry->i_blocks = inode->i_blocks;
@@ -1085,8 +1123,9 @@ TRACE_EVENT(ext4_da_reserve_space,
1085 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks; 1123 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
1086 ), 1124 ),
1087 1125
1088 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu md_needed %d reserved_data_blocks %d reserved_meta_blocks %d", 1126 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu md_needed %d "
1089 __entry->dev_major, __entry->dev_minor, 1127 "reserved_data_blocks %d reserved_meta_blocks %d",
1128 MAJOR(__entry->dev), MINOR(__entry->dev),
1090 (unsigned long) __entry->ino, 1129 (unsigned long) __entry->ino,
1091 __entry->mode, (unsigned long long) __entry->i_blocks, 1130 __entry->mode, (unsigned long long) __entry->i_blocks,
1092 __entry->md_needed, __entry->reserved_data_blocks, 1131 __entry->md_needed, __entry->reserved_data_blocks,
@@ -1099,8 +1138,7 @@ TRACE_EVENT(ext4_da_release_space,
1099 TP_ARGS(inode, freed_blocks), 1138 TP_ARGS(inode, freed_blocks),
1100 1139
1101 TP_STRUCT__entry( 1140 TP_STRUCT__entry(
1102 __field( int, dev_major ) 1141 __field( dev_t, dev )
1103 __field( int, dev_minor )
1104 __field( ino_t, ino ) 1142 __field( ino_t, ino )
1105 __field( umode_t, mode ) 1143 __field( umode_t, mode )
1106 __field( __u64, i_blocks ) 1144 __field( __u64, i_blocks )
@@ -1111,8 +1149,7 @@ TRACE_EVENT(ext4_da_release_space,
1111 ), 1149 ),
1112 1150
1113 TP_fast_assign( 1151 TP_fast_assign(
1114 __entry->dev_major = MAJOR(inode->i_sb->s_dev); 1152 __entry->dev = inode->i_sb->s_dev;
1115 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
1116 __entry->ino = inode->i_ino; 1153 __entry->ino = inode->i_ino;
1117 __entry->mode = inode->i_mode; 1154 __entry->mode = inode->i_mode;
1118 __entry->i_blocks = inode->i_blocks; 1155 __entry->i_blocks = inode->i_blocks;
@@ -1122,8 +1159,10 @@ TRACE_EVENT(ext4_da_release_space,
1122 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks; 1159 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks;
1123 ), 1160 ),
1124 1161
1125 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu freed_blocks %d reserved_data_blocks %d reserved_meta_blocks %d allocated_meta_blocks %d", 1162 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu freed_blocks %d "
1126 __entry->dev_major, __entry->dev_minor, 1163 "reserved_data_blocks %d reserved_meta_blocks %d "
1164 "allocated_meta_blocks %d",
1165 MAJOR(__entry->dev), MINOR(__entry->dev),
1127 (unsigned long) __entry->ino, 1166 (unsigned long) __entry->ino,
1128 __entry->mode, (unsigned long long) __entry->i_blocks, 1167 __entry->mode, (unsigned long long) __entry->i_blocks,
1129 __entry->freed_blocks, __entry->reserved_data_blocks, 1168 __entry->freed_blocks, __entry->reserved_data_blocks,
@@ -1136,20 +1175,19 @@ DECLARE_EVENT_CLASS(ext4__bitmap_load,
1136 TP_ARGS(sb, group), 1175 TP_ARGS(sb, group),
1137 1176
1138 TP_STRUCT__entry( 1177 TP_STRUCT__entry(
1139 __field( int, dev_major ) 1178 __field( dev_t, dev )
1140 __field( int, dev_minor )
1141 __field( __u32, group ) 1179 __field( __u32, group )
1142 1180
1143 ), 1181 ),
1144 1182
1145 TP_fast_assign( 1183 TP_fast_assign(
1146 __entry->dev_major = MAJOR(sb->s_dev); 1184 __entry->dev = sb->s_dev;
1147 __entry->dev_minor = MINOR(sb->s_dev);
1148 __entry->group = group; 1185 __entry->group = group;
1149 ), 1186 ),
1150 1187
1151 TP_printk("dev %d,%d group %u", 1188 TP_printk("dev %d,%d group %u",
1152 __entry->dev_major, __entry->dev_minor, __entry->group) 1189 MAJOR(__entry->dev), MINOR(__entry->dev),
1190 __entry->group)
1153); 1191);
1154 1192
1155DEFINE_EVENT(ext4__bitmap_load, ext4_mb_bitmap_load, 1193DEFINE_EVENT(ext4__bitmap_load, ext4_mb_bitmap_load,
@@ -1166,6 +1204,349 @@ DEFINE_EVENT(ext4__bitmap_load, ext4_mb_buddy_bitmap_load,
1166 TP_ARGS(sb, group) 1204 TP_ARGS(sb, group)
1167); 1205);
1168 1206
1207DEFINE_EVENT(ext4__bitmap_load, ext4_read_block_bitmap_load,
1208
1209 TP_PROTO(struct super_block *sb, unsigned long group),
1210
1211 TP_ARGS(sb, group)
1212);
1213
1214DEFINE_EVENT(ext4__bitmap_load, ext4_load_inode_bitmap,
1215
1216 TP_PROTO(struct super_block *sb, unsigned long group),
1217
1218 TP_ARGS(sb, group)
1219);
1220
1221TRACE_EVENT(ext4_direct_IO_enter,
1222 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
1223
1224 TP_ARGS(inode, offset, len, rw),
1225
1226 TP_STRUCT__entry(
1227 __field( ino_t, ino )
1228 __field( dev_t, dev )
1229 __field( loff_t, pos )
1230 __field( unsigned long, len )
1231 __field( int, rw )
1232 ),
1233
1234 TP_fast_assign(
1235 __entry->ino = inode->i_ino;
1236 __entry->dev = inode->i_sb->s_dev;
1237 __entry->pos = offset;
1238 __entry->len = len;
1239 __entry->rw = rw;
1240 ),
1241
1242 TP_printk("dev %d,%d ino %lu pos %llu len %lu rw %d",
1243 MAJOR(__entry->dev), MINOR(__entry->dev),
1244 (unsigned long) __entry->ino,
1245 (unsigned long long) __entry->pos, __entry->len, __entry->rw)
1246);
1247
1248TRACE_EVENT(ext4_direct_IO_exit,
1249 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw, int ret),
1250
1251 TP_ARGS(inode, offset, len, rw, ret),
1252
1253 TP_STRUCT__entry(
1254 __field( ino_t, ino )
1255 __field( dev_t, dev )
1256 __field( loff_t, pos )
1257 __field( unsigned long, len )
1258 __field( int, rw )
1259 __field( int, ret )
1260 ),
1261
1262 TP_fast_assign(
1263 __entry->ino = inode->i_ino;
1264 __entry->dev = inode->i_sb->s_dev;
1265 __entry->pos = offset;
1266 __entry->len = len;
1267 __entry->rw = rw;
1268 __entry->ret = ret;
1269 ),
1270
1271 TP_printk("dev %d,%d ino %lu pos %llu len %lu rw %d ret %d",
1272 MAJOR(__entry->dev), MINOR(__entry->dev),
1273 (unsigned long) __entry->ino,
1274 (unsigned long long) __entry->pos, __entry->len,
1275 __entry->rw, __entry->ret)
1276);
1277
1278TRACE_EVENT(ext4_fallocate_enter,
1279 TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1280
1281 TP_ARGS(inode, offset, len, mode),
1282
1283 TP_STRUCT__entry(
1284 __field( ino_t, ino )
1285 __field( dev_t, dev )
1286 __field( loff_t, pos )
1287 __field( loff_t, len )
1288 __field( int, mode )
1289 ),
1290
1291 TP_fast_assign(
1292 __entry->ino = inode->i_ino;
1293 __entry->dev = inode->i_sb->s_dev;
1294 __entry->pos = offset;
1295 __entry->len = len;
1296 __entry->mode = mode;
1297 ),
1298
1299 TP_printk("dev %d,%d ino %ld pos %llu len %llu mode %d",
1300 MAJOR(__entry->dev), MINOR(__entry->dev),
1301 (unsigned long) __entry->ino,
1302 (unsigned long long) __entry->pos,
1303 (unsigned long long) __entry->len, __entry->mode)
1304);
1305
1306TRACE_EVENT(ext4_fallocate_exit,
1307 TP_PROTO(struct inode *inode, loff_t offset, unsigned int max_blocks, int ret),
1308
1309 TP_ARGS(inode, offset, max_blocks, ret),
1310
1311 TP_STRUCT__entry(
1312 __field( ino_t, ino )
1313 __field( dev_t, dev )
1314 __field( loff_t, pos )
1315 __field( unsigned, blocks )
1316 __field( int, ret )
1317 ),
1318
1319 TP_fast_assign(
1320 __entry->ino = inode->i_ino;
1321 __entry->dev = inode->i_sb->s_dev;
1322 __entry->pos = offset;
1323 __entry->blocks = max_blocks;
1324 __entry->ret = ret;
1325 ),
1326
1327 TP_printk("dev %d,%d ino %ld pos %llu blocks %d ret %d",
1328 MAJOR(__entry->dev), MINOR(__entry->dev),
1329 (unsigned long) __entry->ino,
1330 (unsigned long long) __entry->pos, __entry->blocks,
1331 __entry->ret)
1332);
1333
1334TRACE_EVENT(ext4_unlink_enter,
1335 TP_PROTO(struct inode *parent, struct dentry *dentry),
1336
1337 TP_ARGS(parent, dentry),
1338
1339 TP_STRUCT__entry(
1340 __field( ino_t, parent )
1341 __field( ino_t, ino )
1342 __field( loff_t, size )
1343 __field( dev_t, dev )
1344 ),
1345
1346 TP_fast_assign(
1347 __entry->parent = parent->i_ino;
1348 __entry->ino = dentry->d_inode->i_ino;
1349 __entry->size = dentry->d_inode->i_size;
1350 __entry->dev = dentry->d_inode->i_sb->s_dev;
1351 ),
1352
1353 TP_printk("dev %d,%d ino %ld size %lld parent %ld",
1354 MAJOR(__entry->dev), MINOR(__entry->dev),
1355 (unsigned long) __entry->ino, __entry->size,
1356 (unsigned long) __entry->parent)
1357);
1358
1359TRACE_EVENT(ext4_unlink_exit,
1360 TP_PROTO(struct dentry *dentry, int ret),
1361
1362 TP_ARGS(dentry, ret),
1363
1364 TP_STRUCT__entry(
1365 __field( ino_t, ino )
1366 __field( dev_t, dev )
1367 __field( int, ret )
1368 ),
1369
1370 TP_fast_assign(
1371 __entry->ino = dentry->d_inode->i_ino;
1372 __entry->dev = dentry->d_inode->i_sb->s_dev;
1373 __entry->ret = ret;
1374 ),
1375
1376 TP_printk("dev %d,%d ino %ld ret %d",
1377 MAJOR(__entry->dev), MINOR(__entry->dev),
1378 (unsigned long) __entry->ino,
1379 __entry->ret)
1380);
1381
1382DECLARE_EVENT_CLASS(ext4__truncate,
1383 TP_PROTO(struct inode *inode),
1384
1385 TP_ARGS(inode),
1386
1387 TP_STRUCT__entry(
1388 __field( ino_t, ino )
1389 __field( dev_t, dev )
1390 __field( blkcnt_t, blocks )
1391 ),
1392
1393 TP_fast_assign(
1394 __entry->ino = inode->i_ino;
1395 __entry->dev = inode->i_sb->s_dev;
1396 __entry->blocks = inode->i_blocks;
1397 ),
1398
1399 TP_printk("dev %d,%d ino %lu blocks %lu",
1400 MAJOR(__entry->dev), MINOR(__entry->dev),
1401 (unsigned long) __entry->ino, (unsigned long) __entry->blocks)
1402);
1403
1404DEFINE_EVENT(ext4__truncate, ext4_truncate_enter,
1405
1406 TP_PROTO(struct inode *inode),
1407
1408 TP_ARGS(inode)
1409);
1410
1411DEFINE_EVENT(ext4__truncate, ext4_truncate_exit,
1412
1413 TP_PROTO(struct inode *inode),
1414
1415 TP_ARGS(inode)
1416);
1417
1418DECLARE_EVENT_CLASS(ext4__map_blocks_enter,
1419 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1420 unsigned len, unsigned flags),
1421
1422 TP_ARGS(inode, lblk, len, flags),
1423
1424 TP_STRUCT__entry(
1425 __field( ino_t, ino )
1426 __field( dev_t, dev )
1427 __field( ext4_lblk_t, lblk )
1428 __field( unsigned, len )
1429 __field( unsigned, flags )
1430 ),
1431
1432 TP_fast_assign(
1433 __entry->ino = inode->i_ino;
1434 __entry->dev = inode->i_sb->s_dev;
1435 __entry->lblk = lblk;
1436 __entry->len = len;
1437 __entry->flags = flags;
1438 ),
1439
1440 TP_printk("dev %d,%d ino %lu lblk %u len %u flags %u",
1441 MAJOR(__entry->dev), MINOR(__entry->dev),
1442 (unsigned long) __entry->ino,
1443 (unsigned) __entry->lblk, __entry->len, __entry->flags)
1444);
1445
1446DEFINE_EVENT(ext4__map_blocks_enter, ext4_ext_map_blocks_enter,
1447 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1448 unsigned len, unsigned flags),
1449
1450 TP_ARGS(inode, lblk, len, flags)
1451);
1452
1453DEFINE_EVENT(ext4__map_blocks_enter, ext4_ind_map_blocks_enter,
1454 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1455 unsigned len, unsigned flags),
1456
1457 TP_ARGS(inode, lblk, len, flags)
1458);
1459
1460DECLARE_EVENT_CLASS(ext4__map_blocks_exit,
1461 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1462 ext4_fsblk_t pblk, unsigned len, int ret),
1463
1464 TP_ARGS(inode, lblk, pblk, len, ret),
1465
1466 TP_STRUCT__entry(
1467 __field( ino_t, ino )
1468 __field( dev_t, dev )
1469 __field( ext4_lblk_t, lblk )
1470 __field( ext4_fsblk_t, pblk )
1471 __field( unsigned, len )
1472 __field( int, ret )
1473 ),
1474
1475 TP_fast_assign(
1476 __entry->ino = inode->i_ino;
1477 __entry->dev = inode->i_sb->s_dev;
1478 __entry->lblk = lblk;
1479 __entry->pblk = pblk;
1480 __entry->len = len;
1481 __entry->ret = ret;
1482 ),
1483
1484 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u ret %d",
1485 MAJOR(__entry->dev), MINOR(__entry->dev),
1486 (unsigned long) __entry->ino,
1487 (unsigned) __entry->lblk, (unsigned long long) __entry->pblk,
1488 __entry->len, __entry->ret)
1489);
1490
1491DEFINE_EVENT(ext4__map_blocks_exit, ext4_ext_map_blocks_exit,
1492 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1493 ext4_fsblk_t pblk, unsigned len, int ret),
1494
1495 TP_ARGS(inode, lblk, pblk, len, ret)
1496);
1497
1498DEFINE_EVENT(ext4__map_blocks_exit, ext4_ind_map_blocks_exit,
1499 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1500 ext4_fsblk_t pblk, unsigned len, int ret),
1501
1502 TP_ARGS(inode, lblk, pblk, len, ret)
1503);
1504
1505TRACE_EVENT(ext4_ext_load_extent,
1506 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk),
1507
1508 TP_ARGS(inode, lblk, pblk),
1509
1510 TP_STRUCT__entry(
1511 __field( ino_t, ino )
1512 __field( dev_t, dev )
1513 __field( ext4_lblk_t, lblk )
1514 __field( ext4_fsblk_t, pblk )
1515 ),
1516
1517 TP_fast_assign(
1518 __entry->ino = inode->i_ino;
1519 __entry->dev = inode->i_sb->s_dev;
1520 __entry->lblk = lblk;
1521 __entry->pblk = pblk;
1522 ),
1523
1524 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu",
1525 MAJOR(__entry->dev), MINOR(__entry->dev),
1526 (unsigned long) __entry->ino,
1527 (unsigned) __entry->lblk, (unsigned long long) __entry->pblk)
1528);
1529
1530TRACE_EVENT(ext4_load_inode,
1531 TP_PROTO(struct inode *inode),
1532
1533 TP_ARGS(inode),
1534
1535 TP_STRUCT__entry(
1536 __field( ino_t, ino )
1537 __field( dev_t, dev )
1538 ),
1539
1540 TP_fast_assign(
1541 __entry->ino = inode->i_ino;
1542 __entry->dev = inode->i_sb->s_dev;
1543 ),
1544
1545 TP_printk("dev %d,%d ino %ld",
1546 MAJOR(__entry->dev), MINOR(__entry->dev),
1547 (unsigned long) __entry->ino)
1548);
1549
1169#endif /* _TRACE_EXT4_H */ 1550#endif /* _TRACE_EXT4_H */
1170 1551
1171/* This part must be outside protection */ 1552/* This part must be outside protection */
diff --git a/include/trace/events/jbd2.h b/include/trace/events/jbd2.h
index 7447ea9305b5..bf16545cc977 100644
--- a/include/trace/events/jbd2.h
+++ b/include/trace/events/jbd2.h
@@ -17,19 +17,17 @@ TRACE_EVENT(jbd2_checkpoint,
17 TP_ARGS(journal, result), 17 TP_ARGS(journal, result),
18 18
19 TP_STRUCT__entry( 19 TP_STRUCT__entry(
20 __field( int, dev_major ) 20 __field( dev_t, dev )
21 __field( int, dev_minor )
22 __field( int, result ) 21 __field( int, result )
23 ), 22 ),
24 23
25 TP_fast_assign( 24 TP_fast_assign(
26 __entry->dev_major = MAJOR(journal->j_fs_dev->bd_dev); 25 __entry->dev = journal->j_fs_dev->bd_dev;
27 __entry->dev_minor = MINOR(journal->j_fs_dev->bd_dev);
28 __entry->result = result; 26 __entry->result = result;
29 ), 27 ),
30 28
31 TP_printk("dev %d,%d result %d", 29 TP_printk("dev %s result %d",
32 __entry->dev_major, __entry->dev_minor, __entry->result) 30 jbd2_dev_to_name(__entry->dev), __entry->result)
33); 31);
34 32
35DECLARE_EVENT_CLASS(jbd2_commit, 33DECLARE_EVENT_CLASS(jbd2_commit,
@@ -39,22 +37,20 @@ DECLARE_EVENT_CLASS(jbd2_commit,
39 TP_ARGS(journal, commit_transaction), 37 TP_ARGS(journal, commit_transaction),
40 38
41 TP_STRUCT__entry( 39 TP_STRUCT__entry(
42 __field( int, dev_major ) 40 __field( dev_t, dev )
43 __field( int, dev_minor )
44 __field( char, sync_commit ) 41 __field( char, sync_commit )
45 __field( int, transaction ) 42 __field( int, transaction )
46 ), 43 ),
47 44
48 TP_fast_assign( 45 TP_fast_assign(
49 __entry->dev_major = MAJOR(journal->j_fs_dev->bd_dev); 46 __entry->dev = journal->j_fs_dev->bd_dev;
50 __entry->dev_minor = MINOR(journal->j_fs_dev->bd_dev);
51 __entry->sync_commit = commit_transaction->t_synchronous_commit; 47 __entry->sync_commit = commit_transaction->t_synchronous_commit;
52 __entry->transaction = commit_transaction->t_tid; 48 __entry->transaction = commit_transaction->t_tid;
53 ), 49 ),
54 50
55 TP_printk("dev %d,%d transaction %d sync %d", 51 TP_printk("dev %s transaction %d sync %d",
56 __entry->dev_major, __entry->dev_minor, 52 jbd2_dev_to_name(__entry->dev), __entry->transaction,
57 __entry->transaction, __entry->sync_commit) 53 __entry->sync_commit)
58); 54);
59 55
60DEFINE_EVENT(jbd2_commit, jbd2_start_commit, 56DEFINE_EVENT(jbd2_commit, jbd2_start_commit,
@@ -91,24 +87,22 @@ TRACE_EVENT(jbd2_end_commit,
91 TP_ARGS(journal, commit_transaction), 87 TP_ARGS(journal, commit_transaction),
92 88
93 TP_STRUCT__entry( 89 TP_STRUCT__entry(
94 __field( int, dev_major ) 90 __field( dev_t, dev )
95 __field( int, dev_minor )
96 __field( char, sync_commit ) 91 __field( char, sync_commit )
97 __field( int, transaction ) 92 __field( int, transaction )
98 __field( int, head ) 93 __field( int, head )
99 ), 94 ),
100 95
101 TP_fast_assign( 96 TP_fast_assign(
102 __entry->dev_major = MAJOR(journal->j_fs_dev->bd_dev); 97 __entry->dev = journal->j_fs_dev->bd_dev;
103 __entry->dev_minor = MINOR(journal->j_fs_dev->bd_dev);
104 __entry->sync_commit = commit_transaction->t_synchronous_commit; 98 __entry->sync_commit = commit_transaction->t_synchronous_commit;
105 __entry->transaction = commit_transaction->t_tid; 99 __entry->transaction = commit_transaction->t_tid;
106 __entry->head = journal->j_tail_sequence; 100 __entry->head = journal->j_tail_sequence;
107 ), 101 ),
108 102
109 TP_printk("dev %d,%d transaction %d sync %d head %d", 103 TP_printk("dev %s transaction %d sync %d head %d",
110 __entry->dev_major, __entry->dev_minor, 104 jbd2_dev_to_name(__entry->dev), __entry->transaction,
111 __entry->transaction, __entry->sync_commit, __entry->head) 105 __entry->sync_commit, __entry->head)
112); 106);
113 107
114TRACE_EVENT(jbd2_submit_inode_data, 108TRACE_EVENT(jbd2_submit_inode_data,
@@ -117,20 +111,17 @@ TRACE_EVENT(jbd2_submit_inode_data,
117 TP_ARGS(inode), 111 TP_ARGS(inode),
118 112
119 TP_STRUCT__entry( 113 TP_STRUCT__entry(
120 __field( int, dev_major ) 114 __field( dev_t, dev )
121 __field( int, dev_minor )
122 __field( ino_t, ino ) 115 __field( ino_t, ino )
123 ), 116 ),
124 117
125 TP_fast_assign( 118 TP_fast_assign(
126 __entry->dev_major = MAJOR(inode->i_sb->s_dev); 119 __entry->dev = inode->i_sb->s_dev;
127 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
128 __entry->ino = inode->i_ino; 120 __entry->ino = inode->i_ino;
129 ), 121 ),
130 122
131 TP_printk("dev %d,%d ino %lu", 123 TP_printk("dev %s ino %lu",
132 __entry->dev_major, __entry->dev_minor, 124 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino)
133 (unsigned long) __entry->ino)
134); 125);
135 126
136TRACE_EVENT(jbd2_run_stats, 127TRACE_EVENT(jbd2_run_stats,
@@ -140,8 +131,7 @@ TRACE_EVENT(jbd2_run_stats,
140 TP_ARGS(dev, tid, stats), 131 TP_ARGS(dev, tid, stats),
141 132
142 TP_STRUCT__entry( 133 TP_STRUCT__entry(
143 __field( int, dev_major ) 134 __field( dev_t, dev )
144 __field( int, dev_minor )
145 __field( unsigned long, tid ) 135 __field( unsigned long, tid )
146 __field( unsigned long, wait ) 136 __field( unsigned long, wait )
147 __field( unsigned long, running ) 137 __field( unsigned long, running )
@@ -154,8 +144,7 @@ TRACE_EVENT(jbd2_run_stats,
154 ), 144 ),
155 145
156 TP_fast_assign( 146 TP_fast_assign(
157 __entry->dev_major = MAJOR(dev); 147 __entry->dev = dev;
158 __entry->dev_minor = MINOR(dev);
159 __entry->tid = tid; 148 __entry->tid = tid;
160 __entry->wait = stats->rs_wait; 149 __entry->wait = stats->rs_wait;
161 __entry->running = stats->rs_running; 150 __entry->running = stats->rs_running;
@@ -167,9 +156,9 @@ TRACE_EVENT(jbd2_run_stats,
167 __entry->blocks_logged = stats->rs_blocks_logged; 156 __entry->blocks_logged = stats->rs_blocks_logged;
168 ), 157 ),
169 158
170 TP_printk("dev %d,%d tid %lu wait %u running %u locked %u flushing %u " 159 TP_printk("dev %s tid %lu wait %u running %u locked %u flushing %u "
171 "logging %u handle_count %u blocks %u blocks_logged %u", 160 "logging %u handle_count %u blocks %u blocks_logged %u",
172 __entry->dev_major, __entry->dev_minor, __entry->tid, 161 jbd2_dev_to_name(__entry->dev), __entry->tid,
173 jiffies_to_msecs(__entry->wait), 162 jiffies_to_msecs(__entry->wait),
174 jiffies_to_msecs(__entry->running), 163 jiffies_to_msecs(__entry->running),
175 jiffies_to_msecs(__entry->locked), 164 jiffies_to_msecs(__entry->locked),
@@ -186,8 +175,7 @@ TRACE_EVENT(jbd2_checkpoint_stats,
186 TP_ARGS(dev, tid, stats), 175 TP_ARGS(dev, tid, stats),
187 176
188 TP_STRUCT__entry( 177 TP_STRUCT__entry(
189 __field( int, dev_major ) 178 __field( dev_t, dev )
190 __field( int, dev_minor )
191 __field( unsigned long, tid ) 179 __field( unsigned long, tid )
192 __field( unsigned long, chp_time ) 180 __field( unsigned long, chp_time )
193 __field( __u32, forced_to_close ) 181 __field( __u32, forced_to_close )
@@ -196,8 +184,7 @@ TRACE_EVENT(jbd2_checkpoint_stats,
196 ), 184 ),
197 185
198 TP_fast_assign( 186 TP_fast_assign(
199 __entry->dev_major = MAJOR(dev); 187 __entry->dev = dev;
200 __entry->dev_minor = MINOR(dev);
201 __entry->tid = tid; 188 __entry->tid = tid;
202 __entry->chp_time = stats->cs_chp_time; 189 __entry->chp_time = stats->cs_chp_time;
203 __entry->forced_to_close= stats->cs_forced_to_close; 190 __entry->forced_to_close= stats->cs_forced_to_close;
@@ -205,9 +192,9 @@ TRACE_EVENT(jbd2_checkpoint_stats,
205 __entry->dropped = stats->cs_dropped; 192 __entry->dropped = stats->cs_dropped;
206 ), 193 ),
207 194
208 TP_printk("dev %d,%d tid %lu chp_time %u forced_to_close %u " 195 TP_printk("dev %s tid %lu chp_time %u forced_to_close %u "
209 "written %u dropped %u", 196 "written %u dropped %u",
210 __entry->dev_major, __entry->dev_minor, __entry->tid, 197 jbd2_dev_to_name(__entry->dev), __entry->tid,
211 jiffies_to_msecs(__entry->chp_time), 198 jiffies_to_msecs(__entry->chp_time),
212 __entry->forced_to_close, __entry->written, __entry->dropped) 199 __entry->forced_to_close, __entry->written, __entry->dropped)
213); 200);
@@ -220,8 +207,7 @@ TRACE_EVENT(jbd2_cleanup_journal_tail,
220 TP_ARGS(journal, first_tid, block_nr, freed), 207 TP_ARGS(journal, first_tid, block_nr, freed),
221 208
222 TP_STRUCT__entry( 209 TP_STRUCT__entry(
223 __field( int, dev_major ) 210 __field( dev_t, dev )
224 __field( int, dev_minor )
225 __field( tid_t, tail_sequence ) 211 __field( tid_t, tail_sequence )
226 __field( tid_t, first_tid ) 212 __field( tid_t, first_tid )
227 __field(unsigned long, block_nr ) 213 __field(unsigned long, block_nr )
@@ -229,18 +215,16 @@ TRACE_EVENT(jbd2_cleanup_journal_tail,
229 ), 215 ),
230 216
231 TP_fast_assign( 217 TP_fast_assign(
232 __entry->dev_major = MAJOR(journal->j_fs_dev->bd_dev); 218 __entry->dev = journal->j_fs_dev->bd_dev;
233 __entry->dev_minor = MINOR(journal->j_fs_dev->bd_dev);
234 __entry->tail_sequence = journal->j_tail_sequence; 219 __entry->tail_sequence = journal->j_tail_sequence;
235 __entry->first_tid = first_tid; 220 __entry->first_tid = first_tid;
236 __entry->block_nr = block_nr; 221 __entry->block_nr = block_nr;
237 __entry->freed = freed; 222 __entry->freed = freed;
238 ), 223 ),
239 224
240 TP_printk("dev %d,%d from %u to %u offset %lu freed %lu", 225 TP_printk("dev %s from %u to %u offset %lu freed %lu",
241 __entry->dev_major, __entry->dev_minor, 226 jbd2_dev_to_name(__entry->dev), __entry->tail_sequence,
242 __entry->tail_sequence, __entry->first_tid, 227 __entry->first_tid, __entry->block_nr, __entry->freed)
243 __entry->block_nr, __entry->freed)
244); 228);
245 229
246#endif /* _TRACE_JBD2_H */ 230#endif /* _TRACE_JBD2_H */