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