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