Fix: update btrfs instrumentation for SuSE 4.4.114-92
[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,14,0))
277 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
278
279 TP_PROTO(const struct inode *inode,
280 const struct btrfs_ordered_extent *ordered),
281
282 TP_ARGS(inode, ordered),
283
284 TP_FIELDS(
285 ctf_integer(ino_t, ino, inode->i_ino)
286 ctf_integer(u64, file_offset, ordered->file_offset)
287 ctf_integer(u64, start, ordered->start)
288 ctf_integer(u64, len, ordered->len)
289 ctf_integer(u64, disk_len, ordered->disk_len)
290 ctf_integer(u64, bytes_left, ordered->bytes_left)
291 ctf_integer(unsigned long, flags, ordered->flags)
292 ctf_integer(int, compress_type, ordered->compress_type)
293 ctf_integer(int, refs, refcount_read(&ordered->refs))
294 ctf_integer(u64, root_objectid,
295 BTRFS_I(inode)->root->root_key.objectid)
296 )
297 )
298 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
299 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
300
301 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
302
303 TP_ARGS(inode, ordered),
304
305 TP_FIELDS(
306 ctf_integer(ino_t, ino, inode->i_ino)
307 ctf_integer(u64, file_offset, ordered->file_offset)
308 ctf_integer(u64, start, ordered->start)
309 ctf_integer(u64, len, ordered->len)
310 ctf_integer(u64, disk_len, ordered->disk_len)
311 ctf_integer(u64, bytes_left, ordered->bytes_left)
312 ctf_integer(unsigned long, flags, ordered->flags)
313 ctf_integer(int, compress_type, ordered->compress_type)
314 ctf_integer(int, refs, refcount_read(&ordered->refs))
315 ctf_integer(u64, root_objectid,
316 BTRFS_I(inode)->root->root_key.objectid)
317 )
318 )
319 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
320 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
321
322 TP_PROTO(const struct inode *inode, const struct btrfs_ordered_extent *ordered),
323
324 TP_ARGS(inode, ordered),
325
326 TP_FIELDS(
327 ctf_integer(ino_t, ino, inode->i_ino)
328 ctf_integer(u64, file_offset, ordered->file_offset)
329 ctf_integer(u64, start, ordered->start)
330 ctf_integer(u64, len, ordered->len)
331 ctf_integer(u64, disk_len, ordered->disk_len)
332 ctf_integer(u64, bytes_left, ordered->bytes_left)
333 ctf_integer(unsigned long, flags, ordered->flags)
334 ctf_integer(int, compress_type, ordered->compress_type)
335 ctf_integer(int, refs, atomic_read(&ordered->refs))
336 ctf_integer(u64, root_objectid,
337 BTRFS_I(inode)->root->root_key.objectid)
338 )
339 )
340 #else
341 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
342
343 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
344
345 TP_ARGS(inode, ordered),
346
347 TP_FIELDS(
348 ctf_integer(ino_t, ino, inode->i_ino)
349 ctf_integer(u64, file_offset, ordered->file_offset)
350 ctf_integer(u64, start, ordered->start)
351 ctf_integer(u64, len, ordered->len)
352 ctf_integer(u64, disk_len, ordered->disk_len)
353 ctf_integer(u64, bytes_left, ordered->bytes_left)
354 ctf_integer(unsigned long, flags, ordered->flags)
355 ctf_integer(int, compress_type, ordered->compress_type)
356 ctf_integer(int, refs, atomic_read(&ordered->refs))
357 ctf_integer(u64, root_objectid,
358 BTRFS_I(inode)->root->root_key.objectid)
359 )
360 )
361 #endif
362
363 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
364 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
365 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_add,
366
367 TP_PROTO(const struct inode *inode,
368 const struct btrfs_ordered_extent *ordered),
369
370 TP_ARGS(inode, ordered)
371 )
372
373 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_remove,
374
375 TP_PROTO(const struct inode *inode,
376 const struct btrfs_ordered_extent *ordered),
377
378 TP_ARGS(inode, ordered)
379 )
380
381 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_start,
382
383 TP_PROTO(const struct inode *inode,
384 const struct btrfs_ordered_extent *ordered),
385
386 TP_ARGS(inode, ordered)
387 )
388
389 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_put,
390
391 TP_PROTO(const struct inode *inode,
392 const struct btrfs_ordered_extent *ordered),
393
394 TP_ARGS(inode, ordered)
395 )
396
397 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__writepage,
398
399 TP_PROTO(const struct page *page, const struct inode *inode,
400 const struct writeback_control *wbc),
401
402 TP_ARGS(page, inode, wbc),
403
404 TP_FIELDS(
405 ctf_integer(ino_t, ino, inode->i_ino)
406 ctf_integer(pgoff_t, index, page->index)
407 ctf_integer(long, nr_to_write, wbc->nr_to_write)
408 ctf_integer(long, pages_skipped, wbc->pages_skipped)
409 ctf_integer(loff_t, range_start, wbc->range_start)
410 ctf_integer(loff_t, range_end, wbc->range_end)
411 ctf_integer(char, for_kupdate, wbc->for_kupdate)
412 ctf_integer(char, for_reclaim, wbc->for_reclaim)
413 ctf_integer(char, range_cyclic, wbc->range_cyclic)
414 ctf_integer(pgoff_t, writeback_index,
415 inode->i_mapping->writeback_index)
416 ctf_integer(u64, root_objectid,
417 BTRFS_I(inode)->root->root_key.objectid)
418 )
419 )
420
421 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs__writepage,
422
423 __extent_writepage,
424
425 btrfs__extent_writepage,
426
427 TP_PROTO(const struct page *page, const struct inode *inode,
428 const struct writeback_control *wbc),
429
430 TP_ARGS(page, inode, wbc)
431 )
432
433 LTTNG_TRACEPOINT_EVENT(btrfs_writepage_end_io_hook,
434
435 TP_PROTO(const struct page *page, u64 start, u64 end, int uptodate),
436
437 TP_ARGS(page, start, end, uptodate),
438
439 TP_FIELDS(
440 ctf_integer(ino_t, ino, page->mapping->host->i_ino)
441 ctf_integer(pgoff_t, index, page->index)
442 ctf_integer(u64, start, start)
443 ctf_integer(u64, end, end)
444 ctf_integer(int, uptodate, uptodate)
445 ctf_integer(u64, root_objectid,
446 BTRFS_I(page->mapping->host)->root->root_key.objectid)
447 )
448 )
449
450 LTTNG_TRACEPOINT_EVENT(btrfs_sync_file,
451
452 TP_PROTO(const struct file *file, int datasync),
453
454 TP_ARGS(file, datasync),
455
456 TP_FIELDS(
457 ctf_integer(ino_t, ino, file->f_path.dentry->d_inode->i_ino)
458 ctf_integer(ino_t, parent, file->f_path.dentry->d_parent->d_inode->i_ino)
459 ctf_integer(int, datasync, datasync)
460 ctf_integer(u64, root_objectid,
461 BTRFS_I(file->f_path.dentry->d_inode)->root->root_key.objectid)
462 )
463 )
464 #else
465 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_add,
466
467 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
468
469 TP_ARGS(inode, ordered)
470 )
471
472 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_remove,
473
474 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
475
476 TP_ARGS(inode, ordered)
477 )
478
479 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_start,
480
481 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
482
483 TP_ARGS(inode, ordered)
484 )
485
486 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_put,
487
488 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
489
490 TP_ARGS(inode, ordered)
491 )
492
493 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__writepage,
494
495 TP_PROTO(struct page *page, struct inode *inode,
496 struct writeback_control *wbc),
497
498 TP_ARGS(page, inode, wbc),
499
500 TP_FIELDS(
501 ctf_integer(ino_t, ino, inode->i_ino)
502 ctf_integer(pgoff_t, index, page->index)
503 ctf_integer(long, nr_to_write, wbc->nr_to_write)
504 ctf_integer(long, pages_skipped, wbc->pages_skipped)
505 ctf_integer(loff_t, range_start, wbc->range_start)
506 ctf_integer(loff_t, range_end, wbc->range_end)
507 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0))
508 ctf_integer(char, nonblocking, wbc->nonblocking)
509 #endif
510 ctf_integer(char, for_kupdate, wbc->for_kupdate)
511 ctf_integer(char, for_reclaim, wbc->for_reclaim)
512 ctf_integer(char, range_cyclic, wbc->range_cyclic)
513 ctf_integer(pgoff_t, writeback_index,
514 inode->i_mapping->writeback_index)
515 ctf_integer(u64, root_objectid,
516 BTRFS_I(inode)->root->root_key.objectid)
517 )
518 )
519
520 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs__writepage,
521
522 __extent_writepage,
523
524 btrfs__extent_writepage,
525
526 TP_PROTO(struct page *page, struct inode *inode,
527 struct writeback_control *wbc),
528
529 TP_ARGS(page, inode, wbc)
530 )
531
532 LTTNG_TRACEPOINT_EVENT(btrfs_writepage_end_io_hook,
533
534 TP_PROTO(struct page *page, u64 start, u64 end, int uptodate),
535
536 TP_ARGS(page, start, end, uptodate),
537
538 TP_FIELDS(
539 ctf_integer(ino_t, ino, page->mapping->host->i_ino)
540 ctf_integer(pgoff_t, index, page->index)
541 ctf_integer(u64, start, start)
542 ctf_integer(u64, end, end)
543 ctf_integer(int, uptodate, uptodate)
544 ctf_integer(u64, root_objectid,
545 BTRFS_I(page->mapping->host)->root->root_key.objectid)
546 )
547 )
548
549 LTTNG_TRACEPOINT_EVENT(btrfs_sync_file,
550
551 TP_PROTO(struct file *file, int datasync),
552
553 TP_ARGS(file, datasync),
554
555 TP_FIELDS(
556 ctf_integer(ino_t, ino, file->f_path.dentry->d_inode->i_ino)
557 ctf_integer(ino_t, parent, file->f_path.dentry->d_parent->d_inode->i_ino)
558 ctf_integer(int, datasync, datasync)
559 ctf_integer(u64, root_objectid,
560 BTRFS_I(file->f_path.dentry->d_inode)->root->root_key.objectid)
561 )
562 )
563 #endif
564
565 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
566 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,114,92,0,0))
567 LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs,
568
569 TP_PROTO(const struct btrfs_fs_info *fs_info, int wait),
570
571 TP_ARGS(fs_info, wait),
572
573 TP_FIELDS(
574 ctf_integer(int, wait, wait)
575 )
576 )
577 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
578 LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs,
579
580 TP_PROTO(struct btrfs_fs_info *fs_info, int wait),
581
582 TP_ARGS(fs_info, wait),
583
584 TP_FIELDS(
585 ctf_integer(int, wait, wait)
586 )
587 )
588 #else
589 LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs,
590
591 TP_PROTO(int wait),
592
593 TP_ARGS(wait),
594
595 TP_FIELDS(
596 ctf_integer(int, wait, wait)
597 )
598 )
599 #endif
600
601 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
602 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
603 LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group,
604
605 TP_PROTO(const struct btrfs_fs_info *fs_info,
606 const struct btrfs_block_group_cache *block_group, int create),
607
608 TP_ARGS(fs_info, block_group, create),
609
610 TP_FIELDS(
611 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
612 ctf_integer(u64, offset, block_group->key.objectid)
613 ctf_integer(u64, size, block_group->key.offset)
614 ctf_integer(u64, flags, block_group->flags)
615 ctf_integer(u64, bytes_used, btrfs_block_group_used(&block_group->item))
616 ctf_integer(u64, bytes_super, block_group->bytes_super)
617 ctf_integer(int, create, create)
618 )
619 )
620 #else
621 LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group,
622
623 TP_PROTO(struct btrfs_fs_info *fs_info,
624 struct btrfs_block_group_cache *block_group, int create),
625
626 TP_ARGS(fs_info, block_group, create),
627
628 TP_FIELDS(
629 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
630 ctf_integer(u64, offset, block_group->key.objectid)
631 ctf_integer(u64, size, block_group->key.offset)
632 ctf_integer(u64, flags, block_group->flags)
633 ctf_integer(u64, bytes_used, btrfs_block_group_used(&block_group->item))
634 ctf_integer(u64, bytes_super, block_group->bytes_super)
635 ctf_integer(int, create, create)
636 )
637 )
638 #endif
639
640 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
641 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref,
642
643 TP_PROTO(const struct btrfs_fs_info *fs_info,
644 const struct btrfs_delayed_ref_node *ref,
645 const struct btrfs_delayed_tree_ref *full_ref,
646 int action),
647
648 TP_ARGS(fs_info, ref, full_ref, action),
649
650 TP_FIELDS(
651 ctf_integer(u64, bytenr, ref->bytenr)
652 ctf_integer(u64, num_bytes, ref->num_bytes)
653 ctf_integer(int, action, action)
654 ctf_integer(u64, parent, full_ref->parent)
655 ctf_integer(u64, ref_root, full_ref->root)
656 ctf_integer(int, level, full_ref->level)
657 ctf_integer(int, type, ref->type)
658 ctf_integer(u64, seq, ref->seq)
659 )
660 )
661 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
662 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref,
663
664 TP_PROTO(struct btrfs_fs_info *fs_info,
665 struct btrfs_delayed_ref_node *ref,
666 struct btrfs_delayed_tree_ref *full_ref,
667 int action),
668
669 TP_ARGS(fs_info, ref, full_ref, action),
670
671 TP_FIELDS(
672 ctf_integer(u64, bytenr, ref->bytenr)
673 ctf_integer(u64, num_bytes, ref->num_bytes)
674 ctf_integer(int, action, action)
675 ctf_integer(u64, parent, full_ref->parent)
676 ctf_integer(u64, ref_root, full_ref->root)
677 ctf_integer(int, level, full_ref->level)
678 ctf_integer(int, type, ref->type)
679 ctf_integer(u64, seq, ref->seq)
680 )
681 )
682 #else
683 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref,
684
685 TP_PROTO(struct btrfs_delayed_ref_node *ref,
686 struct btrfs_delayed_tree_ref *full_ref,
687 int action),
688
689 TP_ARGS(ref, full_ref, action),
690
691 TP_FIELDS(
692 ctf_integer(u64, bytenr, ref->bytenr)
693 ctf_integer(u64, num_bytes, ref->num_bytes)
694 ctf_integer(int, action, action)
695 ctf_integer(u64, parent, full_ref->parent)
696 ctf_integer(u64, ref_root, full_ref->root)
697 ctf_integer(int, level, full_ref->level)
698 ctf_integer(int, type, ref->type)
699 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
700 ctf_integer(u64, seq, ref->seq)
701 #endif
702 )
703 )
704 #endif
705
706 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_data_ref,
707
708 TP_PROTO(struct btrfs_delayed_ref_node *ref,
709 struct btrfs_delayed_data_ref *full_ref,
710 int action),
711
712 TP_ARGS(ref, full_ref, action),
713
714 TP_FIELDS(
715 ctf_integer(u64, bytenr, ref->bytenr)
716 ctf_integer(u64, num_bytes, ref->num_bytes)
717 ctf_integer(int, action, action)
718 ctf_integer(u64, parent, full_ref->parent)
719 ctf_integer(u64, ref_root, full_ref->root)
720 ctf_integer(u64, owner, full_ref->objectid)
721 ctf_integer(u64, offset, full_ref->offset)
722 ctf_integer(int, type, ref->type)
723 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
724 ctf_integer(u64, seq, ref->seq)
725 #endif
726 )
727 )
728
729 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0))
730 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head,
731
732 TP_PROTO(const struct btrfs_fs_info *fs_info,
733 const struct btrfs_delayed_ref_head *head_ref,
734 int action),
735
736 TP_ARGS(fs_info, head_ref, action),
737
738 TP_FIELDS(
739 ctf_integer(u64, bytenr, head_ref->bytenr)
740 ctf_integer(u64, num_bytes, head_ref->num_bytes)
741 ctf_integer(int, action, action)
742 ctf_integer(int, is_data, head_ref->is_data)
743 )
744 )
745
746 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, add_delayed_ref_head,
747
748 TP_PROTO(const struct btrfs_fs_info *fs_info,
749 const struct btrfs_delayed_ref_head *head_ref,
750 int action),
751
752 TP_ARGS(fs_info, head_ref, action)
753 )
754
755 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, run_delayed_ref_head,
756
757 TP_PROTO(const struct btrfs_fs_info *fs_info,
758 const struct btrfs_delayed_ref_head *head_ref,
759 int action),
760
761 TP_ARGS(fs_info, head_ref, action)
762 )
763
764 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
765 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,114,92,0,0))
766 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head,
767
768 TP_PROTO(const struct btrfs_fs_info *fs_info,
769 const struct btrfs_delayed_ref_node *ref,
770 const struct btrfs_delayed_ref_head *head_ref,
771 int action),
772
773 TP_ARGS(fs_info, ref, head_ref, action),
774
775 TP_FIELDS(
776 ctf_integer(u64, bytenr, ref->bytenr)
777 ctf_integer(u64, num_bytes, ref->num_bytes)
778 ctf_integer(int, action, action)
779 ctf_integer(int, is_data, head_ref->is_data)
780 )
781 )
782
783 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, add_delayed_ref_head,
784
785 TP_PROTO(const struct btrfs_fs_info *fs_info,
786 const struct btrfs_delayed_ref_node *ref,
787 const struct btrfs_delayed_ref_head *head_ref,
788 int action),
789
790 TP_ARGS(fs_info, ref, head_ref, action)
791 )
792
793 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, run_delayed_ref_head,
794
795 TP_PROTO(const struct btrfs_fs_info *fs_info,
796 const struct btrfs_delayed_ref_node *ref,
797 const struct btrfs_delayed_ref_head *head_ref,
798 int action),
799
800 TP_ARGS(fs_info, ref, head_ref, action)
801 )
802
803 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
804 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head,
805
806 TP_PROTO(struct btrfs_fs_info *fs_info,
807 struct btrfs_delayed_ref_node *ref,
808 struct btrfs_delayed_ref_head *head_ref,
809 int action),
810
811 TP_ARGS(fs_info, ref, head_ref, action),
812
813 TP_FIELDS(
814 ctf_integer(u64, bytenr, ref->bytenr)
815 ctf_integer(u64, num_bytes, ref->num_bytes)
816 ctf_integer(int, action, action)
817 ctf_integer(int, is_data, head_ref->is_data)
818 )
819 )
820
821 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, add_delayed_ref_head,
822
823 TP_PROTO(struct btrfs_fs_info *fs_info,
824 struct btrfs_delayed_ref_node *ref,
825 struct btrfs_delayed_ref_head *head_ref,
826 int action),
827
828 TP_ARGS(fs_info, ref, head_ref, action)
829 )
830
831 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, run_delayed_ref_head,
832
833 TP_PROTO(struct btrfs_fs_info *fs_info,
834 struct btrfs_delayed_ref_node *ref,
835 struct btrfs_delayed_ref_head *head_ref,
836 int action),
837
838 TP_ARGS(fs_info, ref, head_ref, action)
839 )
840
841 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,114,92,0,0, 4,5,0,0,0,0))
842 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head,
843
844 TP_PROTO(const struct btrfs_delayed_ref_node *ref,
845 const struct btrfs_delayed_ref_head *head_ref,
846 int action),
847
848 TP_ARGS(ref, head_ref, action),
849
850 TP_FIELDS(
851 ctf_integer(u64, bytenr, ref->bytenr)
852 ctf_integer(u64, num_bytes, ref->num_bytes)
853 ctf_integer(int, action, action)
854 ctf_integer(int, is_data, head_ref->is_data)
855 )
856 )
857
858 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, add_delayed_ref_head,
859
860 TP_PROTO(const struct btrfs_delayed_ref_node *ref,
861 const struct btrfs_delayed_ref_head *head_ref,
862 int action),
863
864 TP_ARGS(ref, head_ref, action)
865 )
866
867 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, run_delayed_ref_head,
868
869 TP_PROTO(const struct btrfs_delayed_ref_node *ref,
870 const struct btrfs_delayed_ref_head *head_ref,
871 int action),
872
873 TP_ARGS(ref, head_ref, action)
874 )
875
876 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0))
877 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_ref_head,
878
879 TP_PROTO(struct btrfs_delayed_ref_node *ref,
880 struct btrfs_delayed_ref_head *head_ref,
881 int action),
882
883 TP_ARGS(ref, head_ref, action),
884
885 TP_FIELDS(
886 ctf_integer(u64, bytenr, ref->bytenr)
887 ctf_integer(u64, num_bytes, ref->num_bytes)
888 ctf_integer(int, action, action)
889 ctf_integer(int, is_data, head_ref->is_data)
890 )
891 )
892
893 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, add_delayed_ref_head,
894
895 TP_PROTO(struct btrfs_delayed_ref_node *ref,
896 struct btrfs_delayed_ref_head *head_ref,
897 int action),
898
899 TP_ARGS(ref, head_ref, action)
900 )
901
902 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs_delayed_ref_head, run_delayed_ref_head,
903
904 TP_PROTO(struct btrfs_delayed_ref_node *ref,
905 struct btrfs_delayed_ref_head *head_ref,
906 int action),
907
908 TP_ARGS(ref, head_ref, action)
909 )
910
911 #else
912 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_ref_head,
913
914 TP_PROTO(struct btrfs_delayed_ref_node *ref,
915 struct btrfs_delayed_ref_head *head_ref,
916 int action),
917
918 TP_ARGS(ref, head_ref, action),
919
920 TP_FIELDS(
921 ctf_integer(u64, bytenr, ref->bytenr)
922 ctf_integer(u64, num_bytes, ref->num_bytes)
923 ctf_integer(int, action, action)
924 ctf_integer(int, is_data, head_ref->is_data)
925 )
926 )
927 #endif
928
929 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
930
931 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
932
933 TP_PROTO(const struct btrfs_fs_info *fs_info, const struct map_lookup *map,
934 u64 offset, u64 size),
935
936 TP_ARGS(fs_info, map, offset, size),
937
938 TP_FIELDS(
939 ctf_integer(int, num_stripes, map->num_stripes)
940 ctf_integer(u64, type, map->type)
941 ctf_integer(int, sub_stripes, map->sub_stripes)
942 ctf_integer(u64, offset, offset)
943 ctf_integer(u64, size, size)
944 ctf_integer(u64, root_objectid, fs_info->chunk_root->root_key.objectid)
945 )
946 )
947
948 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc,
949
950 TP_PROTO(const struct btrfs_fs_info *info, const struct map_lookup *map,
951 u64 offset, u64 size),
952
953 TP_ARGS(info, map, offset, size)
954 )
955
956 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free,
957
958 TP_PROTO(const struct btrfs_fs_info *info, const struct map_lookup *map,
959 u64 offset, u64 size),
960
961 TP_ARGS(info, map, offset, size)
962 )
963
964 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
965
966 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
967
968 TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map,
969 u64 offset, u64 size),
970
971 TP_ARGS(fs_info, map, offset, size),
972
973 TP_FIELDS(
974 ctf_integer(int, num_stripes, map->num_stripes)
975 ctf_integer(u64, type, map->type)
976 ctf_integer(int, sub_stripes, map->sub_stripes)
977 ctf_integer(u64, offset, offset)
978 ctf_integer(u64, size, size)
979 ctf_integer(u64, root_objectid, fs_info->chunk_root->root_key.objectid)
980 )
981 )
982
983 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc,
984
985 TP_PROTO(struct btrfs_fs_info *info, struct map_lookup *map,
986 u64 offset, u64 size),
987
988 TP_ARGS(info, map, offset, size)
989 )
990
991 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free,
992
993 TP_PROTO(struct btrfs_fs_info *info, struct map_lookup *map,
994 u64 offset, u64 size),
995
996 TP_ARGS(info, map, offset, size)
997 )
998
999 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1000
1001 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
1002
1003 TP_PROTO(const struct btrfs_root *root, const struct map_lookup *map,
1004 u64 offset, u64 size),
1005
1006 TP_ARGS(root, map, offset, size),
1007
1008 TP_FIELDS(
1009 ctf_integer(int, num_stripes, map->num_stripes)
1010 ctf_integer(u64, type, map->type)
1011 ctf_integer(int, sub_stripes, map->sub_stripes)
1012 ctf_integer(u64, offset, offset)
1013 ctf_integer(u64, size, size)
1014 ctf_integer(u64, root_objectid, root->root_key.objectid)
1015 )
1016 )
1017
1018 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc,
1019
1020 TP_PROTO(const struct btrfs_root *root, const struct map_lookup *map,
1021 u64 offset, u64 size),
1022
1023 TP_ARGS(root, map, offset, size)
1024 )
1025
1026 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free,
1027
1028 TP_PROTO(const struct btrfs_root *root, const struct map_lookup *map,
1029 u64 offset, u64 size),
1030
1031 TP_ARGS(root, map, offset, size)
1032 )
1033
1034 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1035
1036 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
1037
1038 TP_PROTO(struct btrfs_root *root, struct map_lookup *map,
1039 u64 offset, u64 size),
1040
1041 TP_ARGS(root, map, offset, size),
1042
1043 TP_FIELDS(
1044 ctf_integer(int, num_stripes, map->num_stripes)
1045 ctf_integer(u64, type, map->type)
1046 ctf_integer(int, sub_stripes, map->sub_stripes)
1047 ctf_integer(u64, offset, offset)
1048 ctf_integer(u64, size, size)
1049 ctf_integer(u64, root_objectid, root->root_key.objectid)
1050 )
1051 )
1052
1053 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc,
1054
1055 TP_PROTO(struct btrfs_root *root, struct map_lookup *map,
1056 u64 offset, u64 size),
1057
1058 TP_ARGS(root, map, offset, size)
1059 )
1060
1061 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free,
1062
1063 TP_PROTO(struct btrfs_root *root, struct map_lookup *map,
1064 u64 offset, u64 size),
1065
1066 TP_ARGS(root, map, offset, size)
1067 )
1068
1069 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1070
1071 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
1072 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1073 LTTNG_TRACEPOINT_EVENT(btrfs_cow_block,
1074
1075 TP_PROTO(const struct btrfs_root *root, const struct extent_buffer *buf,
1076 const struct extent_buffer *cow),
1077
1078 TP_ARGS(root, buf, cow),
1079
1080 TP_FIELDS(
1081 ctf_integer(u64, root_objectid, root->root_key.objectid)
1082 ctf_integer(u64, buf_start, buf->start)
1083 ctf_integer(int, refs, atomic_read(&buf->refs))
1084 ctf_integer(u64, cow_start, cow->start)
1085 ctf_integer(int, buf_level, btrfs_header_level(buf))
1086 ctf_integer(int, cow_level, btrfs_header_level(cow))
1087 )
1088 )
1089 #else
1090 LTTNG_TRACEPOINT_EVENT(btrfs_cow_block,
1091
1092 TP_PROTO(struct btrfs_root *root, struct extent_buffer *buf,
1093 struct extent_buffer *cow),
1094
1095 TP_ARGS(root, buf, cow),
1096
1097 TP_FIELDS(
1098 ctf_integer(u64, root_objectid, root->root_key.objectid)
1099 ctf_integer(u64, buf_start, buf->start)
1100 ctf_integer(int, refs, atomic_read(&buf->refs))
1101 ctf_integer(u64, cow_start, cow->start)
1102 ctf_integer(int, buf_level, btrfs_header_level(buf))
1103 ctf_integer(int, cow_level, btrfs_header_level(cow))
1104 )
1105 )
1106 #endif
1107
1108 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
1109 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1110 LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation,
1111
1112 TP_PROTO(const struct btrfs_fs_info *fs_info, char *type, u64 val,
1113 u64 bytes, int reserve),
1114
1115 TP_ARGS(fs_info, type, val, bytes, reserve),
1116
1117 TP_FIELDS(
1118 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
1119 ctf_string(type, type)
1120 ctf_integer(u64, val, val)
1121 ctf_integer(u64, bytes, bytes)
1122 ctf_integer(int, reserve, reserve)
1123 )
1124 )
1125 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
1126 LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation,
1127
1128 TP_PROTO(struct btrfs_fs_info *fs_info, char *type, u64 val,
1129 u64 bytes, int reserve),
1130
1131 TP_ARGS(fs_info, type, val, bytes, reserve),
1132
1133 TP_FIELDS(
1134 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
1135 ctf_string(type, type)
1136 ctf_integer(u64, val, val)
1137 ctf_integer(u64, bytes, bytes)
1138 ctf_integer(int, reserve, reserve)
1139 )
1140 )
1141 #endif
1142
1143 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1144
1145 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
1146
1147 TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len),
1148
1149 TP_ARGS(info, start, len),
1150
1151 TP_FIELDS(
1152 ctf_integer(u64, start, start)
1153 ctf_integer(u64, len, len)
1154 )
1155 )
1156
1157 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
1158
1159 TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len),
1160
1161 TP_ARGS(info, start, len)
1162 )
1163
1164 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free,
1165
1166 TP_PROTO(const struct btrfs_fs_info *info, u64 start, u64 len),
1167
1168 TP_ARGS(info, start, len)
1169 )
1170
1171 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
1172
1173 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
1174
1175 TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len),
1176
1177 TP_ARGS(info, start, len),
1178
1179 TP_FIELDS(
1180 ctf_integer(u64, start, start)
1181 ctf_integer(u64, len, len)
1182 )
1183 )
1184
1185 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
1186
1187 TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len),
1188
1189 TP_ARGS(info, start, len)
1190 )
1191
1192 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free,
1193
1194 TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len),
1195
1196 TP_ARGS(info, start, len)
1197 )
1198
1199 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1200
1201 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
1202
1203 TP_PROTO(const struct btrfs_root *root, u64 start, u64 len),
1204
1205 TP_ARGS(root, start, len),
1206
1207 TP_FIELDS(
1208 ctf_integer(u64, root_objectid, root->root_key.objectid)
1209 ctf_integer(u64, start, start)
1210 ctf_integer(u64, len, len)
1211 )
1212 )
1213
1214 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
1215
1216 TP_PROTO(const struct btrfs_root *root, u64 start, u64 len),
1217
1218 TP_ARGS(root, start, len)
1219 )
1220
1221 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free,
1222
1223 TP_PROTO(const struct btrfs_root *root, u64 start, u64 len),
1224
1225 TP_ARGS(root, start, len)
1226 )
1227
1228 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1229
1230 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
1231
1232 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
1233
1234 TP_ARGS(root, start, len),
1235
1236 TP_FIELDS(
1237 ctf_integer(u64, root_objectid, root->root_key.objectid)
1238 ctf_integer(u64, start, start)
1239 ctf_integer(u64, len, len)
1240 )
1241 )
1242
1243 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
1244
1245 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
1246
1247 TP_ARGS(root, start, len)
1248 )
1249
1250 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free,
1251
1252 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
1253
1254 TP_ARGS(root, start, len)
1255 )
1256
1257 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1258
1259 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1260
1261 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
1262
1263 btrfs_find_free_extent,
1264
1265 TP_PROTO(const struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size,
1266 u64 data),
1267
1268 TP_ARGS(info, num_bytes, empty_size, data),
1269
1270 TP_FIELDS(
1271 ctf_integer(u64, num_bytes, num_bytes)
1272 ctf_integer(u64, empty_size, empty_size)
1273 ctf_integer(u64, data, data)
1274 )
1275 )
1276
1277 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
1278
1279 TP_PROTO(const struct btrfs_fs_info *info,
1280 const struct btrfs_block_group_cache *block_group, u64 start,
1281 u64 len),
1282
1283 TP_ARGS(info, block_group, start, len),
1284
1285 TP_FIELDS(
1286 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1287 ctf_integer(u64, flags, block_group->flags)
1288 ctf_integer(u64, start, start)
1289 ctf_integer(u64, len, len)
1290 )
1291 )
1292
1293 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
1294
1295 TP_PROTO(const struct btrfs_fs_info *info,
1296 const struct btrfs_block_group_cache *block_group, u64 start,
1297 u64 len),
1298
1299 TP_ARGS(info, block_group, start, len)
1300 )
1301
1302 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
1303
1304 TP_PROTO(const struct btrfs_fs_info *info,
1305 const struct btrfs_block_group_cache *block_group, u64 start,
1306 u64 len),
1307
1308 TP_ARGS(info, block_group, start, len)
1309 )
1310
1311 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
1312
1313 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
1314
1315 btrfs_find_free_extent,
1316
1317 TP_PROTO(struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size,
1318 u64 data),
1319
1320 TP_ARGS(info, num_bytes, empty_size, data),
1321
1322 TP_FIELDS(
1323 ctf_integer(u64, num_bytes, num_bytes)
1324 ctf_integer(u64, empty_size, empty_size)
1325 ctf_integer(u64, data, data)
1326 )
1327 )
1328
1329 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
1330
1331 TP_PROTO(struct btrfs_fs_info *info,
1332 struct btrfs_block_group_cache *block_group, u64 start,
1333 u64 len),
1334
1335 TP_ARGS(info, block_group, start, len),
1336
1337 TP_FIELDS(
1338 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1339 ctf_integer(u64, flags, block_group->flags)
1340 ctf_integer(u64, start, start)
1341 ctf_integer(u64, len, len)
1342 )
1343 )
1344
1345 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
1346
1347 TP_PROTO(struct btrfs_fs_info *info,
1348 struct btrfs_block_group_cache *block_group, u64 start,
1349 u64 len),
1350
1351 TP_ARGS(info, block_group, start, len)
1352 )
1353
1354 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
1355
1356 TP_PROTO(struct btrfs_fs_info *info,
1357 struct btrfs_block_group_cache *block_group, u64 start,
1358 u64 len),
1359
1360 TP_ARGS(info, block_group, start, len)
1361 )
1362 #elif (LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1363
1364 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
1365
1366 btrfs_find_free_extent,
1367
1368 TP_PROTO(const struct btrfs_root *root, u64 num_bytes, u64 empty_size,
1369 u64 data),
1370
1371 TP_ARGS(root, num_bytes, empty_size, data),
1372
1373 TP_FIELDS(
1374 ctf_integer(u64, root_objectid, root->root_key.objectid)
1375 ctf_integer(u64, num_bytes, num_bytes)
1376 ctf_integer(u64, empty_size, empty_size)
1377 ctf_integer(u64, data, data)
1378 )
1379 )
1380
1381 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
1382
1383 TP_PROTO(const struct btrfs_root *root,
1384 const struct btrfs_block_group_cache *block_group, u64 start,
1385 u64 len),
1386
1387 TP_ARGS(root, block_group, start, len),
1388
1389 TP_FIELDS(
1390 ctf_integer(u64, root_objectid, root->root_key.objectid)
1391 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1392 ctf_integer(u64, flags, block_group->flags)
1393 ctf_integer(u64, start, start)
1394 ctf_integer(u64, len, len)
1395 )
1396 )
1397
1398 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
1399
1400 TP_PROTO(const struct btrfs_root *root,
1401 const struct btrfs_block_group_cache *block_group, u64 start,
1402 u64 len),
1403
1404 TP_ARGS(root, block_group, start, len)
1405 )
1406
1407 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
1408
1409 TP_PROTO(const struct btrfs_root *root,
1410 const struct btrfs_block_group_cache *block_group, u64 start,
1411 u64 len),
1412
1413 TP_ARGS(root, block_group, start, len)
1414 )
1415
1416 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
1417
1418 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
1419
1420 btrfs_find_free_extent,
1421
1422 TP_PROTO(struct btrfs_root *root, u64 num_bytes, u64 empty_size,
1423 u64 data),
1424
1425 TP_ARGS(root, num_bytes, empty_size, data),
1426
1427 TP_FIELDS(
1428 ctf_integer(u64, root_objectid, root->root_key.objectid)
1429 ctf_integer(u64, num_bytes, num_bytes)
1430 ctf_integer(u64, empty_size, empty_size)
1431 ctf_integer(u64, data, data)
1432 )
1433 )
1434
1435 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
1436
1437 TP_PROTO(struct btrfs_root *root,
1438 struct btrfs_block_group_cache *block_group, u64 start,
1439 u64 len),
1440
1441 TP_ARGS(root, block_group, start, len),
1442
1443 TP_FIELDS(
1444 ctf_integer(u64, root_objectid, root->root_key.objectid)
1445 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1446 ctf_integer(u64, flags, block_group->flags)
1447 ctf_integer(u64, start, start)
1448 ctf_integer(u64, len, len)
1449 )
1450 )
1451
1452 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
1453
1454 TP_PROTO(struct btrfs_root *root,
1455 struct btrfs_block_group_cache *block_group, u64 start,
1456 u64 len),
1457
1458 TP_ARGS(root, block_group, start, len)
1459 )
1460
1461 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
1462
1463 TP_PROTO(struct btrfs_root *root,
1464 struct btrfs_block_group_cache *block_group, u64 start,
1465 u64 len),
1466
1467 TP_ARGS(root, block_group, start, len)
1468 )
1469
1470 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
1471
1472 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
1473 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1474 LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster,
1475
1476 TP_PROTO(const struct btrfs_block_group_cache *block_group, u64 start,
1477 u64 bytes, u64 empty_size, u64 min_bytes),
1478
1479 TP_ARGS(block_group, start, bytes, empty_size, min_bytes),
1480
1481 TP_FIELDS(
1482 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1483 ctf_integer(u64, flags, block_group->flags)
1484 ctf_integer(u64, start, start)
1485 ctf_integer(u64, bytes, bytes)
1486 ctf_integer(u64, empty_size, empty_size)
1487 ctf_integer(u64, min_bytes, min_bytes)
1488 )
1489 )
1490
1491 LTTNG_TRACEPOINT_EVENT(btrfs_failed_cluster_setup,
1492
1493 TP_PROTO(const struct btrfs_block_group_cache *block_group),
1494
1495 TP_ARGS(block_group),
1496
1497 TP_FIELDS(
1498 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1499 )
1500 )
1501
1502 LTTNG_TRACEPOINT_EVENT(btrfs_setup_cluster,
1503
1504 TP_PROTO(const struct btrfs_block_group_cache *block_group,
1505 const struct btrfs_free_cluster *cluster, u64 size, int bitmap),
1506
1507 TP_ARGS(block_group, cluster, size, bitmap),
1508
1509 TP_FIELDS(
1510 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1511 ctf_integer(u64, flags, block_group->flags)
1512 ctf_integer(u64, start, cluster->window_start)
1513 ctf_integer(u64, max_size, cluster->max_size)
1514 ctf_integer(u64, size, size)
1515 ctf_integer(int, bitmap, bitmap)
1516 )
1517 )
1518 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
1519 LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster,
1520
1521 TP_PROTO(struct btrfs_block_group_cache *block_group, u64 start,
1522 u64 bytes, u64 empty_size, u64 min_bytes),
1523
1524 TP_ARGS(block_group, start, bytes, empty_size, min_bytes),
1525
1526 TP_FIELDS(
1527 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1528 ctf_integer(u64, flags, block_group->flags)
1529 ctf_integer(u64, start, start)
1530 ctf_integer(u64, bytes, bytes)
1531 ctf_integer(u64, empty_size, empty_size)
1532 ctf_integer(u64, min_bytes, min_bytes)
1533 )
1534 )
1535
1536 LTTNG_TRACEPOINT_EVENT(btrfs_failed_cluster_setup,
1537
1538 TP_PROTO(struct btrfs_block_group_cache *block_group),
1539
1540 TP_ARGS(block_group),
1541
1542 TP_FIELDS(
1543 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1544 )
1545 )
1546
1547 LTTNG_TRACEPOINT_EVENT(btrfs_setup_cluster,
1548
1549 TP_PROTO(struct btrfs_block_group_cache *block_group,
1550 struct btrfs_free_cluster *cluster, u64 size, int bitmap),
1551
1552 TP_ARGS(block_group, cluster, size, bitmap),
1553
1554 TP_FIELDS(
1555 ctf_integer(u64, bg_objectid, block_group->key.objectid)
1556 ctf_integer(u64, flags, block_group->flags)
1557 ctf_integer(u64, start, cluster->window_start)
1558 ctf_integer(u64, max_size, cluster->max_size)
1559 ctf_integer(u64, size, size)
1560 ctf_integer(int, bitmap, bitmap)
1561 )
1562 )
1563 #endif
1564
1565 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0) || \
1566 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,5,0,0,0,0))
1567 LTTNG_TRACEPOINT_EVENT_MAP(alloc_extent_state,
1568
1569 btrfs_alloc_extent_state,
1570
1571 TP_PROTO(const struct extent_state *state, gfp_t mask, unsigned long IP),
1572
1573 TP_ARGS(state, mask, IP),
1574
1575 TP_FIELDS(
1576 ctf_integer_hex(const struct extent_state *, state, state)
1577 ctf_integer(gfp_t, mask, mask)
1578 ctf_integer(unsigned long, ip, IP)
1579 )
1580 )
1581
1582 LTTNG_TRACEPOINT_EVENT_MAP(free_extent_state,
1583
1584 btrfs_free_extent_state,
1585
1586 TP_PROTO(const struct extent_state *state, unsigned long IP),
1587
1588 TP_ARGS(state, IP),
1589
1590 TP_FIELDS(
1591 ctf_integer_hex(const struct extent_state *, state, state)
1592 ctf_integer(unsigned long, ip, IP)
1593 )
1594 )
1595 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
1596 LTTNG_TRACEPOINT_EVENT_MAP(alloc_extent_state,
1597
1598 btrfs_alloc_extent_state,
1599
1600 TP_PROTO(struct extent_state *state, gfp_t mask, unsigned long IP),
1601
1602 TP_ARGS(state, mask, IP),
1603
1604 TP_FIELDS(
1605 ctf_integer_hex(struct extent_state *, state, state)
1606 ctf_integer(gfp_t, mask, mask)
1607 ctf_integer(unsigned long, ip, IP)
1608 )
1609 )
1610
1611 LTTNG_TRACEPOINT_EVENT_MAP(free_extent_state,
1612
1613 btrfs_free_extent_state,
1614
1615 TP_PROTO(struct extent_state *state, unsigned long IP),
1616
1617 TP_ARGS(state, IP),
1618
1619 TP_FIELDS(
1620 ctf_integer_hex(struct extent_state *, state, state)
1621 ctf_integer(unsigned long, ip, IP)
1622 )
1623 )
1624 #endif
1625
1626 #endif /* LTTNG_TRACE_BTRFS_H */
1627
1628 /* This part must be outside protection */
1629 #include <probes/define_trace.h>
This page took 0.097686 seconds and 4 git commands to generate.