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