Fix: update mm_vmscan instrumentation for kernel 4.11
[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
f1a87e24
MD
86#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
87
3bc29f0a 88LTTNG_TRACEPOINT_EVENT(btrfs_get_extent,
b87700e3 89
f3166f27
MD
90 TP_PROTO(struct btrfs_root *root, struct inode *inode,
91 struct extent_map *map),
b87700e3 92
f3166f27 93 TP_ARGS(root, inode, map),
b87700e3 94
f127e61e
MD
95 TP_FIELDS(
96 ctf_integer(u64, root_objectid, root->root_key.objectid)
f3166f27 97 ctf_integer(u64, ino, btrfs_ino(inode))
f127e61e
MD
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 )
b87700e3
AG
107)
108
f1a87e24
MD
109#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
110
111LTTNG_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
3bc29f0a 132LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__ordered_extent,
b87700e3
AG
133
134 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
135
136 TP_ARGS(inode, ordered),
137
f127e61e
MD
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,
b87700e3 149 BTRFS_I(inode)->root->root_key.objectid)
f127e61e 150 )
b87700e3
AG
151)
152
3bc29f0a 153LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_add,
b87700e3
AG
154
155 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
156
157 TP_ARGS(inode, ordered)
158)
159
3bc29f0a 160LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_remove,
b87700e3
AG
161
162 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
163
164 TP_ARGS(inode, ordered)
165)
166
3bc29f0a 167LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_start,
b87700e3
AG
168
169 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
170
171 TP_ARGS(inode, ordered)
172)
173
3bc29f0a 174LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__ordered_extent, btrfs_ordered_extent_put,
b87700e3
AG
175
176 TP_PROTO(struct inode *inode, struct btrfs_ordered_extent *ordered),
177
178 TP_ARGS(inode, ordered)
179)
180
3bc29f0a 181LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__writepage,
b87700e3
AG
182
183 TP_PROTO(struct page *page, struct inode *inode,
184 struct writeback_control *wbc),
185
186 TP_ARGS(page, inode, wbc),
187
f127e61e
MD
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)
b87700e3 195#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0))
f127e61e 196 ctf_integer(char, nonblocking, wbc->nonblocking)
b87700e3 197#endif
f127e61e
MD
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 )
b87700e3
AG
206)
207
9bbf98da
MD
208LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs__writepage,
209
210 __extent_writepage,
211
212 btrfs__extent_writepage,
b87700e3
AG
213
214 TP_PROTO(struct page *page, struct inode *inode,
215 struct writeback_control *wbc),
216
217 TP_ARGS(page, inode, wbc)
218)
219
3bc29f0a 220LTTNG_TRACEPOINT_EVENT(btrfs_writepage_end_io_hook,
b87700e3
AG
221
222 TP_PROTO(struct page *page, u64 start, u64 end, int uptodate),
223
224 TP_ARGS(page, start, end, uptodate),
225
f127e61e
MD
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 )
b87700e3
AG
235)
236
3bc29f0a 237LTTNG_TRACEPOINT_EVENT(btrfs_sync_file,
b87700e3
AG
238
239 TP_PROTO(struct file *file, int datasync),
240
241 TP_ARGS(file, datasync),
242
f127e61e
MD
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,
b87700e3 248 BTRFS_I(file->f_path.dentry->d_inode)->root->root_key.objectid)
f127e61e 249 )
b87700e3
AG
250)
251
fcd0a11c
MD
252#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
253LTTNG_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
3bc29f0a 264LTTNG_TRACEPOINT_EVENT(btrfs_sync_fs,
b87700e3
AG
265
266 TP_PROTO(int wait),
267
268 TP_ARGS(wait),
269
f127e61e
MD
270 TP_FIELDS(
271 ctf_integer(int, wait, wait)
272 )
b87700e3 273)
fcd0a11c
MD
274#endif
275
276LTTNG_TRACEPOINT_EVENT(btrfs_add_block_group,
b87700e3 277
fcd0a11c
MD
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))
295LTTNG_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
3bc29f0a 316LTTNG_TRACEPOINT_EVENT(btrfs_delayed_tree_ref,
b87700e3
AG
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
f127e61e
MD
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)
b87700e3 332#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
f127e61e 333 ctf_integer(u64, seq, ref->seq)
b87700e3 334#endif
f127e61e 335 )
b87700e3 336)
fcd0a11c 337#endif
b87700e3 338
3bc29f0a 339LTTNG_TRACEPOINT_EVENT(btrfs_delayed_data_ref,
b87700e3
AG
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
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(u64, owner, full_ref->objectid)
354 ctf_integer(u64, offset, full_ref->offset)
355 ctf_integer(int, type, ref->type)
b87700e3 356#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
f127e61e 357 ctf_integer(u64, seq, ref->seq)
b87700e3 358#endif
f127e61e 359 )
b87700e3
AG
360)
361
fcd0a11c
MD
362#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0))
363LTTNG_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
3bc29f0a 381LTTNG_TRACEPOINT_EVENT(btrfs_delayed_ref_head,
b87700e3
AG
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
f127e61e
MD
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 )
b87700e3 395)
fcd0a11c 396#endif
b87700e3 397
ff8bdcc2
MD
398#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
399
400LTTNG_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
417LTTNG_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
425LTTNG_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
3bc29f0a 435LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__chunk,
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
f127e61e
MD
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 )
b87700e3
AG
450)
451
3bc29f0a 452LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_alloc,
b87700e3
AG
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
3bc29f0a 460LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__chunk, btrfs_chunk_free,
b87700e3
AG
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
ff8bdcc2
MD
468#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
469
3bc29f0a 470LTTNG_TRACEPOINT_EVENT(btrfs_cow_block,
b87700e3
AG
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
f127e61e
MD
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 )
b87700e3
AG
485)
486
487#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
3bc29f0a 488LTTNG_TRACEPOINT_EVENT(btrfs_space_reservation,
b87700e3
AG
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
f127e61e
MD
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 )
b87700e3
AG
502)
503#endif
504
ff8bdcc2
MD
505#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
506
507LTTNG_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
519LTTNG_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
526LTTNG_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
3bc29f0a 535LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserved_extent,
b87700e3
AG
536
537 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
538
539 TP_ARGS(root, start, len),
540
f127e61e
MD
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 )
b87700e3
AG
546)
547
3bc29f0a 548LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_alloc,
b87700e3
AG
549
550 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
551
552 TP_ARGS(root, start, len)
553)
554
3bc29f0a 555LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserved_extent, btrfs_reserved_extent_free,
b87700e3
AG
556
557 TP_PROTO(struct btrfs_root *root, u64 start, u64 len),
558
559 TP_ARGS(root, start, len)
560)
561
ff8bdcc2
MD
562#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
563
b87700e3 564#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0))
ff8bdcc2
MD
565
566#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
567
568LTTNG_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
584LTTNG_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
600LTTNG_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
609LTTNG_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
3bc29f0a 620LTTNG_TRACEPOINT_EVENT_MAP(find_free_extent,
9cf29d3e
MD
621
622 btrfs_find_free_extent,
b87700e3
AG
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
f127e61e
MD
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 )
b87700e3
AG
635)
636
3bc29f0a 637LTTNG_TRACEPOINT_EVENT_CLASS(btrfs__reserve_extent,
b87700e3
AG
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
f127e61e
MD
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 )
b87700e3
AG
652)
653
3bc29f0a 654LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent,
b87700e3
AG
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
3bc29f0a 663LTTNG_TRACEPOINT_EVENT_INSTANCE(btrfs__reserve_extent, btrfs_reserve_extent_cluster,
b87700e3
AG
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
ff8bdcc2
MD
672#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
673
3bc29f0a 674LTTNG_TRACEPOINT_EVENT(btrfs_find_cluster,
b87700e3
AG
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
f127e61e
MD
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 )
b87700e3
AG
689)
690
3bc29f0a 691LTTNG_TRACEPOINT_EVENT(btrfs_failed_cluster_setup,
b87700e3
AG
692
693 TP_PROTO(struct btrfs_block_group_cache *block_group),
694
695 TP_ARGS(block_group),
696
f127e61e
MD
697 TP_FIELDS(
698 ctf_integer(u64, bg_objectid, block_group->key.objectid)
699 )
b87700e3
AG
700)
701
3bc29f0a 702LTTNG_TRACEPOINT_EVENT(btrfs_setup_cluster,
b87700e3
AG
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
f127e61e
MD
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 )
b87700e3
AG
717)
718#endif
719
720#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
3bc29f0a 721LTTNG_TRACEPOINT_EVENT_MAP(alloc_extent_state,
9cf29d3e
MD
722
723 btrfs_alloc_extent_state,
b87700e3
AG
724
725 TP_PROTO(struct extent_state *state, gfp_t mask, unsigned long IP),
726
727 TP_ARGS(state, mask, IP),
728
f127e61e 729 TP_FIELDS(
fa91fcac 730 ctf_integer_hex(struct extent_state *, state, state)
f127e61e
MD
731 ctf_integer(gfp_t, mask, mask)
732 ctf_integer(unsigned long, ip, IP)
733 )
b87700e3
AG
734)
735
3bc29f0a 736LTTNG_TRACEPOINT_EVENT_MAP(free_extent_state,
9cf29d3e
MD
737
738 btrfs_free_extent_state,
b87700e3
AG
739
740 TP_PROTO(struct extent_state *state, unsigned long IP),
741
742 TP_ARGS(state, IP),
743
f127e61e 744 TP_FIELDS(
fa91fcac 745 ctf_integer_hex(struct extent_state *, state, state)
f127e61e
MD
746 ctf_integer(unsigned long, ip, IP)
747 )
b87700e3
AG
748)
749#endif
750
3bc29f0a 751#endif /* LTTNG_TRACE_BTRFS_H */
b87700e3
AG
752
753/* This part must be outside protection */
6ec43db8 754#include <probes/define_trace.h>
This page took 0.062773 seconds and 4 git commands to generate.