Add btrfs file item tracepoints
[lttng-modules.git] / instrumentation / events / lttng-module / btrfs.h
1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM btrfs
3
4 #if !defined(LTTNG_TRACE_BTRFS_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define LTTNG_TRACE_BTRFS_H
6
7 #include <probes/lttng-tracepoint-event.h>
8 #include <linux/writeback.h>
9 #include <linux/version.h>
10
11 #ifndef _TRACE_BTRFS_DEF_
12 #define _TRACE_BTRFS_DEF_
13 struct btrfs_root;
14 struct btrfs_fs_info;
15 struct btrfs_inode;
16 struct extent_map;
17 struct btrfs_ordered_extent;
18 struct btrfs_delayed_ref_node;
19 struct btrfs_delayed_tree_ref;
20 struct btrfs_delayed_data_ref;
21 struct btrfs_delayed_ref_head;
22 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
23 struct btrfs_block_group_cache;
24 struct btrfs_free_cluster;
25 #endif
26 struct map_lookup;
27 struct extent_buffer;
28 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
29 struct extent_state;
30 #endif
31 #endif
32
33 #define BTRFS_UUID_SIZE 16
34
35 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
36 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
37 LTTNG_TRACEPOINT_EVENT(btrfs_transaction_commit,
38
39 TP_PROTO(const struct btrfs_root *root),
40
41 TP_ARGS(root),
42
43 TP_FIELDS(
44 ctf_integer(u64, generation, root->fs_info->generation)
45 ctf_integer(u64, root_objectid, root->root_key.objectid)
46 )
47 )
48
49 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__inode,
50
51 TP_PROTO(const struct inode *inode),
52
53 TP_ARGS(inode),
54
55 TP_FIELDS(
56 ctf_integer(ino_t, ino, inode->i_ino)
57 ctf_integer(blkcnt_t, blocks, inode->i_blocks)
58 ctf_integer(u64, disk_i_size, BTRFS_I(inode)->disk_i_size)
59 ctf_integer(u64, generation, BTRFS_I(inode)->generation)
60 ctf_integer(u64, last_trans, BTRFS_I(inode)->last_trans)
61 ctf_integer(u64, logged_trans, BTRFS_I(inode)->logged_trans)
62 ctf_integer(u64, root_objectid,
63 BTRFS_I(inode)->root->root_key.objectid)
64 )
65 )
66
67 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_new,
68
69 TP_PROTO(const struct inode *inode),
70
71 TP_ARGS(inode)
72 )
73
74 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_request,
75
76 TP_PROTO(const struct inode *inode),
77
78 TP_ARGS(inode)
79 )
80
81 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_evict,
82
83 TP_PROTO(const struct inode *inode),
84
85 TP_ARGS(inode)
86 )
87 #else
88 LTTNG_TRACEPOINT_EVENT(btrfs_transaction_commit,
89
90 TP_PROTO(struct btrfs_root *root),
91
92 TP_ARGS(root),
93
94 TP_FIELDS(
95 ctf_integer(u64, generation, root->fs_info->generation)
96 ctf_integer(u64, root_objectid, root->root_key.objectid)
97 )
98 )
99
100 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__inode,
101
102 TP_PROTO(struct inode *inode),
103
104 TP_ARGS(inode),
105
106 TP_FIELDS(
107 ctf_integer(ino_t, ino, inode->i_ino)
108 ctf_integer(blkcnt_t, blocks, inode->i_blocks)
109 ctf_integer(u64, disk_i_size, BTRFS_I(inode)->disk_i_size)
110 ctf_integer(u64, generation, BTRFS_I(inode)->generation)
111 ctf_integer(u64, last_trans, BTRFS_I(inode)->last_trans)
112 ctf_integer(u64, logged_trans, BTRFS_I(inode)->logged_trans)
113 ctf_integer(u64, root_objectid,
114 BTRFS_I(inode)->root->root_key.objectid)
115 )
116 )
117
118 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_new,
119
120 TP_PROTO(struct inode *inode),
121
122 TP_ARGS(inode)
123 )
124
125 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_request,
126
127 TP_PROTO(struct inode *inode),
128
129 TP_ARGS(inode)
130 )
131
132 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_evict,
133
134 TP_PROTO(struct inode *inode),
135
136 TP_ARGS(inode)
137 )
138 #endif
139
140 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
141
142 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
143
144 TP_PROTO(const struct btrfs_root *root, const struct btrfs_inode *inode,
145 const struct extent_map *map),
146
147 TP_ARGS(root, inode, map),
148
149 TP_FIELDS(
150 ctf_integer(u64, root_objectid, root->root_key.objectid)
151 ctf_integer(u64, ino, btrfs_ino(inode))
152 ctf_integer(u64, start, map->start)
153 ctf_integer(u64, len, map->len)
154 ctf_integer(u64, orig_start, map->orig_start)
155 ctf_integer(u64, block_start, map->block_start)
156 ctf_integer(u64, block_len, map->block_len)
157 ctf_integer(unsigned long, flags, map->flags)
158 ctf_integer(int, refs, refcount_read(&map->refs))
159 ctf_integer(unsigned int, compress_type, map->compress_type)
160 )
161 )
162
163 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
164
165 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
166
167 TP_PROTO(struct btrfs_root *root, struct btrfs_inode *inode,
168 struct extent_map *map),
169
170 TP_ARGS(root, inode, map),
171
172 TP_FIELDS(
173 ctf_integer(u64, root_objectid, root->root_key.objectid)
174 ctf_integer(u64, ino, btrfs_ino(inode))
175 ctf_integer(u64, start, map->start)
176 ctf_integer(u64, len, map->len)
177 ctf_integer(u64, orig_start, map->orig_start)
178 ctf_integer(u64, block_start, map->block_start)
179 ctf_integer(u64, block_len, map->block_len)
180 ctf_integer(unsigned long, flags, map->flags)
181 ctf_integer(int, refs, refcount_read(&map->refs))
182 ctf_integer(unsigned int, compress_type, map->compress_type)
183 )
184 )
185
186 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
187
188 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
189
190 TP_PROTO(struct btrfs_root *root, struct btrfs_inode *inode,
191 struct extent_map *map),
192
193 TP_ARGS(root, inode, map),
194
195 TP_FIELDS(
196 ctf_integer(u64, root_objectid, root->root_key.objectid)
197 ctf_integer(u64, ino, btrfs_ino(inode))
198 ctf_integer(u64, start, map->start)
199 ctf_integer(u64, len, map->len)
200 ctf_integer(u64, orig_start, map->orig_start)
201 ctf_integer(u64, block_start, map->block_start)
202 ctf_integer(u64, block_len, map->block_len)
203 ctf_integer(unsigned long, flags, map->flags)
204 ctf_integer(int, refs, atomic_read(&map->refs))
205 ctf_integer(unsigned int, compress_type, map->compress_type)
206 )
207 )
208
209 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
210
211 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
212
213 TP_PROTO(struct btrfs_root *root, struct inode *inode,
214 struct extent_map *map),
215
216 TP_ARGS(root, inode, map),
217
218 TP_FIELDS(
219 ctf_integer(u64, root_objectid, root->root_key.objectid)
220 ctf_integer(u64, ino, btrfs_ino(inode))
221 ctf_integer(u64, start, map->start)
222 ctf_integer(u64, len, map->len)
223 ctf_integer(u64, orig_start, map->orig_start)
224 ctf_integer(u64, block_start, map->block_start)
225 ctf_integer(u64, block_len, map->block_len)
226 ctf_integer(unsigned long, flags, map->flags)
227 ctf_integer(int, refs, atomic_read(&map->refs))
228 ctf_integer(unsigned int, compress_type, map->compress_type)
229 )
230 )
231
232 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
233
234 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
235
236 TP_PROTO(const struct btrfs_root *root, const struct extent_map *map),
237
238 TP_ARGS(root, map),
239
240 TP_FIELDS(
241 ctf_integer(u64, root_objectid, root->root_key.objectid)
242 ctf_integer(u64, start, map->start)
243 ctf_integer(u64, len, map->len)
244 ctf_integer(u64, orig_start, map->orig_start)
245 ctf_integer(u64, block_start, map->block_start)
246 ctf_integer(u64, block_len, map->block_len)
247 ctf_integer(unsigned long, flags, map->flags)
248 ctf_integer(int, refs, atomic_read(&map->refs))
249 ctf_integer(unsigned int, compress_type, map->compress_type)
250 )
251 )
252
253 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
254
255 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
256
257 TP_PROTO(struct btrfs_root *root, struct extent_map *map),
258
259 TP_ARGS(root, map),
260
261 TP_FIELDS(
262 ctf_integer(u64, root_objectid, root->root_key.objectid)
263 ctf_integer(u64, start, map->start)
264 ctf_integer(u64, len, map->len)
265 ctf_integer(u64, orig_start, map->orig_start)
266 ctf_integer(u64, block_start, map->block_start)
267 ctf_integer(u64, block_len, map->block_len)
268 ctf_integer(unsigned long, flags, map->flags)
269 ctf_integer(int, refs, atomic_read(&map->refs))
270 ctf_integer(unsigned int, compress_type, map->compress_type)
271 )
272 )
273
274 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
275
276 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0))
277 LTTNG_TRACEPOINT_EVENT(btrfs_handle_em_exist,
278
279 TP_PROTO(const struct extent_map *existing, const struct extent_map *map, u64 start, u64 len),
280
281 TP_ARGS(existing, map, start, len),
282
283 TP_FIELDS(
284 ctf_integer(u64, e_start, existing->start)
285 ctf_integer(u64, e_len, existing->len)
286 ctf_integer(u64, map_start, map->start)
287 ctf_integer(u64, map_len, map->len)
288 ctf_integer(u64, start, start)
289 ctf_integer(u64, len, len)
290 )
291 )
292 #endif
293
294 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
295 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__file_extent_item_regular,
296
297 TP_PROTO(struct btrfs_inode *bi, struct extent_buffer *l,
298 struct btrfs_file_extent_item *fi, u64 start),
299
300 TP_ARGS(bi, l, fi, start),
301
302 TP_FIELDS(
303 ctf_array(u8, fsid, bi->root->fs_info, BTRFS_FSID_SIZE)
304 ctf_integer(u64, root_obj, bi->root->objectid)
305 ctf_integer(u64, ino, btrfs_ino(bi))
306 ctf_integer(loff_t, isize, bi->vfs_inode.i_size)
307 ctf_integer(u64, disk_isize, bi->disk_i_size)
308 ctf_integer(u64, num_bytes, btrfs_file_extent_num_bytes(l, fi))
309 ctf_integer(u64, ram_bytes, btrfs_file_extent_ram_bytes(l, fi))
310 ctf_integer(u64, disk_bytenr, btrfs_file_extent_disk_bytenr(l, fi))
311 ctf_integer(u64, disk_num_bytes, btrfs_file_extent_disk_num_bytes(l, fi))
312 ctf_integer(u64, extent_offset, btrfs_file_extent_offset(l, fi))
313 ctf_integer(u8, extent_type, btrfs_file_extent_type(l, fi))
314 ctf_integer(u8, compression, btrfs_file_extent_compression(l, fi))
315 ctf_integer(u64, extent_start, start)
316 ctf_integer(u64, extent_end, (start + btrfs_file_extent_num_bytes(l, fi)))
317 )
318 )
319
320 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__file_extent_item_inline,
321
322 TP_PROTO(struct btrfs_inode *bi, struct extent_buffer *l,
323 struct btrfs_file_extent_item *fi, int slot, u64 start),
324
325 TP_ARGS(bi, l, fi, slot, start),
326
327 TP_FIELDS(
328 ctf_array(u8, fsid, bi->root->fs_info, BTRFS_FSID_SIZE)
329 ctf_integer(u64, root_obj, bi->root->objectid)
330 ctf_integer(u64, ino, btrfs_ino(bi))
331 ctf_integer(loff_t, isize, bi->vfs_inode.i_size)
332 ctf_integer(u64, disk_isize, bi->disk_i_size)
333 ctf_integer(u8, extent_type, btrfs_file_extent_type(l, fi))
334 ctf_integer(u8, compression, btrfs_file_extent_compression(l, fi))
335 ctf_integer(u64, extent_start, start)
336 ctf_integer(u64, extent_end, (start + btrfs_file_extent_inline_len(l, slot, fi)))
337 )
338 )
339
340 LTTNG_TRACEPOINT_EVENT_INSTANCE(
341 btrfs__file_extent_item_regular, btrfs_get_extent_show_fi_regular,
342
343 TP_PROTO(struct btrfs_inode *bi, struct extent_buffer *l,
344 struct btrfs_file_extent_item *fi, u64 start),
345
346 TP_ARGS(bi, l, fi, start)
347 )
348
349 LTTNG_TRACEPOINT_EVENT_INSTANCE(
350 btrfs__file_extent_item_regular, btrfs_truncate_show_fi_regular,
351
352 TP_PROTO(struct btrfs_inode *bi, struct extent_buffer *l,
353 struct btrfs_file_extent_item *fi, u64 start),
354
355 TP_ARGS(bi, l, fi, start)
356 )
357
358 LTTNG_TRACEPOINT_EVENT_INSTANCE(
359 btrfs__file_extent_item_inline, btrfs_get_extent_show_fi_inline,
360
361 TP_PROTO(struct btrfs_inode *bi, struct extent_buffer *l,
362 struct btrfs_file_extent_item *fi, int slot, u64 start),
363
364 TP_ARGS(bi, l, fi, slot, start)
365 )
366
367 LTTNG_TRACEPOINT_EVENT_INSTANCE(
368 btrfs__file_extent_item_inline, btrfs_truncate_show_fi_inline,
369
370 TP_PROTO(struct btrfs_inode *bi, struct extent_buffer *l,
371 struct btrfs_file_extent_item *fi, int slot, u64 start),
372
373 TP_ARGS(bi, l, fi, slot, start)
374 )
375 #endif
376
377 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
378 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
379
380 TP_PROTO(const struct inode *inode,
381 const struct btrfs_ordered_extent *ordered),
382
383 TP_ARGS(inode, ordered),
384
385 TP_FIELDS(
386 ctf_integer(ino_t, ino, inode->i_ino)
387 ctf_integer(u64, file_offset, ordered->file_offset)
388 ctf_integer(u64, start, ordered->start)
389 ctf_integer(u64, len, ordered->len)
390 ctf_integer(u64, disk_len, ordered->disk_len)
391 ctf_integer(u64, bytes_left, ordered->bytes_left)
392 ctf_integer(unsigned long, flags, ordered->flags)
393 ctf_integer(int, compress_type, ordered->compress_type)
394 ctf_integer(int, refs, refcount_read(&ordered->refs))
395 ctf_integer(u64, root_objectid,
396 BTRFS_I(inode)->root->root_key.objectid)
397 )
398 )
399 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
400 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
401
402 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
403
404 TP_ARGS(inode, ordered),
405
406 TP_FIELDS(
407 ctf_integer(ino_t, ino, inode->i_ino)
408 ctf_integer(u64, file_offset, ordered->file_offset)
409 ctf_integer(u64, start, ordered->start)
410 ctf_integer(u64, len, ordered->len)
411 ctf_integer(u64, disk_len, ordered->disk_len)
412 ctf_integer(u64, bytes_left, ordered->bytes_left)
413 ctf_integer(unsigned long, flags, ordered->flags)
414 ctf_integer(int, compress_type, ordered->compress_type)
415 ctf_integer(int, refs, refcount_read(&ordered->refs))
416 ctf_integer(u64, root_objectid,
417 BTRFS_I(inode)->root->root_key.objectid)
418 )
419 )
420 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
421 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
422
423 TP_PROTO(const struct inode *inode, const struct btrfs_ordered_extent *ordered),
424
425 TP_ARGS(inode, ordered),
426
427 TP_FIELDS(
428 ctf_integer(ino_t, ino, inode->i_ino)
429 ctf_integer(u64, file_offset, ordered->file_offset)
430 ctf_integer(u64, start, ordered->start)
431 ctf_integer(u64, len, ordered->len)
432 ctf_integer(u64, disk_len, ordered->disk_len)
433 ctf_integer(u64, bytes_left, ordered->bytes_left)
434 ctf_integer(unsigned long, flags, ordered->flags)
435 ctf_integer(int, compress_type, ordered->compress_type)
436 ctf_integer(int, refs, atomic_read(&ordered->refs))
437 ctf_integer(u64, root_objectid,
438 BTRFS_I(inode)->root->root_key.objectid)
439 )
440 )
441 #else
442 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
443
444 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
445
446 TP_ARGS(inode, ordered),
447
448 TP_FIELDS(
449 ctf_integer(ino_t, ino, inode->i_ino)
450 ctf_integer(u64, file_offset, ordered->file_offset)
451 ctf_integer(u64, start, ordered->start)
452 ctf_integer(u64, len, ordered->len)
453 ctf_integer(u64, disk_len, ordered->disk_len)
454 ctf_integer(u64, bytes_left, ordered->bytes_left)
455 ctf_integer(unsigned long, flags, ordered->flags)
456 ctf_integer(int, compress_type, ordered->compress_type)
457 ctf_integer(int, refs, atomic_read(&ordered->refs))
458 ctf_integer(u64, root_objectid,
459 BTRFS_I(inode)->root->root_key.objectid)
460 )
461 )
462 #endif
463
464 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
465 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
466 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_add,
467
468 TP_PROTO(const struct inode *inode,
469 const struct btrfs_ordered_extent *ordered),
470
471 TP_ARGS(inode, ordered)
472 )
473
474 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_remove,
475
476 TP_PROTO(const struct inode *inode,
477 const struct btrfs_ordered_extent *ordered),
478
479 TP_ARGS(inode, ordered)
480 )
481
482 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_start,
483
484 TP_PROTO(const struct inode *inode,
485 const struct btrfs_ordered_extent *ordered),
486
487 TP_ARGS(inode, ordered)
488 )
489
490 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_put,
491
492 TP_PROTO(const struct inode *inode,
493 const struct btrfs_ordered_extent *ordered),
494
495 TP_ARGS(inode, ordered)
496 )
497
498 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__writepage,
499
500 TP_PROTO(const struct page *page, const struct inode *inode,
501 const struct writeback_control *wbc),
502
503 TP_ARGS(page, inode, wbc),
504
505 TP_FIELDS(
506 ctf_integer(ino_t, ino, inode->i_ino)
507 ctf_integer(pgoff_t, index, page->index)
508 ctf_integer(long, nr_to_write, wbc->nr_to_write)
509 ctf_integer(long, pages_skipped, wbc->pages_skipped)
510 ctf_integer(loff_t, range_start, wbc->range_start)
511 ctf_integer(loff_t, range_end, wbc->range_end)
512 ctf_integer(char, for_kupdate, wbc->for_kupdate)
513 ctf_integer(char, for_reclaim, wbc->for_reclaim)
514 ctf_integer(char, range_cyclic, wbc->range_cyclic)
515 ctf_integer(pgoff_t, writeback_index,
516 inode->i_mapping->writeback_index)
517 ctf_integer(u64, root_objectid,
518 BTRFS_I(inode)->root->root_key.objectid)
519 )
520 )
521
522 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs__writepage,
523
524 __extent_writepage,
525
526 btrfs__extent_writepage,
527
528 TP_PROTO(const struct page *page, const struct inode *inode,
529 const struct writeback_control *wbc),
530
531 TP_ARGS(page, inode, wbc)
532 )
533
534 LTTNG_TRACEPOINT_EVENT(btrfs_writepage_end_io_hook,
535
536 TP_PROTO(const struct page *page, u64 start, u64 end, int uptodate),
537
538 TP_ARGS(page, start, end, uptodate),
539
540 TP_FIELDS(
541 ctf_integer(ino_t, ino, page->mapping->host->i_ino)
542 ctf_integer(pgoff_t, index, page->index)
543 ctf_integer(u64, start, start)
544 ctf_integer(u64, end, end)
545 ctf_integer(int, uptodate, uptodate)
546 ctf_integer(u64, root_objectid,
547 BTRFS_I(page->mapping->host)->root->root_key.objectid)
548 )
549 )
550
551 LTTNG_TRACEPOINT_EVENT(btrfs_sync_file,
552
553 TP_PROTO(const struct file *file, int datasync),
554
555 TP_ARGS(file, datasync),
556
557 TP_FIELDS(
558 ctf_integer(ino_t, ino, file->f_path.dentry->d_inode->i_ino)
559 ctf_integer(ino_t, parent, file->f_path.dentry->d_parent->d_inode->i_ino)
560 ctf_integer(int, datasync, datasync)
561 ctf_integer(u64, root_objectid,
562 BTRFS_I(file->f_path.dentry->d_inode)->root->root_key.objectid)
563 )
564 )
565 #else
566 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_add,
567
568 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
569
570 TP_ARGS(inode, ordered)
571 )
572
573 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_remove,
574
575 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
576
577 TP_ARGS(inode, ordered)
578 )
579
580 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_start,
581
582 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
583
584 TP_ARGS(inode, ordered)
585 )
586
587 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_put,
588
589 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
590
591 TP_ARGS(inode, ordered)
592 )
593
594 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__writepage,
595
596 TP_PROTO(struct page *page, struct inode *inode,
597 struct writeback_control *wbc),
598
599 TP_ARGS(page, inode, wbc),
600
601 TP_FIELDS(
602 ctf_integer(ino_t, ino, inode->i_ino)
603 ctf_integer(pgoff_t, index, page->index)
604 ctf_integer(long, nr_to_write, wbc->nr_to_write)
605 ctf_integer(long, pages_skipped, wbc->pages_skipped)
606 ctf_integer(loff_t, range_start, wbc->range_start)
607 ctf_integer(loff_t, range_end, wbc->range_end)
608 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0))
609 ctf_integer(char, nonblocking, wbc->nonblocking)
610 #endif
611 ctf_integer(char, for_kupdate, wbc->for_kupdate)
612 ctf_integer(char, for_reclaim, wbc->for_reclaim)
613 ctf_integer(char, range_cyclic, wbc->range_cyclic)
614 ctf_integer(pgoff_t, writeback_index,
615 inode->i_mapping->writeback_index)
616 ctf_integer(u64, root_objectid,
617 BTRFS_I(inode)->root->root_key.objectid)
618 )
619 )
620
621 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs__writepage,
622
623 __extent_writepage,
624
625 btrfs__extent_writepage,
626
627 TP_PROTO(struct page *page, struct inode *inode,
628 struct writeback_control *wbc),
629
630 TP_ARGS(page, inode, wbc)
631 )
632
633 LTTNG_TRACEPOINT_EVENT(btrfs_writepage_end_io_hook,
634
635 TP_PROTO(struct page *page, u64 start, u64 end, int uptodate),
636
637 TP_ARGS(page, start, end, uptodate),
638
639 TP_FIELDS(
640 ctf_integer(ino_t, ino, page->mapping->host->i_ino)
641 ctf_integer(pgoff_t, index, page->index)
642 ctf_integer(u64, start, start)
643 ctf_integer(u64, end, end)
644 ctf_integer(int, uptodate, uptodate)
645 ctf_integer(u64, root_objectid,
646 BTRFS_I(page->mapping->host)->root->root_key.objectid)
647 )
648 )
649
650 LTTNG_TRACEPOINT_EVENT(btrfs_sync_file,
651
652 TP_PROTO(struct file *file, int datasync),
653
654 TP_ARGS(file, datasync),
655
656 TP_FIELDS(
657 ctf_integer(ino_t, ino, file->f_path.dentry->d_inode->i_ino)
658 ctf_integer(ino_t, parent, file->f_path.dentry->d_parent->d_inode->i_ino)
659 ctf_integer(int, datasync, datasync)
660 ctf_integer(u64, root_objectid,
661 BTRFS_I(file->f_path.dentry->d_inode)->root->root_key.objectid)
662 )
663 )
664 #endif
665
666 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
667 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,114,92,0,0))
668 LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs,
669
670 TP_PROTO(const struct btrfs_fs_info *fs_info, int wait),
671
672 TP_ARGS(fs_info, wait),
673
674 TP_FIELDS(
675 ctf_integer(int, wait, wait)
676 )
677 )
678 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
679 LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs,
680
681 TP_PROTO(struct btrfs_fs_info *fs_info, int wait),
682
683 TP_ARGS(fs_info, wait),
684
685 TP_FIELDS(
686 ctf_integer(int, wait, wait)
687 )
688 )
689 #else
690 LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs,
691
692 TP_PROTO(int wait),
693
694 TP_ARGS(wait),
695
696 TP_FIELDS(
697 ctf_integer(int, wait, wait)
698 )
699 )
700 #endif
701
702 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
703 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
704 LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group,
705
706 TP_PROTO(const struct btrfs_fs_info *fs_info,
707 const struct btrfs_block_group_cache *block_group, int create),
708
709 TP_ARGS(fs_info, block_group, create),
710
711 TP_FIELDS(
712 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
713 ctf_integer(u64, offset, block_group->key.objectid)
714 ctf_integer(u64, size, block_group->key.offset)
715 ctf_integer(u64, flags, block_group->flags)
716 ctf_integer(u64, bytes_used, btrfs_block_group_used(&block_group->item))
717 ctf_integer(u64, bytes_super, block_group->bytes_super)
718 ctf_integer(int, create, create)
719 )
720 )
721 #else
722 LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group,
723
724 TP_PROTO(struct btrfs_fs_info *fs_info,
725 struct btrfs_block_group_cache *block_group, int create),
726
727 TP_ARGS(fs_info, block_group, create),
728
729 TP_FIELDS(
730 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
731 ctf_integer(u64, offset, block_group->key.objectid)
732 ctf_integer(u64, size, block_group->key.offset)
733 ctf_integer(u64, flags, block_group->flags)
734 ctf_integer(u64, bytes_used, btrfs_block_group_used(&block_group->item))
735 ctf_integer(u64, bytes_super, block_group->bytes_super)
736 ctf_integer(int, create, create)
737 )
738 )
739 #endif
740
741 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
742 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref,
743
744 TP_PROTO(const struct btrfs_fs_info *fs_info,
745 const struct btrfs_delayed_ref_node *ref,
746 const struct btrfs_delayed_tree_ref *full_ref,
747 int action),
748
749 TP_ARGS(fs_info, ref, full_ref, action),
750
751 TP_FIELDS(
752 ctf_integer(u64, bytenr, ref->bytenr)
753 ctf_integer(u64, num_bytes, ref->num_bytes)
754 ctf_integer(int, action, action)
755 ctf_integer(u64, parent, full_ref->parent)
756 ctf_integer(u64, ref_root, full_ref->root)
757 ctf_integer(int, level, full_ref->level)
758 ctf_integer(int, type, ref->type)
759 ctf_integer(u64, seq, ref->seq)
760 )
761 )
762 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
763 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref,
764
765 TP_PROTO(struct btrfs_fs_info *fs_info,
766 struct btrfs_delayed_ref_node *ref,
767 struct btrfs_delayed_tree_ref *full_ref,
768 int action),
769
770 TP_ARGS(fs_info, ref, full_ref, action),
771
772 TP_FIELDS(
773 ctf_integer(u64, bytenr, ref->bytenr)
774 ctf_integer(u64, num_bytes, ref->num_bytes)
775 ctf_integer(int, action, action)
776 ctf_integer(u64, parent, full_ref->parent)
777 ctf_integer(u64, ref_root, full_ref->root)
778 ctf_integer(int, level, full_ref->level)
779 ctf_integer(int, type, ref->type)
780 ctf_integer(u64, seq, ref->seq)
781 )
782 )
783 #else
784 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref,
785
786 TP_PROTO(struct btrfs_delayed_ref_node *ref,
787 struct btrfs_delayed_tree_ref *full_ref,
788 int action),
789
790 TP_ARGS(ref, full_ref, action),
791
792 TP_FIELDS(
793 ctf_integer(u64, bytenr, ref->bytenr)
794 ctf_integer(u64, num_bytes, ref->num_bytes)
795 ctf_integer(int, action, action)
796 ctf_integer(u64, parent, full_ref->parent)
797 ctf_integer(u64, ref_root, full_ref->root)
798 ctf_integer(int, level, full_ref->level)
799 ctf_integer(int, type, ref->type)
800 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
801 ctf_integer(u64, seq, ref->seq)
802 #endif
803 )
804 )
805 #endif
806
807 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_data_ref,
808
809 TP_PROTO(struct btrfs_delayed_ref_node *ref,
810 struct btrfs_delayed_data_ref *full_ref,
811 int action),
812
813 TP_ARGS(ref, full_ref, action),
814
815 TP_FIELDS(
816 ctf_integer(u64, bytenr, ref->bytenr)
817 ctf_integer(u64, num_bytes, ref->num_bytes)
818 ctf_integer(int, action, action)
819 ctf_integer(u64, parent, full_ref->parent)
820 ctf_integer(u64, ref_root, full_ref->root)
821 ctf_integer(u64, owner, full_ref->objectid)
822 ctf_integer(u64, offset, full_ref->offset)
823 ctf_integer(int, type, ref->type)
824 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
825 ctf_integer(u64, seq, ref->seq)
826 #endif
827 )
828 )
829
830 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0))
831 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head,
832
833 TP_PROTO(const struct btrfs_fs_info *fs_info,
834 const struct btrfs_delayed_ref_head *head_ref,
835 int action),
836
837 TP_ARGS(fs_info, head_ref, action),
838
839 TP_FIELDS(
840 ctf_integer(u64, bytenr, head_ref->bytenr)
841 ctf_integer(u64, num_bytes, head_ref->num_bytes)
842 ctf_integer(int, action, action)
843 ctf_integer(int, is_data, head_ref->is_data)
844 )
845 )
846
847 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head,
848
849 add_delayed_ref_head,
850
851 btrfs_add_delayed_ref_head,
852
853 TP_PROTO(const struct btrfs_fs_info *fs_info,
854 const struct btrfs_delayed_ref_head *head_ref,
855 int action),
856
857 TP_ARGS(fs_info, head_ref, action)
858 )
859
860 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head,
861
862 run_delayed_ref_head,
863
864 btrfs_run_delayed_ref_head,
865
866 TP_PROTO(const struct btrfs_fs_info *fs_info,
867 const struct btrfs_delayed_ref_head *head_ref,
868 int action),
869
870 TP_ARGS(fs_info, head_ref, action)
871 )
872
873 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
874 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,114,92,0,0))
875 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head,
876
877 TP_PROTO(const struct btrfs_fs_info *fs_info,
878 const struct btrfs_delayed_ref_node *ref,
879 const struct btrfs_delayed_ref_head *head_ref,
880 int action),
881
882 TP_ARGS(fs_info, ref, head_ref, action),
883
884 TP_FIELDS(
885 ctf_integer(u64, bytenr, ref->bytenr)
886 ctf_integer(u64, num_bytes, ref->num_bytes)
887 ctf_integer(int, action, action)
888 ctf_integer(int, is_data, head_ref->is_data)
889 )
890 )
891
892 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head,
893
894 add_delayed_ref_head,
895
896 btrfs_add_delayed_ref_head,
897
898 TP_PROTO(const struct btrfs_fs_info *fs_info,
899 const struct btrfs_delayed_ref_node *ref,
900 const struct btrfs_delayed_ref_head *head_ref,
901 int action),
902
903 TP_ARGS(fs_info, ref, head_ref, action)
904 )
905
906 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head,
907
908 run_delayed_ref_head,
909
910 btrfs_run_delayed_ref_head,
911
912 TP_PROTO(const struct btrfs_fs_info *fs_info,
913 const struct btrfs_delayed_ref_node *ref,
914 const struct btrfs_delayed_ref_head *head_ref,
915 int action),
916
917 TP_ARGS(fs_info, ref, head_ref, action)
918 )
919
920 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
921 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head,
922
923 TP_PROTO(struct btrfs_fs_info *fs_info,
924 struct btrfs_delayed_ref_node *ref,
925 struct btrfs_delayed_ref_head *head_ref,
926 int action),
927
928 TP_ARGS(fs_info, ref, head_ref, action),
929
930 TP_FIELDS(
931 ctf_integer(u64, bytenr, ref->bytenr)
932 ctf_integer(u64, num_bytes, ref->num_bytes)
933 ctf_integer(int, action, action)
934 ctf_integer(int, is_data, head_ref->is_data)
935 )
936 )
937
938 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head,
939
940 add_delayed_ref_head,
941
942 btrfs_add_delayed_ref_head,
943
944 TP_PROTO(struct btrfs_fs_info *fs_info,
945 struct btrfs_delayed_ref_node *ref,
946 struct btrfs_delayed_ref_head *head_ref,
947 int action),
948
949 TP_ARGS(fs_info, ref, head_ref, action)
950 )
951
952 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head,
953
954 run_delayed_ref_head,
955
956 btrfs_run_delayed_ref_head,
957
958 TP_PROTO(struct btrfs_fs_info *fs_info,
959 struct btrfs_delayed_ref_node *ref,
960 struct btrfs_delayed_ref_head *head_ref,
961 int action),
962
963 TP_ARGS(fs_info, ref, head_ref, action)
964 )
965
966 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,114,92,0,0, 4,5,0,0,0,0))
967 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head,
968
969 TP_PROTO(const struct btrfs_delayed_ref_node *ref,
970 const struct btrfs_delayed_ref_head *head_ref,
971 int action),
972
973 TP_ARGS(ref, head_ref, action),
974
975 TP_FIELDS(
976 ctf_integer(u64, bytenr, ref->bytenr)
977 ctf_integer(u64, num_bytes, ref->num_bytes)
978 ctf_integer(int, action, action)
979 ctf_integer(int, is_data, head_ref->is_data)
980 )
981 )
982
983 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head,
984
985 add_delayed_ref_head,
986
987 btrfs_add_delayed_ref_head,
988
989 TP_PROTO(const struct btrfs_delayed_ref_node *ref,
990 const struct btrfs_delayed_ref_head *head_ref,
991 int action),
992
993 TP_ARGS(ref, head_ref, action)
994 )
995
996 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head,
997
998 run_delayed_ref_head,
999
1000 btrfs_run_delayed_ref_head,
1001
1002 TP_PROTO(const struct btrfs_delayed_ref_node *ref,
1003 const struct btrfs_delayed_ref_head *head_ref,
1004 int action),
1005
1006 TP_ARGS(ref, head_ref, action)
1007 )
1008
1009 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
1010 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head,
1011
1012 TP_PROTO(struct btrfs_delayed_ref_node *ref,
1013 struct btrfs_delayed_ref_head *head_ref,
1014 int action),
1015
1016 TP_ARGS(ref, head_ref, action),
1017
1018 TP_FIELDS(
1019 ctf_integer(u64, bytenr, ref->bytenr)
1020 ctf_integer(u64, num_bytes, ref->num_bytes)
1021 ctf_integer(int, action, action)
1022 ctf_integer(int, is_data, head_ref->is_data)
1023 )
1024 )
1025
1026 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head,
1027
1028 add_delayed_ref_head,
1029
1030 btrfs_add_delayed_ref_head,
1031
1032 TP_PROTO(struct btrfs_delayed_ref_node *ref,
1033 struct btrfs_delayed_ref_head *head_ref,
1034 int action),
1035
1036 TP_ARGS(ref, head_ref, action)
1037 )
1038
1039 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_ref_head,
1040
1041 run_delayed_ref_head,
1042
1043 btrfs_run_delayed_ref_head,
1044
1045 TP_PROTO(struct btrfs_delayed_ref_node *ref,
1046 struct btrfs_delayed_ref_head *head_ref,
1047 int action),
1048
1049 TP_ARGS(ref, head_ref, action)
1050 )
1051
1052 #else
1053 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_ref_head,
1054
1055 TP_PROTO(struct btrfs_delayed_ref_node *ref,
1056 struct btrfs_delayed_ref_head *head_ref,
1057 int action),
1058
1059 TP_ARGS(ref, head_ref, action),
1060
1061 TP_FIELDS(
1062 ctf_integer(u64, bytenr, ref->bytenr)
1063 ctf_integer(u64, num_bytes, ref->num_bytes)
1064 ctf_integer(int, action, action)
1065 ctf_integer(int, is_data, head_ref->is_data)
1066 )
1067 )
1068 #endif
1069
1070 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1071
1072 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
1073
1074 TP_PROTO(const struct btrfs_fs_info *fs_info, const struct map_lookup *map,
1075 u64 offset, u64 size),
1076
1077 TP_ARGS(fs_info, map, offset, size),
1078
1079 TP_FIELDS(
1080 ctf_integer(int, num_stripes, map->num_stripes)
1081 ctf_integer(u64, type, map->type)
1082 ctf_integer(int, sub_stripes, map->sub_stripes)
1083 ctf_integer(u64, offset, offset)
1084 ctf_integer(u64, size, size)
1085 ctf_integer(u64, root_objectid, fs_info->chunk_root->root_key.objectid)
1086 )
1087 )
1088
1089 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc,
1090
1091 TP_PROTO(const struct btrfs_fs_info *info, const struct map_lookup *map,
1092 u64 offset, u64 size),
1093
1094 TP_ARGS(info, map, offset, size)
1095 )
1096
1097 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free,
1098
1099 TP_PROTO(const struct btrfs_fs_info *info, const struct map_lookup *map,
1100 u64 offset, u64 size),
1101
1102 TP_ARGS(info, map, offset, size)
1103 )
1104
1105 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
1106
1107 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
1108
1109 TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map,
1110 u64 offset, u64 size),
1111
1112 TP_ARGS(fs_info, map, offset, size),
1113
1114 TP_FIELDS(
1115 ctf_integer(int, num_stripes, map->num_stripes)
1116 ctf_integer(u64, type, map->type)
1117 ctf_integer(int, sub_stripes, map->sub_stripes)
1118 ctf_integer(u64, offset, offset)
1119 ctf_integer(u64, size, size)
1120 ctf_integer(u64, root_objectid, fs_info->chunk_root->root_key.objectid)
1121 )
1122 )
1123
1124 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc,
1125
1126 TP_PROTO(struct btrfs_fs_info *info, struct map_lookup *map,
1127 u64 offset, u64 size),
1128
1129 TP_ARGS(info, map, offset, size)
1130 )
1131
1132 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free,
1133
1134 TP_PROTO(struct btrfs_fs_info *info, struct map_lookup *map,
1135 u64 offset, u64 size),
1136
1137 TP_ARGS(info, map, offset, size)
1138 )
1139
1140 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1141
1142 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
1143
1144 TP_PROTO(const struct btrfs_root *root, const struct map_lookup *map,
1145 u64 offset, u64 size),
1146
1147 TP_ARGS(root, map, offset, size),
1148
1149 TP_FIELDS(
1150 ctf_integer(int, num_stripes, map->num_stripes)
1151 ctf_integer(u64, type, map->type)
1152 ctf_integer(int, sub_stripes, map->sub_stripes)
1153 ctf_integer(u64, offset, offset)
1154 ctf_integer(u64, size, size)
1155 ctf_integer(u64, root_objectid, root->root_key.objectid)
1156 )
1157 )
1158
1159 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc,
1160
1161 TP_PROTO(const struct btrfs_root *root, const struct map_lookup *map,
1162 u64 offset, u64 size),
1163
1164 TP_ARGS(root, map, offset, size)
1165 )
1166
1167 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free,
1168
1169 TP_PROTO(const struct btrfs_root *root, const struct map_lookup *map,
1170 u64 offset, u64 size),
1171
1172 TP_ARGS(root, map, offset, size)
1173 )
1174
1175 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1176
1177 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
1178
1179 TP_PROTO(struct btrfs_root *root, struct map_lookup *map,
1180 u64 offset, u64 size),
1181
1182 TP_ARGS(root, map, offset, size),
1183
1184 TP_FIELDS(
1185 ctf_integer(int, num_stripes, map->num_stripes)
1186 ctf_integer(u64, type, map->type)
1187 ctf_integer(int, sub_stripes, map->sub_stripes)
1188 ctf_integer(u64, offset, offset)
1189 ctf_integer(u64, size, size)
1190 ctf_integer(u64, root_objectid, root->root_key.objectid)
1191 )
1192 )
1193
1194 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc,
1195
1196 TP_PROTO(struct btrfs_root *root, struct map_lookup *map,
1197 u64 offset, u64 size),
1198
1199 TP_ARGS(root, map, offset, size)
1200 )
1201
1202 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free,
1203
1204 TP_PROTO(struct btrfs_root *root, struct map_lookup *map,
1205 u64 offset, u64 size),
1206
1207 TP_ARGS(root, map, offset, size)
1208 )
1209
1210 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1211
1212 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
1213 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1214 LTTNG_TRACEPOINT_EVENT(btrfs_cow_block,
1215
1216 TP_PROTO(const struct btrfs_root *root, const struct extent_buffer *buf,
1217 const struct extent_buffer *cow),
1218
1219 TP_ARGS(root, buf, cow),
1220
1221 TP_FIELDS(
1222 ctf_integer(u64, root_objectid, root->root_key.objectid)
1223 ctf_integer(u64, buf_start, buf->start)
1224 ctf_integer(int, refs, atomic_read(&buf->refs))
1225 ctf_integer(u64, cow_start, cow->start)
1226 ctf_integer(int, buf_level, btrfs_header_level(buf))
1227 ctf_integer(int, cow_level, btrfs_header_level(cow))
1228 )
1229 )
1230 #else
1231 LTTNG_TRACEPOINT_EVENT(btrfs_cow_block,
1232
1233 TP_PROTO(struct btrfs_root *root, struct extent_buffer *buf,
1234 struct extent_buffer *cow),
1235
1236 TP_ARGS(root, buf, cow),
1237
1238 TP_FIELDS(
1239 ctf_integer(u64, root_objectid, root->root_key.objectid)
1240 ctf_integer(u64, buf_start, buf->start)
1241 ctf_integer(int, refs, atomic_read(&buf->refs))
1242 ctf_integer(u64, cow_start, cow->start)
1243 ctf_integer(int, buf_level, btrfs_header_level(buf))
1244 ctf_integer(int, cow_level, btrfs_header_level(cow))
1245 )
1246 )
1247 #endif
1248
1249 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
1250 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1251 LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation,
1252
1253 TP_PROTO(const struct btrfs_fs_info *fs_info, char *type, u64 val,
1254 u64 bytes, int reserve),
1255
1256 TP_ARGS(fs_info, type, val, bytes, reserve),
1257
1258 TP_FIELDS(
1259 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
1260 ctf_string(type, type)
1261 ctf_integer(u64, val, val)
1262 ctf_integer(u64, bytes, bytes)
1263 ctf_integer(int, reserve, reserve)
1264 )
1265 )
1266 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
1267 LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation,
1268
1269 TP_PROTO(struct btrfs_fs_info *fs_info, char *type, u64 val,
1270 u64 bytes, int reserve),
1271
1272 TP_ARGS(fs_info, type, val, bytes, reserve),
1273
1274 TP_FIELDS(
1275 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
1276 ctf_string(type, type)
1277 ctf_integer(u64, val, val)
1278 ctf_integer(u64, bytes, bytes)
1279 ctf_integer(int, reserve, reserve)
1280 )
1281 )
1282 #endif
1283
1284 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1285
1286 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
1287
1288 TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len),
1289
1290 TP_ARGS(info, start, len),
1291
1292 TP_FIELDS(
1293 ctf_integer(u64, start, start)
1294 ctf_integer(u64, len, len)
1295 )
1296 )
1297
1298 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
1299
1300 TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len),
1301
1302 TP_ARGS(info, start, len)
1303 )
1304
1305 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free,
1306
1307 TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len),
1308
1309 TP_ARGS(info, start, len)
1310 )
1311
1312 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
1313
1314 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
1315
1316 TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len),
1317
1318 TP_ARGS(info, start, len),
1319
1320 TP_FIELDS(
1321 ctf_integer(u64, start, start)
1322 ctf_integer(u64, len, len)
1323 )
1324 )
1325
1326 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
1327
1328 TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len),
1329
1330 TP_ARGS(info, start, len)
1331 )
1332
1333 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free,
1334
1335 TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len),
1336
1337 TP_ARGS(info, start, len)
1338 )
1339
1340 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1341
1342 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
1343
1344 TP_PROTO(const struct btrfs_root *root, u64 start, u64 len),
1345
1346 TP_ARGS(root, start, len),
1347
1348 TP_FIELDS(
1349 ctf_integer(u64, root_objectid, root->root_key.objectid)
1350 ctf_integer(u64, start, start)
1351 ctf_integer(u64, len, len)
1352 )
1353 )
1354
1355 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
1356
1357 TP_PROTO(const struct btrfs_root *root, u64 start, u64 len),
1358
1359 TP_ARGS(root, start, len)
1360 )
1361
1362 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free,
1363
1364 TP_PROTO(const struct btrfs_root *root, u64 start, u64 len),
1365
1366 TP_ARGS(root, start, len)
1367 )
1368
1369 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1370
1371 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
1372
1373 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
1374
1375 TP_ARGS(root, start, len),
1376
1377 TP_FIELDS(
1378 ctf_integer(u64, root_objectid, root->root_key.objectid)
1379 ctf_integer(u64, start, start)
1380 ctf_integer(u64, len, len)
1381 )
1382 )
1383
1384 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
1385
1386 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
1387
1388 TP_ARGS(root, start, len)
1389 )
1390
1391 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free,
1392
1393 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
1394
1395 TP_ARGS(root, start, len)
1396 )
1397
1398 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1399
1400 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1401
1402 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
1403
1404 btrfs_find_free_extent,
1405
1406 TP_PROTO(const struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size,
1407 u64 data),
1408
1409 TP_ARGS(info, num_bytes, empty_size, data),
1410
1411 TP_FIELDS(
1412 ctf_integer(u64, num_bytes, num_bytes)
1413 ctf_integer(u64, empty_size, empty_size)
1414 ctf_integer(u64, data, data)
1415 )
1416 )
1417
1418 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
1419
1420 TP_PROTO(const struct btrfs_fs_info *info,
1421 const struct btrfs_block_group_cache *block_group, u64 start,
1422 u64 len),
1423
1424 TP_ARGS(info, block_group, start, len),
1425
1426 TP_FIELDS(
1427 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1428 ctf_integer(u64, flags, block_group->flags)
1429 ctf_integer(u64, start, start)
1430 ctf_integer(u64, len, len)
1431 )
1432 )
1433
1434 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
1435
1436 TP_PROTO(const struct btrfs_fs_info *info,
1437 const struct btrfs_block_group_cache *block_group, u64 start,
1438 u64 len),
1439
1440 TP_ARGS(info, block_group, start, len)
1441 )
1442
1443 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
1444
1445 TP_PROTO(const struct btrfs_fs_info *info,
1446 const struct btrfs_block_group_cache *block_group, u64 start,
1447 u64 len),
1448
1449 TP_ARGS(info, block_group, start, len)
1450 )
1451
1452 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
1453
1454 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
1455
1456 btrfs_find_free_extent,
1457
1458 TP_PROTO(struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size,
1459 u64 data),
1460
1461 TP_ARGS(info, num_bytes, empty_size, data),
1462
1463 TP_FIELDS(
1464 ctf_integer(u64, num_bytes, num_bytes)
1465 ctf_integer(u64, empty_size, empty_size)
1466 ctf_integer(u64, data, data)
1467 )
1468 )
1469
1470 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
1471
1472 TP_PROTO(struct btrfs_fs_info *info,
1473 struct btrfs_block_group_cache *block_group, u64 start,
1474 u64 len),
1475
1476 TP_ARGS(info, block_group, start, len),
1477
1478 TP_FIELDS(
1479 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1480 ctf_integer(u64, flags, block_group->flags)
1481 ctf_integer(u64, start, start)
1482 ctf_integer(u64, len, len)
1483 )
1484 )
1485
1486 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
1487
1488 TP_PROTO(struct btrfs_fs_info *info,
1489 struct btrfs_block_group_cache *block_group, u64 start,
1490 u64 len),
1491
1492 TP_ARGS(info, block_group, start, len)
1493 )
1494
1495 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
1496
1497 TP_PROTO(struct btrfs_fs_info *info,
1498 struct btrfs_block_group_cache *block_group, u64 start,
1499 u64 len),
1500
1501 TP_ARGS(info, block_group, start, len)
1502 )
1503 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1504
1505 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
1506
1507 btrfs_find_free_extent,
1508
1509 TP_PROTO(const struct btrfs_root *root, u64 num_bytes, u64 empty_size,
1510 u64 data),
1511
1512 TP_ARGS(root, num_bytes, empty_size, data),
1513
1514 TP_FIELDS(
1515 ctf_integer(u64, root_objectid, root->root_key.objectid)
1516 ctf_integer(u64, num_bytes, num_bytes)
1517 ctf_integer(u64, empty_size, empty_size)
1518 ctf_integer(u64, data, data)
1519 )
1520 )
1521
1522 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
1523
1524 TP_PROTO(const struct btrfs_root *root,
1525 const struct btrfs_block_group_cache *block_group, u64 start,
1526 u64 len),
1527
1528 TP_ARGS(root, block_group, start, len),
1529
1530 TP_FIELDS(
1531 ctf_integer(u64, root_objectid, root->root_key.objectid)
1532 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1533 ctf_integer(u64, flags, block_group->flags)
1534 ctf_integer(u64, start, start)
1535 ctf_integer(u64, len, len)
1536 )
1537 )
1538
1539 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
1540
1541 TP_PROTO(const struct btrfs_root *root,
1542 const struct btrfs_block_group_cache *block_group, u64 start,
1543 u64 len),
1544
1545 TP_ARGS(root, block_group, start, len)
1546 )
1547
1548 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
1549
1550 TP_PROTO(const struct btrfs_root *root,
1551 const struct btrfs_block_group_cache *block_group, u64 start,
1552 u64 len),
1553
1554 TP_ARGS(root, block_group, start, len)
1555 )
1556
1557 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
1558
1559 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
1560
1561 btrfs_find_free_extent,
1562
1563 TP_PROTO(struct btrfs_root *root, u64 num_bytes, u64 empty_size,
1564 u64 data),
1565
1566 TP_ARGS(root, num_bytes, empty_size, data),
1567
1568 TP_FIELDS(
1569 ctf_integer(u64, root_objectid, root->root_key.objectid)
1570 ctf_integer(u64, num_bytes, num_bytes)
1571 ctf_integer(u64, empty_size, empty_size)
1572 ctf_integer(u64, data, data)
1573 )
1574 )
1575
1576 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
1577
1578 TP_PROTO(struct btrfs_root *root,
1579 struct btrfs_block_group_cache *block_group, u64 start,
1580 u64 len),
1581
1582 TP_ARGS(root, block_group, start, len),
1583
1584 TP_FIELDS(
1585 ctf_integer(u64, root_objectid, root->root_key.objectid)
1586 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1587 ctf_integer(u64, flags, block_group->flags)
1588 ctf_integer(u64, start, start)
1589 ctf_integer(u64, len, len)
1590 )
1591 )
1592
1593 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
1594
1595 TP_PROTO(struct btrfs_root *root,
1596 struct btrfs_block_group_cache *block_group, u64 start,
1597 u64 len),
1598
1599 TP_ARGS(root, block_group, start, len)
1600 )
1601
1602 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
1603
1604 TP_PROTO(struct btrfs_root *root,
1605 struct btrfs_block_group_cache *block_group, u64 start,
1606 u64 len),
1607
1608 TP_ARGS(root, block_group, start, len)
1609 )
1610
1611 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1612
1613 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
1614 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1615 LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster,
1616
1617 TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start,
1618 u64 bytes, u64 empty_size, u64 min_bytes),
1619
1620 TP_ARGS(block_group, start, bytes, empty_size, min_bytes),
1621
1622 TP_FIELDS(
1623 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1624 ctf_integer(u64, flags, block_group->flags)
1625 ctf_integer(u64, start, start)
1626 ctf_integer(u64, bytes, bytes)
1627 ctf_integer(u64, empty_size, empty_size)
1628 ctf_integer(u64, min_bytes, min_bytes)
1629 )
1630 )
1631
1632 LTTNG_TRACEPOINT_EVENT(btrfs_failed_cluster_setup,
1633
1634 TP_PROTO(const struct btrfs_block_group_cache *block_group),
1635
1636 TP_ARGS(block_group),
1637
1638 TP_FIELDS(
1639 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1640 )
1641 )
1642
1643 LTTNG_TRACEPOINT_EVENT(btrfs_setup_cluster,
1644
1645 TP_PROTO(const struct btrfs_block_group_cache *block_group,
1646 const struct btrfs_free_cluster *cluster, u64 size, int bitmap),
1647
1648 TP_ARGS(block_group, cluster, size, bitmap),
1649
1650 TP_FIELDS(
1651 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1652 ctf_integer(u64, flags, block_group->flags)
1653 ctf_integer(u64, start, cluster->window_start)
1654 ctf_integer(u64, max_size, cluster->max_size)
1655 ctf_integer(u64, size, size)
1656 ctf_integer(int, bitmap, bitmap)
1657 )
1658 )
1659 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
1660 LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster,
1661
1662 TP_PROTO(struct btrfs_block_group_cache *block_group, u64 start,
1663 u64 bytes, u64 empty_size, u64 min_bytes),
1664
1665 TP_ARGS(block_group, start, bytes, empty_size, min_bytes),
1666
1667 TP_FIELDS(
1668 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1669 ctf_integer(u64, flags, block_group->flags)
1670 ctf_integer(u64, start, start)
1671 ctf_integer(u64, bytes, bytes)
1672 ctf_integer(u64, empty_size, empty_size)
1673 ctf_integer(u64, min_bytes, min_bytes)
1674 )
1675 )
1676
1677 LTTNG_TRACEPOINT_EVENT(btrfs_failed_cluster_setup,
1678
1679 TP_PROTO(struct btrfs_block_group_cache *block_group),
1680
1681 TP_ARGS(block_group),
1682
1683 TP_FIELDS(
1684 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1685 )
1686 )
1687
1688 LTTNG_TRACEPOINT_EVENT(btrfs_setup_cluster,
1689
1690 TP_PROTO(struct btrfs_block_group_cache *block_group,
1691 struct btrfs_free_cluster *cluster, u64 size, int bitmap),
1692
1693 TP_ARGS(block_group, cluster, size, bitmap),
1694
1695 TP_FIELDS(
1696 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1697 ctf_integer(u64, flags, block_group->flags)
1698 ctf_integer(u64, start, cluster->window_start)
1699 ctf_integer(u64, max_size, cluster->max_size)
1700 ctf_integer(u64, size, size)
1701 ctf_integer(int, bitmap, bitmap)
1702 )
1703 )
1704 #endif
1705
1706 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
1707 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1708 LTTNG_TRACEPOINT_EVENT_MAP(alloc_extent_state,
1709
1710 btrfs_alloc_extent_state,
1711
1712 TP_PROTO(const struct extent_state *state, gfp_t mask, unsigned long IP),
1713
1714 TP_ARGS(state, mask, IP),
1715
1716 TP_FIELDS(
1717 ctf_integer_hex(const struct extent_state *, state, state)
1718 ctf_integer(gfp_t, mask, mask)
1719 ctf_integer(unsigned long, ip, IP)
1720 )
1721 )
1722
1723 LTTNG_TRACEPOINT_EVENT_MAP(free_extent_state,
1724
1725 btrfs_free_extent_state,
1726
1727 TP_PROTO(const struct extent_state *state, unsigned long IP),
1728
1729 TP_ARGS(state, IP),
1730
1731 TP_FIELDS(
1732 ctf_integer_hex(const struct extent_state *, state, state)
1733 ctf_integer(unsigned long, ip, IP)
1734 )
1735 )
1736 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
1737 LTTNG_TRACEPOINT_EVENT_MAP(alloc_extent_state,
1738
1739 btrfs_alloc_extent_state,
1740
1741 TP_PROTO(struct extent_state *state, gfp_t mask, unsigned long IP),
1742
1743 TP_ARGS(state, mask, IP),
1744
1745 TP_FIELDS(
1746 ctf_integer_hex(struct extent_state *, state, state)
1747 ctf_integer(gfp_t, mask, mask)
1748 ctf_integer(unsigned long, ip, IP)
1749 )
1750 )
1751
1752 LTTNG_TRACEPOINT_EVENT_MAP(free_extent_state,
1753
1754 btrfs_free_extent_state,
1755
1756 TP_PROTO(struct extent_state *state, unsigned long IP),
1757
1758 TP_ARGS(state, IP),
1759
1760 TP_FIELDS(
1761 ctf_integer_hex(struct extent_state *, state, state)
1762 ctf_integer(unsigned long, ip, IP)
1763 )
1764 )
1765 #endif
1766
1767 #endif /* LTTNG_TRACE_BTRFS_H */
1768
1769 /* This part must be outside protection */
1770 #include <probes/define_trace.h>
This page took 0.107221 seconds and 4 git commands to generate.