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