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