cc7ba507d2ee67cd9141db361123917e0f08d90c
[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 LTTNG_TRACEPOINT_EVENT(btrfs_transaction_commit,
36
37 TP_PROTO(struct btrfs_root *root),
38
39 TP_ARGS(root),
40
41 TP_FIELDS(
42 ctf_integer(u64, generation, root->fs_info->generation)
43 ctf_integer(u64, root_objectid, root->root_key.objectid)
44 )
45 )
46
47 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__inode,
48
49 TP_PROTO(struct inode *inode),
50
51 TP_ARGS(inode),
52
53 TP_FIELDS(
54 ctf_integer(ino_t, ino, inode->i_ino)
55 ctf_integer(blkcnt_t, blocks, inode->i_blocks)
56 ctf_integer(u64, disk_i_size, BTRFS_I(inode)->disk_i_size)
57 ctf_integer(u64, generation, BTRFS_I(inode)->generation)
58 ctf_integer(u64, last_trans, BTRFS_I(inode)->last_trans)
59 ctf_integer(u64, logged_trans, BTRFS_I(inode)->logged_trans)
60 ctf_integer(u64, root_objectid,
61 BTRFS_I(inode)->root->root_key.objectid)
62 )
63 )
64
65 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_new,
66
67 TP_PROTO(struct inode *inode),
68
69 TP_ARGS(inode)
70 )
71
72 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_request,
73
74 TP_PROTO(struct inode *inode),
75
76 TP_ARGS(inode)
77 )
78
79 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__inode, btrfs_inode_evict,
80
81 TP_PROTO(struct inode *inode),
82
83 TP_ARGS(inode)
84 )
85
86 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
87
88 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
89
90 TP_PROTO(struct btrfs_root *root, struct inode *inode,
91 struct extent_map *map),
92
93 TP_ARGS(root, inode, map),
94
95 TP_FIELDS(
96 ctf_integer(u64, root_objectid, root->root_key.objectid)
97 ctf_integer(u64, ino, btrfs_ino(inode))
98 ctf_integer(u64, start, map->start)
99 ctf_integer(u64, len, map->len)
100 ctf_integer(u64, orig_start, map->orig_start)
101 ctf_integer(u64, block_start, map->block_start)
102 ctf_integer(u64, block_len, map->block_len)
103 ctf_integer(unsigned long, flags, map->flags)
104 ctf_integer(int, refs, atomic_read(&map->refs))
105 ctf_integer(unsigned int, compress_type, map->compress_type)
106 )
107 )
108
109 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
110
111 LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
112
113 TP_PROTO(struct btrfs_root *root, struct extent_map *map),
114
115 TP_ARGS(root, map),
116
117 TP_FIELDS(
118 ctf_integer(u64, root_objectid, root->root_key.objectid)
119 ctf_integer(u64, start, map->start)
120 ctf_integer(u64, len, map->len)
121 ctf_integer(u64, orig_start, map->orig_start)
122 ctf_integer(u64, block_start, map->block_start)
123 ctf_integer(u64, block_len, map->block_len)
124 ctf_integer(unsigned long, flags, map->flags)
125 ctf_integer(int, refs, atomic_read(&map->refs))
126 ctf_integer(unsigned int, compress_type, map->compress_type)
127 )
128 )
129
130 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
131
132 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
133
134 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
135
136 TP_ARGS(inode, ordered),
137
138 TP_FIELDS(
139 ctf_integer(ino_t, ino, inode->i_ino)
140 ctf_integer(u64, file_offset, ordered->file_offset)
141 ctf_integer(u64, start, ordered->start)
142 ctf_integer(u64, len, ordered->len)
143 ctf_integer(u64, disk_len, ordered->disk_len)
144 ctf_integer(u64, bytes_left, ordered->bytes_left)
145 ctf_integer(unsigned long, flags, ordered->flags)
146 ctf_integer(int, compress_type, ordered->compress_type)
147 ctf_integer(int, refs, atomic_read(&ordered->refs))
148 ctf_integer(u64, root_objectid,
149 BTRFS_I(inode)->root->root_key.objectid)
150 )
151 )
152
153 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_add,
154
155 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
156
157 TP_ARGS(inode, ordered)
158 )
159
160 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_remove,
161
162 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
163
164 TP_ARGS(inode, ordered)
165 )
166
167 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_start,
168
169 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
170
171 TP_ARGS(inode, ordered)
172 )
173
174 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_put,
175
176 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
177
178 TP_ARGS(inode, ordered)
179 )
180
181 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__writepage,
182
183 TP_PROTO(struct page *page, struct inode *inode,
184 struct writeback_control *wbc),
185
186 TP_ARGS(page, inode, wbc),
187
188 TP_FIELDS(
189 ctf_integer(ino_t, ino, inode->i_ino)
190 ctf_integer(pgoff_t, index, page->index)
191 ctf_integer(long, nr_to_write, wbc->nr_to_write)
192 ctf_integer(long, pages_skipped, wbc->pages_skipped)
193 ctf_integer(loff_t, range_start, wbc->range_start)
194 ctf_integer(loff_t, range_end, wbc->range_end)
195 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0))
196 ctf_integer(char, nonblocking, wbc->nonblocking)
197 #endif
198 ctf_integer(char, for_kupdate, wbc->for_kupdate)
199 ctf_integer(char, for_reclaim, wbc->for_reclaim)
200 ctf_integer(char, range_cyclic, wbc->range_cyclic)
201 ctf_integer(pgoff_t, writeback_index,
202 inode->i_mapping->writeback_index)
203 ctf_integer(u64, root_objectid,
204 BTRFS_I(inode)->root->root_key.objectid)
205 )
206 )
207
208 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs__writepage,
209
210 __extent_writepage,
211
212 btrfs__extent_writepage,
213
214 TP_PROTO(struct page *page, struct inode *inode,
215 struct writeback_control *wbc),
216
217 TP_ARGS(page, inode, wbc)
218 )
219
220 LTTNG_TRACEPOINT_EVENT(btrfs_writepage_end_io_hook,
221
222 TP_PROTO(struct page *page, u64 start, u64 end, int uptodate),
223
224 TP_ARGS(page, start, end, uptodate),
225
226 TP_FIELDS(
227 ctf_integer(ino_t, ino, page->mapping->host->i_ino)
228 ctf_integer(pgoff_t, index, page->index)
229 ctf_integer(u64, start, start)
230 ctf_integer(u64, end, end)
231 ctf_integer(int, uptodate, uptodate)
232 ctf_integer(u64, root_objectid,
233 BTRFS_I(page->mapping->host)->root->root_key.objectid)
234 )
235 )
236
237 LTTNG_TRACEPOINT_EVENT(btrfs_sync_file,
238
239 TP_PROTO(struct file *file, int datasync),
240
241 TP_ARGS(file, datasync),
242
243 TP_FIELDS(
244 ctf_integer(ino_t, ino, file->f_path.dentry->d_inode->i_ino)
245 ctf_integer(ino_t, parent, file->f_path.dentry->d_parent->d_inode->i_ino)
246 ctf_integer(int, datasync, datasync)
247 ctf_integer(u64, root_objectid,
248 BTRFS_I(file->f_path.dentry->d_inode)->root->root_key.objectid)
249 )
250 )
251
252 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
253 LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs,
254
255 TP_PROTO(struct btrfs_fs_info *fs_info, int wait),
256
257 TP_ARGS(fs_info, wait),
258
259 TP_FIELDS(
260 ctf_integer(int, wait, wait)
261 )
262 )
263 #else
264 LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs,
265
266 TP_PROTO(int wait),
267
268 TP_ARGS(wait),
269
270 TP_FIELDS(
271 ctf_integer(int, wait, wait)
272 )
273 )
274 #endif
275
276 LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group,
277
278 TP_PROTO(struct btrfs_fs_info *fs_info,
279 struct btrfs_block_group_cache *block_group, int create),
280
281 TP_ARGS(fs_info, block_group, create),
282
283 TP_FIELDS(
284 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
285 ctf_integer(u64, offset, block_group->key.objectid)
286 ctf_integer(u64, size, block_group->key.offset)
287 ctf_integer(u64, flags, block_group->flags)
288 ctf_integer(u64, bytes_used, btrfs_block_group_used(&block_group->item))
289 ctf_integer(u64, bytes_super, block_group->bytes_super)
290 ctf_integer(int, create, create)
291 )
292 )
293
294 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
295 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref,
296
297 TP_PROTO(struct btrfs_fs_info *fs_info,
298 struct btrfs_delayed_ref_node *ref,
299 struct btrfs_delayed_tree_ref *full_ref,
300 int action),
301
302 TP_ARGS(fs_info, ref, full_ref, action),
303
304 TP_FIELDS(
305 ctf_integer(u64, bytenr, ref->bytenr)
306 ctf_integer(u64, num_bytes, ref->num_bytes)
307 ctf_integer(int, action, action)
308 ctf_integer(u64, parent, full_ref->parent)
309 ctf_integer(u64, ref_root, full_ref->root)
310 ctf_integer(int, level, full_ref->level)
311 ctf_integer(int, type, ref->type)
312 ctf_integer(u64, seq, ref->seq)
313 )
314 )
315 #else
316 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref,
317
318 TP_PROTO(struct btrfs_delayed_ref_node *ref,
319 struct btrfs_delayed_tree_ref *full_ref,
320 int action),
321
322 TP_ARGS(ref, full_ref, action),
323
324 TP_FIELDS(
325 ctf_integer(u64, bytenr, ref->bytenr)
326 ctf_integer(u64, num_bytes, ref->num_bytes)
327 ctf_integer(int, action, action)
328 ctf_integer(u64, parent, full_ref->parent)
329 ctf_integer(u64, ref_root, full_ref->root)
330 ctf_integer(int, level, full_ref->level)
331 ctf_integer(int, type, ref->type)
332 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
333 ctf_integer(u64, seq, ref->seq)
334 #endif
335 )
336 )
337 #endif
338
339 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_data_ref,
340
341 TP_PROTO(struct btrfs_delayed_ref_node *ref,
342 struct btrfs_delayed_data_ref *full_ref,
343 int action),
344
345 TP_ARGS(ref, full_ref, action),
346
347 TP_FIELDS(
348 ctf_integer(u64, bytenr, ref->bytenr)
349 ctf_integer(u64, num_bytes, ref->num_bytes)
350 ctf_integer(int, action, action)
351 ctf_integer(u64, parent, full_ref->parent)
352 ctf_integer(u64, ref_root, full_ref->root)
353 ctf_integer(u64, owner, full_ref->objectid)
354 ctf_integer(u64, offset, full_ref->offset)
355 ctf_integer(int, type, ref->type)
356 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
357 ctf_integer(u64, seq, ref->seq)
358 #endif
359 )
360 )
361
362 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
363 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_ref_head,
364
365 TP_PROTO(struct btrfs_fs_info *fs_info,
366 struct btrfs_delayed_ref_node *ref,
367 struct btrfs_delayed_ref_head *head_ref,
368 int action),
369
370 TP_ARGS(fs_info, ref, head_ref, action),
371
372 TP_FIELDS(
373 ctf_integer(u64, bytenr, ref->bytenr)
374 ctf_integer(u64, num_bytes, ref->num_bytes)
375 ctf_integer(int, action, action)
376 ctf_integer(int, is_data, head_ref->is_data)
377 )
378 )
379
380 #else
381 LTTNG_TRACEPOINT_EVENT(btrfs_delayed_ref_head,
382
383 TP_PROTO(struct btrfs_delayed_ref_node *ref,
384 struct btrfs_delayed_ref_head *head_ref,
385 int action),
386
387 TP_ARGS(ref, head_ref, action),
388
389 TP_FIELDS(
390 ctf_integer(u64, bytenr, ref->bytenr)
391 ctf_integer(u64, num_bytes, ref->num_bytes)
392 ctf_integer(int, action, action)
393 ctf_integer(int, is_data, head_ref->is_data)
394 )
395 )
396 #endif
397
398 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
399
400 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
401
402 TP_PROTO(struct btrfs_fs_info *fs_info, struct map_lookup *map,
403 u64 offset, u64 size),
404
405 TP_ARGS(fs_info, map, offset, size),
406
407 TP_FIELDS(
408 ctf_integer(int, num_stripes, map->num_stripes)
409 ctf_integer(u64, type, map->type)
410 ctf_integer(int, sub_stripes, map->sub_stripes)
411 ctf_integer(u64, offset, offset)
412 ctf_integer(u64, size, size)
413 ctf_integer(u64, root_objectid, fs_info->chunk_root->root_key.objectid)
414 )
415 )
416
417 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc,
418
419 TP_PROTO(struct btrfs_fs_info *info, struct map_lookup *map,
420 u64 offset, u64 size),
421
422 TP_ARGS(info, map, offset, size)
423 )
424
425 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free,
426
427 TP_PROTO(struct btrfs_fs_info *info, struct map_lookup *map,
428 u64 offset, u64 size),
429
430 TP_ARGS(info, map, offset, size)
431 )
432
433 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
434
435 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
436
437 TP_PROTO(struct btrfs_root *root, struct map_lookup *map,
438 u64 offset, u64 size),
439
440 TP_ARGS(root, map, offset, size),
441
442 TP_FIELDS(
443 ctf_integer(int, num_stripes, map->num_stripes)
444 ctf_integer(u64, type, map->type)
445 ctf_integer(int, sub_stripes, map->sub_stripes)
446 ctf_integer(u64, offset, offset)
447 ctf_integer(u64, size, size)
448 ctf_integer(u64, root_objectid, root->root_key.objectid)
449 )
450 )
451
452 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc,
453
454 TP_PROTO(struct btrfs_root *root, struct map_lookup *map,
455 u64 offset, u64 size),
456
457 TP_ARGS(root, map, offset, size)
458 )
459
460 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free,
461
462 TP_PROTO(struct btrfs_root *root, struct map_lookup *map,
463 u64 offset, u64 size),
464
465 TP_ARGS(root, map, offset, size)
466 )
467
468 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
469
470 LTTNG_TRACEPOINT_EVENT(btrfs_cow_block,
471
472 TP_PROTO(struct btrfs_root *root, struct extent_buffer *buf,
473 struct extent_buffer *cow),
474
475 TP_ARGS(root, buf, cow),
476
477 TP_FIELDS(
478 ctf_integer(u64, root_objectid, root->root_key.objectid)
479 ctf_integer(u64, buf_start, buf->start)
480 ctf_integer(int, refs, atomic_read(&buf->refs))
481 ctf_integer(u64, cow_start, cow->start)
482 ctf_integer(int, buf_level, btrfs_header_level(buf))
483 ctf_integer(int, cow_level, btrfs_header_level(cow))
484 )
485 )
486
487 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
488 LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation,
489
490 TP_PROTO(struct btrfs_fs_info *fs_info, char *type, u64 val,
491 u64 bytes, int reserve),
492
493 TP_ARGS(fs_info, type, val, bytes, reserve),
494
495 TP_FIELDS(
496 ctf_array(u8, fsid, fs_info->fsid, BTRFS_UUID_SIZE)
497 ctf_string(type, type)
498 ctf_integer(u64, val, val)
499 ctf_integer(u64, bytes, bytes)
500 ctf_integer(int, reserve, reserve)
501 )
502 )
503 #endif
504
505 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
506
507 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
508
509 TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len),
510
511 TP_ARGS(info, start, len),
512
513 TP_FIELDS(
514 ctf_integer(u64, start, start)
515 ctf_integer(u64, len, len)
516 )
517 )
518
519 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
520
521 TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len),
522
523 TP_ARGS(info, start, len)
524 )
525
526 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free,
527
528 TP_PROTO(struct btrfs_fs_info *info, u64 start, u64 len),
529
530 TP_ARGS(info, start, len)
531 )
532
533 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
534
535 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
536
537 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
538
539 TP_ARGS(root, start, len),
540
541 TP_FIELDS(
542 ctf_integer(u64, root_objectid, root->root_key.objectid)
543 ctf_integer(u64, start, start)
544 ctf_integer(u64, len, len)
545 )
546 )
547
548 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
549
550 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
551
552 TP_ARGS(root, start, len)
553 )
554
555 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free,
556
557 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
558
559 TP_ARGS(root, start, len)
560 )
561
562 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
563
564 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
565
566 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
567
568 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
569
570 btrfs_find_free_extent,
571
572 TP_PROTO(struct btrfs_fs_info *info, u64 num_bytes, u64 empty_size,
573 u64 data),
574
575 TP_ARGS(info, num_bytes, empty_size, data),
576
577 TP_FIELDS(
578 ctf_integer(u64, num_bytes, num_bytes)
579 ctf_integer(u64, empty_size, empty_size)
580 ctf_integer(u64, data, data)
581 )
582 )
583
584 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
585
586 TP_PROTO(struct btrfs_fs_info *info,
587 struct btrfs_block_group_cache *block_group, u64 start,
588 u64 len),
589
590 TP_ARGS(info, block_group, start, len),
591
592 TP_FIELDS(
593 ctf_integer(u64, bg_objectid, block_group->key.objectid)
594 ctf_integer(u64, flags, block_group->flags)
595 ctf_integer(u64, start, start)
596 ctf_integer(u64, len, len)
597 )
598 )
599
600 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
601
602 TP_PROTO(struct btrfs_fs_info *info,
603 struct btrfs_block_group_cache *block_group, u64 start,
604 u64 len),
605
606 TP_ARGS(info, block_group, start, len)
607 )
608
609 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
610
611 TP_PROTO(struct btrfs_fs_info *info,
612 struct btrfs_block_group_cache *block_group, u64 start,
613 u64 len),
614
615 TP_ARGS(info, block_group, start, len)
616 )
617
618 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
619
620 LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
621
622 btrfs_find_free_extent,
623
624 TP_PROTO(struct btrfs_root *root, u64 num_bytes, u64 empty_size,
625 u64 data),
626
627 TP_ARGS(root, num_bytes, empty_size, data),
628
629 TP_FIELDS(
630 ctf_integer(u64, root_objectid, root->root_key.objectid)
631 ctf_integer(u64, num_bytes, num_bytes)
632 ctf_integer(u64, empty_size, empty_size)
633 ctf_integer(u64, data, data)
634 )
635 )
636
637 LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
638
639 TP_PROTO(struct btrfs_root *root,
640 struct btrfs_block_group_cache *block_group, u64 start,
641 u64 len),
642
643 TP_ARGS(root, block_group, start, len),
644
645 TP_FIELDS(
646 ctf_integer(u64, root_objectid, root->root_key.objectid)
647 ctf_integer(u64, bg_objectid, block_group->key.objectid)
648 ctf_integer(u64, flags, block_group->flags)
649 ctf_integer(u64, start, start)
650 ctf_integer(u64, len, len)
651 )
652 )
653
654 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
655
656 TP_PROTO(struct btrfs_root *root,
657 struct btrfs_block_group_cache *block_group, u64 start,
658 u64 len),
659
660 TP_ARGS(root, block_group, start, len)
661 )
662
663 LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
664
665 TP_PROTO(struct btrfs_root *root,
666 struct btrfs_block_group_cache *block_group, u64 start,
667 u64 len),
668
669 TP_ARGS(root, block_group, start, len)
670 )
671
672 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
673
674 LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster,
675
676 TP_PROTO(struct btrfs_block_group_cache *block_group, u64 start,
677 u64 bytes, u64 empty_size, u64 min_bytes),
678
679 TP_ARGS(block_group, start, bytes, empty_size, min_bytes),
680
681 TP_FIELDS(
682 ctf_integer(u64, bg_objectid, block_group->key.objectid)
683 ctf_integer(u64, flags, block_group->flags)
684 ctf_integer(u64, start, start)
685 ctf_integer(u64, bytes, bytes)
686 ctf_integer(u64, empty_size, empty_size)
687 ctf_integer(u64, min_bytes, min_bytes)
688 )
689 )
690
691 LTTNG_TRACEPOINT_EVENT(btrfs_failed_cluster_setup,
692
693 TP_PROTO(struct btrfs_block_group_cache *block_group),
694
695 TP_ARGS(block_group),
696
697 TP_FIELDS(
698 ctf_integer(u64, bg_objectid, block_group->key.objectid)
699 )
700 )
701
702 LTTNG_TRACEPOINT_EVENT(btrfs_setup_cluster,
703
704 TP_PROTO(struct btrfs_block_group_cache *block_group,
705 struct btrfs_free_cluster *cluster, u64 size, int bitmap),
706
707 TP_ARGS(block_group, cluster, size, bitmap),
708
709 TP_FIELDS(
710 ctf_integer(u64, bg_objectid, block_group->key.objectid)
711 ctf_integer(u64, flags, block_group->flags)
712 ctf_integer(u64, start, cluster->window_start)
713 ctf_integer(u64, max_size, cluster->max_size)
714 ctf_integer(u64, size, size)
715 ctf_integer(int, bitmap, bitmap)
716 )
717 )
718 #endif
719
720 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
721 LTTNG_TRACEPOINT_EVENT_MAP(alloc_extent_state,
722
723 btrfs_alloc_extent_state,
724
725 TP_PROTO(struct extent_state *state, gfp_t mask, unsigned long IP),
726
727 TP_ARGS(state, mask, IP),
728
729 TP_FIELDS(
730 ctf_integer_hex(struct extent_state *, state, state)
731 ctf_integer(gfp_t, mask, mask)
732 ctf_integer(unsigned long, ip, IP)
733 )
734 )
735
736 LTTNG_TRACEPOINT_EVENT_MAP(free_extent_state,
737
738 btrfs_free_extent_state,
739
740 TP_PROTO(struct extent_state *state, unsigned long IP),
741
742 TP_ARGS(state, IP),
743
744 TP_FIELDS(
745 ctf_integer_hex(struct extent_state *, state, state)
746 ctf_integer(unsigned long, ip, IP)
747 )
748 )
749 #endif
750
751 #endif /* LTTNG_TRACE_BTRFS_H */
752
753 /* This part must be outside protection */
754 #include <probes/define_trace.h>
This page took 0.045289 seconds and 3 git commands to generate.