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