diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-10-01 05:20:33 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-10-01 05:20:48 -0400 |
commit | 0aa73ba1c4e1ad1d51a29e0df95ccd9f746918b6 (patch) | |
tree | f0714ddcd02812b4fbe3b5405df9e4068f5587e2 /include/trace | |
parent | 925936ebf35a95c290e010b784c962164e6728f3 (diff) | |
parent | 33974093c024f08caadd2fc71a83bd811ed1831d (diff) |
Merge branch 'tracing/urgent' into tracing/core
Merge reason: Pick up latest fixes and update to latest upstream.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/ext4.h | 318 | ||||
-rw-r--r-- | include/trace/events/jbd2.h | 80 | ||||
-rw-r--r-- | include/trace/events/kmem.h | 163 | ||||
-rw-r--r-- | include/trace/events/power.h | 81 | ||||
-rw-r--r-- | include/trace/events/sched.h | 33 | ||||
-rw-r--r-- | include/trace/events/timer.h | 342 | ||||
-rw-r--r-- | include/trace/events/workqueue.h | 4 | ||||
-rw-r--r-- | include/trace/ftrace.h | 117 |
8 files changed, 1044 insertions, 94 deletions
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h index 8d433c4e3709..d09550bf3f95 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h | |||
@@ -5,10 +5,16 @@ | |||
5 | #define _TRACE_EXT4_H | 5 | #define _TRACE_EXT4_H |
6 | 6 | ||
7 | #include <linux/writeback.h> | 7 | #include <linux/writeback.h> |
8 | #include "../../../fs/ext4/ext4.h" | ||
9 | #include "../../../fs/ext4/mballoc.h" | ||
10 | #include <linux/tracepoint.h> | 8 | #include <linux/tracepoint.h> |
11 | 9 | ||
10 | struct ext4_allocation_context; | ||
11 | struct ext4_allocation_request; | ||
12 | struct ext4_prealloc_space; | ||
13 | struct ext4_inode_info; | ||
14 | struct mpage_da_data; | ||
15 | |||
16 | #define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode)) | ||
17 | |||
12 | TRACE_EVENT(ext4_free_inode, | 18 | TRACE_EVENT(ext4_free_inode, |
13 | TP_PROTO(struct inode *inode), | 19 | TP_PROTO(struct inode *inode), |
14 | 20 | ||
@@ -33,8 +39,8 @@ TRACE_EVENT(ext4_free_inode, | |||
33 | ), | 39 | ), |
34 | 40 | ||
35 | TP_printk("dev %s ino %lu mode %d uid %u gid %u blocks %llu", | 41 | TP_printk("dev %s ino %lu mode %d uid %u gid %u blocks %llu", |
36 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->mode, | 42 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, |
37 | __entry->uid, __entry->gid, | 43 | __entry->mode, __entry->uid, __entry->gid, |
38 | (unsigned long long) __entry->blocks) | 44 | (unsigned long long) __entry->blocks) |
39 | ); | 45 | ); |
40 | 46 | ||
@@ -56,7 +62,8 @@ TRACE_EVENT(ext4_request_inode, | |||
56 | ), | 62 | ), |
57 | 63 | ||
58 | TP_printk("dev %s dir %lu mode %d", | 64 | TP_printk("dev %s dir %lu mode %d", |
59 | jbd2_dev_to_name(__entry->dev), __entry->dir, __entry->mode) | 65 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->dir, |
66 | __entry->mode) | ||
60 | ); | 67 | ); |
61 | 68 | ||
62 | TRACE_EVENT(ext4_allocate_inode, | 69 | TRACE_EVENT(ext4_allocate_inode, |
@@ -79,7 +86,8 @@ TRACE_EVENT(ext4_allocate_inode, | |||
79 | ), | 86 | ), |
80 | 87 | ||
81 | TP_printk("dev %s ino %lu dir %lu mode %d", | 88 | TP_printk("dev %s ino %lu dir %lu mode %d", |
82 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->dir, __entry->mode) | 89 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, |
90 | (unsigned long) __entry->dir, __entry->mode) | ||
83 | ); | 91 | ); |
84 | 92 | ||
85 | TRACE_EVENT(ext4_write_begin, | 93 | TRACE_EVENT(ext4_write_begin, |
@@ -106,8 +114,8 @@ TRACE_EVENT(ext4_write_begin, | |||
106 | ), | 114 | ), |
107 | 115 | ||
108 | TP_printk("dev %s ino %lu pos %llu len %u flags %u", | 116 | TP_printk("dev %s ino %lu pos %llu len %u flags %u", |
109 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->pos, __entry->len, | 117 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, |
110 | __entry->flags) | 118 | __entry->pos, __entry->len, __entry->flags) |
111 | ); | 119 | ); |
112 | 120 | ||
113 | TRACE_EVENT(ext4_ordered_write_end, | 121 | TRACE_EVENT(ext4_ordered_write_end, |
@@ -133,8 +141,8 @@ TRACE_EVENT(ext4_ordered_write_end, | |||
133 | ), | 141 | ), |
134 | 142 | ||
135 | TP_printk("dev %s ino %lu pos %llu len %u copied %u", | 143 | TP_printk("dev %s ino %lu pos %llu len %u copied %u", |
136 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->pos, __entry->len, | 144 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, |
137 | __entry->copied) | 145 | __entry->pos, __entry->len, __entry->copied) |
138 | ); | 146 | ); |
139 | 147 | ||
140 | TRACE_EVENT(ext4_writeback_write_end, | 148 | TRACE_EVENT(ext4_writeback_write_end, |
@@ -160,8 +168,8 @@ TRACE_EVENT(ext4_writeback_write_end, | |||
160 | ), | 168 | ), |
161 | 169 | ||
162 | TP_printk("dev %s ino %lu pos %llu len %u copied %u", | 170 | TP_printk("dev %s ino %lu pos %llu len %u copied %u", |
163 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->pos, __entry->len, | 171 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, |
164 | __entry->copied) | 172 | __entry->pos, __entry->len, __entry->copied) |
165 | ); | 173 | ); |
166 | 174 | ||
167 | TRACE_EVENT(ext4_journalled_write_end, | 175 | TRACE_EVENT(ext4_journalled_write_end, |
@@ -186,8 +194,8 @@ TRACE_EVENT(ext4_journalled_write_end, | |||
186 | ), | 194 | ), |
187 | 195 | ||
188 | TP_printk("dev %s ino %lu pos %llu len %u copied %u", | 196 | TP_printk("dev %s ino %lu pos %llu len %u copied %u", |
189 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->pos, __entry->len, | 197 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, |
190 | __entry->copied) | 198 | __entry->pos, __entry->len, __entry->copied) |
191 | ); | 199 | ); |
192 | 200 | ||
193 | TRACE_EVENT(ext4_writepage, | 201 | TRACE_EVENT(ext4_writepage, |
@@ -209,7 +217,8 @@ TRACE_EVENT(ext4_writepage, | |||
209 | ), | 217 | ), |
210 | 218 | ||
211 | TP_printk("dev %s ino %lu page_index %lu", | 219 | TP_printk("dev %s ino %lu page_index %lu", |
212 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->index) | 220 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, |
221 | __entry->index) | ||
213 | ); | 222 | ); |
214 | 223 | ||
215 | TRACE_EVENT(ext4_da_writepages, | 224 | TRACE_EVENT(ext4_da_writepages, |
@@ -228,6 +237,7 @@ TRACE_EVENT(ext4_da_writepages, | |||
228 | __field( char, for_kupdate ) | 237 | __field( char, for_kupdate ) |
229 | __field( char, for_reclaim ) | 238 | __field( char, for_reclaim ) |
230 | __field( char, range_cyclic ) | 239 | __field( char, range_cyclic ) |
240 | __field( pgoff_t, writeback_index ) | ||
231 | ), | 241 | ), |
232 | 242 | ||
233 | TP_fast_assign( | 243 | TP_fast_assign( |
@@ -241,14 +251,51 @@ TRACE_EVENT(ext4_da_writepages, | |||
241 | __entry->for_kupdate = wbc->for_kupdate; | 251 | __entry->for_kupdate = wbc->for_kupdate; |
242 | __entry->for_reclaim = wbc->for_reclaim; | 252 | __entry->for_reclaim = wbc->for_reclaim; |
243 | __entry->range_cyclic = wbc->range_cyclic; | 253 | __entry->range_cyclic = wbc->range_cyclic; |
254 | __entry->writeback_index = inode->i_mapping->writeback_index; | ||
244 | ), | 255 | ), |
245 | 256 | ||
246 | TP_printk("dev %s ino %lu nr_t_write %ld pages_skipped %ld range_start %llu range_end %llu nonblocking %d for_kupdate %d for_reclaim %d range_cyclic %d", | 257 | TP_printk("dev %s ino %lu nr_to_write %ld pages_skipped %ld range_start %llu range_end %llu nonblocking %d for_kupdate %d for_reclaim %d range_cyclic %d writeback_index %lu", |
247 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->nr_to_write, | 258 | jbd2_dev_to_name(__entry->dev), |
259 | (unsigned long) __entry->ino, __entry->nr_to_write, | ||
248 | __entry->pages_skipped, __entry->range_start, | 260 | __entry->pages_skipped, __entry->range_start, |
249 | __entry->range_end, __entry->nonblocking, | 261 | __entry->range_end, __entry->nonblocking, |
250 | __entry->for_kupdate, __entry->for_reclaim, | 262 | __entry->for_kupdate, __entry->for_reclaim, |
251 | __entry->range_cyclic) | 263 | __entry->range_cyclic, |
264 | (unsigned long) __entry->writeback_index) | ||
265 | ); | ||
266 | |||
267 | TRACE_EVENT(ext4_da_write_pages, | ||
268 | TP_PROTO(struct inode *inode, struct mpage_da_data *mpd), | ||
269 | |||
270 | TP_ARGS(inode, mpd), | ||
271 | |||
272 | TP_STRUCT__entry( | ||
273 | __field( dev_t, dev ) | ||
274 | __field( ino_t, ino ) | ||
275 | __field( __u64, b_blocknr ) | ||
276 | __field( __u32, b_size ) | ||
277 | __field( __u32, b_state ) | ||
278 | __field( unsigned long, first_page ) | ||
279 | __field( int, io_done ) | ||
280 | __field( int, pages_written ) | ||
281 | ), | ||
282 | |||
283 | TP_fast_assign( | ||
284 | __entry->dev = inode->i_sb->s_dev; | ||
285 | __entry->ino = inode->i_ino; | ||
286 | __entry->b_blocknr = mpd->b_blocknr; | ||
287 | __entry->b_size = mpd->b_size; | ||
288 | __entry->b_state = mpd->b_state; | ||
289 | __entry->first_page = mpd->first_page; | ||
290 | __entry->io_done = mpd->io_done; | ||
291 | __entry->pages_written = mpd->pages_written; | ||
292 | ), | ||
293 | |||
294 | TP_printk("dev %s ino %lu b_blocknr %llu b_size %u b_state 0x%04x first_page %lu io_done %d pages_written %d", | ||
295 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, | ||
296 | __entry->b_blocknr, __entry->b_size, | ||
297 | __entry->b_state, __entry->first_page, | ||
298 | __entry->io_done, __entry->pages_written) | ||
252 | ); | 299 | ); |
253 | 300 | ||
254 | TRACE_EVENT(ext4_da_writepages_result, | 301 | TRACE_EVENT(ext4_da_writepages_result, |
@@ -266,6 +313,7 @@ TRACE_EVENT(ext4_da_writepages_result, | |||
266 | __field( char, encountered_congestion ) | 313 | __field( char, encountered_congestion ) |
267 | __field( char, more_io ) | 314 | __field( char, more_io ) |
268 | __field( char, no_nrwrite_index_update ) | 315 | __field( char, no_nrwrite_index_update ) |
316 | __field( pgoff_t, writeback_index ) | ||
269 | ), | 317 | ), |
270 | 318 | ||
271 | TP_fast_assign( | 319 | TP_fast_assign( |
@@ -277,13 +325,16 @@ TRACE_EVENT(ext4_da_writepages_result, | |||
277 | __entry->encountered_congestion = wbc->encountered_congestion; | 325 | __entry->encountered_congestion = wbc->encountered_congestion; |
278 | __entry->more_io = wbc->more_io; | 326 | __entry->more_io = wbc->more_io; |
279 | __entry->no_nrwrite_index_update = wbc->no_nrwrite_index_update; | 327 | __entry->no_nrwrite_index_update = wbc->no_nrwrite_index_update; |
328 | __entry->writeback_index = inode->i_mapping->writeback_index; | ||
280 | ), | 329 | ), |
281 | 330 | ||
282 | TP_printk("dev %s ino %lu ret %d pages_written %d pages_skipped %ld congestion %d more_io %d no_nrwrite_index_update %d", | 331 | TP_printk("dev %s ino %lu ret %d pages_written %d pages_skipped %ld congestion %d more_io %d no_nrwrite_index_update %d writeback_index %lu", |
283 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->ret, | 332 | jbd2_dev_to_name(__entry->dev), |
333 | (unsigned long) __entry->ino, __entry->ret, | ||
284 | __entry->pages_written, __entry->pages_skipped, | 334 | __entry->pages_written, __entry->pages_skipped, |
285 | __entry->encountered_congestion, __entry->more_io, | 335 | __entry->encountered_congestion, __entry->more_io, |
286 | __entry->no_nrwrite_index_update) | 336 | __entry->no_nrwrite_index_update, |
337 | (unsigned long) __entry->writeback_index) | ||
287 | ); | 338 | ); |
288 | 339 | ||
289 | TRACE_EVENT(ext4_da_write_begin, | 340 | TRACE_EVENT(ext4_da_write_begin, |
@@ -309,8 +360,8 @@ TRACE_EVENT(ext4_da_write_begin, | |||
309 | ), | 360 | ), |
310 | 361 | ||
311 | TP_printk("dev %s ino %lu pos %llu len %u flags %u", | 362 | TP_printk("dev %s ino %lu pos %llu len %u flags %u", |
312 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->pos, __entry->len, | 363 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, |
313 | __entry->flags) | 364 | __entry->pos, __entry->len, __entry->flags) |
314 | ); | 365 | ); |
315 | 366 | ||
316 | TRACE_EVENT(ext4_da_write_end, | 367 | TRACE_EVENT(ext4_da_write_end, |
@@ -336,8 +387,8 @@ TRACE_EVENT(ext4_da_write_end, | |||
336 | ), | 387 | ), |
337 | 388 | ||
338 | TP_printk("dev %s ino %lu pos %llu len %u copied %u", | 389 | TP_printk("dev %s ino %lu pos %llu len %u copied %u", |
339 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->pos, __entry->len, | 390 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, |
340 | __entry->copied) | 391 | __entry->pos, __entry->len, __entry->copied) |
341 | ); | 392 | ); |
342 | 393 | ||
343 | TRACE_EVENT(ext4_discard_blocks, | 394 | TRACE_EVENT(ext4_discard_blocks, |
@@ -387,8 +438,8 @@ TRACE_EVENT(ext4_mb_new_inode_pa, | |||
387 | ), | 438 | ), |
388 | 439 | ||
389 | TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu", | 440 | TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu", |
390 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->pa_pstart, | 441 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, |
391 | __entry->pa_len, __entry->pa_lstart) | 442 | __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart) |
392 | ); | 443 | ); |
393 | 444 | ||
394 | TRACE_EVENT(ext4_mb_new_group_pa, | 445 | TRACE_EVENT(ext4_mb_new_group_pa, |
@@ -415,8 +466,8 @@ TRACE_EVENT(ext4_mb_new_group_pa, | |||
415 | ), | 466 | ), |
416 | 467 | ||
417 | TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu", | 468 | TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu", |
418 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->pa_pstart, | 469 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, |
419 | __entry->pa_len, __entry->pa_lstart) | 470 | __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart) |
420 | ); | 471 | ); |
421 | 472 | ||
422 | TRACE_EVENT(ext4_mb_release_inode_pa, | 473 | TRACE_EVENT(ext4_mb_release_inode_pa, |
@@ -442,8 +493,8 @@ TRACE_EVENT(ext4_mb_release_inode_pa, | |||
442 | ), | 493 | ), |
443 | 494 | ||
444 | TP_printk("dev %s ino %lu block %llu count %u", | 495 | TP_printk("dev %s ino %lu block %llu count %u", |
445 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->block, | 496 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, |
446 | __entry->count) | 497 | __entry->block, __entry->count) |
447 | ); | 498 | ); |
448 | 499 | ||
449 | TRACE_EVENT(ext4_mb_release_group_pa, | 500 | TRACE_EVENT(ext4_mb_release_group_pa, |
@@ -488,7 +539,7 @@ TRACE_EVENT(ext4_discard_preallocations, | |||
488 | ), | 539 | ), |
489 | 540 | ||
490 | TP_printk("dev %s ino %lu", | 541 | TP_printk("dev %s ino %lu", |
491 | jbd2_dev_to_name(__entry->dev), __entry->ino) | 542 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino) |
492 | ); | 543 | ); |
493 | 544 | ||
494 | TRACE_EVENT(ext4_mb_discard_preallocations, | 545 | TRACE_EVENT(ext4_mb_discard_preallocations, |
@@ -543,8 +594,8 @@ TRACE_EVENT(ext4_request_blocks, | |||
543 | ), | 594 | ), |
544 | 595 | ||
545 | TP_printk("dev %s ino %lu flags %u len %u lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ", | 596 | TP_printk("dev %s ino %lu flags %u len %u lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ", |
546 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->flags, | 597 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, |
547 | __entry->len, | 598 | __entry->flags, __entry->len, |
548 | (unsigned long long) __entry->logical, | 599 | (unsigned long long) __entry->logical, |
549 | (unsigned long long) __entry->goal, | 600 | (unsigned long long) __entry->goal, |
550 | (unsigned long long) __entry->lleft, | 601 | (unsigned long long) __entry->lleft, |
@@ -587,8 +638,8 @@ TRACE_EVENT(ext4_allocate_blocks, | |||
587 | ), | 638 | ), |
588 | 639 | ||
589 | TP_printk("dev %s ino %lu flags %u len %u block %llu lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ", | 640 | TP_printk("dev %s ino %lu flags %u len %u block %llu lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ", |
590 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->flags, | 641 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, |
591 | __entry->len, __entry->block, | 642 | __entry->flags, __entry->len, __entry->block, |
592 | (unsigned long long) __entry->logical, | 643 | (unsigned long long) __entry->logical, |
593 | (unsigned long long) __entry->goal, | 644 | (unsigned long long) __entry->goal, |
594 | (unsigned long long) __entry->lleft, | 645 | (unsigned long long) __entry->lleft, |
@@ -621,8 +672,8 @@ TRACE_EVENT(ext4_free_blocks, | |||
621 | ), | 672 | ), |
622 | 673 | ||
623 | TP_printk("dev %s ino %lu block %llu count %lu metadata %d", | 674 | TP_printk("dev %s ino %lu block %llu count %lu metadata %d", |
624 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->block, | 675 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, |
625 | __entry->count, __entry->metadata) | 676 | __entry->block, __entry->count, __entry->metadata) |
626 | ); | 677 | ); |
627 | 678 | ||
628 | TRACE_EVENT(ext4_sync_file, | 679 | TRACE_EVENT(ext4_sync_file, |
@@ -645,8 +696,8 @@ TRACE_EVENT(ext4_sync_file, | |||
645 | ), | 696 | ), |
646 | 697 | ||
647 | TP_printk("dev %s ino %ld parent %ld datasync %d ", | 698 | TP_printk("dev %s ino %ld parent %ld datasync %d ", |
648 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->parent, | 699 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, |
649 | __entry->datasync) | 700 | (unsigned long) __entry->parent, __entry->datasync) |
650 | ); | 701 | ); |
651 | 702 | ||
652 | TRACE_EVENT(ext4_sync_fs, | 703 | TRACE_EVENT(ext4_sync_fs, |
@@ -669,6 +720,193 @@ TRACE_EVENT(ext4_sync_fs, | |||
669 | __entry->wait) | 720 | __entry->wait) |
670 | ); | 721 | ); |
671 | 722 | ||
723 | TRACE_EVENT(ext4_alloc_da_blocks, | ||
724 | TP_PROTO(struct inode *inode), | ||
725 | |||
726 | TP_ARGS(inode), | ||
727 | |||
728 | TP_STRUCT__entry( | ||
729 | __field( dev_t, dev ) | ||
730 | __field( ino_t, ino ) | ||
731 | __field( unsigned int, data_blocks ) | ||
732 | __field( unsigned int, meta_blocks ) | ||
733 | ), | ||
734 | |||
735 | TP_fast_assign( | ||
736 | __entry->dev = inode->i_sb->s_dev; | ||
737 | __entry->ino = inode->i_ino; | ||
738 | __entry->data_blocks = EXT4_I(inode)->i_reserved_data_blocks; | ||
739 | __entry->meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks; | ||
740 | ), | ||
741 | |||
742 | TP_printk("dev %s ino %lu data_blocks %u meta_blocks %u", | ||
743 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, | ||
744 | __entry->data_blocks, __entry->meta_blocks) | ||
745 | ); | ||
746 | |||
747 | TRACE_EVENT(ext4_mballoc_alloc, | ||
748 | TP_PROTO(struct ext4_allocation_context *ac), | ||
749 | |||
750 | TP_ARGS(ac), | ||
751 | |||
752 | TP_STRUCT__entry( | ||
753 | __field( dev_t, dev ) | ||
754 | __field( ino_t, ino ) | ||
755 | __field( __u16, found ) | ||
756 | __field( __u16, groups ) | ||
757 | __field( __u16, buddy ) | ||
758 | __field( __u16, flags ) | ||
759 | __field( __u16, tail ) | ||
760 | __field( __u8, cr ) | ||
761 | __field( __u32, orig_logical ) | ||
762 | __field( int, orig_start ) | ||
763 | __field( __u32, orig_group ) | ||
764 | __field( int, orig_len ) | ||
765 | __field( __u32, goal_logical ) | ||
766 | __field( int, goal_start ) | ||
767 | __field( __u32, goal_group ) | ||
768 | __field( int, goal_len ) | ||
769 | __field( __u32, result_logical ) | ||
770 | __field( int, result_start ) | ||
771 | __field( __u32, result_group ) | ||
772 | __field( int, result_len ) | ||
773 | ), | ||
774 | |||
775 | TP_fast_assign( | ||
776 | __entry->dev = ac->ac_inode->i_sb->s_dev; | ||
777 | __entry->ino = ac->ac_inode->i_ino; | ||
778 | __entry->found = ac->ac_found; | ||
779 | __entry->flags = ac->ac_flags; | ||
780 | __entry->groups = ac->ac_groups_scanned; | ||
781 | __entry->buddy = ac->ac_buddy; | ||
782 | __entry->tail = ac->ac_tail; | ||
783 | __entry->cr = ac->ac_criteria; | ||
784 | __entry->orig_logical = ac->ac_o_ex.fe_logical; | ||
785 | __entry->orig_start = ac->ac_o_ex.fe_start; | ||
786 | __entry->orig_group = ac->ac_o_ex.fe_group; | ||
787 | __entry->orig_len = ac->ac_o_ex.fe_len; | ||
788 | __entry->goal_logical = ac->ac_g_ex.fe_logical; | ||
789 | __entry->goal_start = ac->ac_g_ex.fe_start; | ||
790 | __entry->goal_group = ac->ac_g_ex.fe_group; | ||
791 | __entry->goal_len = ac->ac_g_ex.fe_len; | ||
792 | __entry->result_logical = ac->ac_f_ex.fe_logical; | ||
793 | __entry->result_start = ac->ac_f_ex.fe_start; | ||
794 | __entry->result_group = ac->ac_f_ex.fe_group; | ||
795 | __entry->result_len = ac->ac_f_ex.fe_len; | ||
796 | ), | ||
797 | |||
798 | TP_printk("dev %s inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u " | ||
799 | "result %u/%d/%u@%u blks %u grps %u cr %u flags 0x%04x " | ||
800 | "tail %u broken %u", | ||
801 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, | ||
802 | __entry->orig_group, __entry->orig_start, | ||
803 | __entry->orig_len, __entry->orig_logical, | ||
804 | __entry->goal_group, __entry->goal_start, | ||
805 | __entry->goal_len, __entry->goal_logical, | ||
806 | __entry->result_group, __entry->result_start, | ||
807 | __entry->result_len, __entry->result_logical, | ||
808 | __entry->found, __entry->groups, __entry->cr, | ||
809 | __entry->flags, __entry->tail, | ||
810 | __entry->buddy ? 1 << __entry->buddy : 0) | ||
811 | ); | ||
812 | |||
813 | TRACE_EVENT(ext4_mballoc_prealloc, | ||
814 | TP_PROTO(struct ext4_allocation_context *ac), | ||
815 | |||
816 | TP_ARGS(ac), | ||
817 | |||
818 | TP_STRUCT__entry( | ||
819 | __field( dev_t, dev ) | ||
820 | __field( ino_t, ino ) | ||
821 | __field( __u32, orig_logical ) | ||
822 | __field( int, orig_start ) | ||
823 | __field( __u32, orig_group ) | ||
824 | __field( int, orig_len ) | ||
825 | __field( __u32, result_logical ) | ||
826 | __field( int, result_start ) | ||
827 | __field( __u32, result_group ) | ||
828 | __field( int, result_len ) | ||
829 | ), | ||
830 | |||
831 | TP_fast_assign( | ||
832 | __entry->dev = ac->ac_inode->i_sb->s_dev; | ||
833 | __entry->ino = ac->ac_inode->i_ino; | ||
834 | __entry->orig_logical = ac->ac_o_ex.fe_logical; | ||
835 | __entry->orig_start = ac->ac_o_ex.fe_start; | ||
836 | __entry->orig_group = ac->ac_o_ex.fe_group; | ||
837 | __entry->orig_len = ac->ac_o_ex.fe_len; | ||
838 | __entry->result_logical = ac->ac_b_ex.fe_logical; | ||
839 | __entry->result_start = ac->ac_b_ex.fe_start; | ||
840 | __entry->result_group = ac->ac_b_ex.fe_group; | ||
841 | __entry->result_len = ac->ac_b_ex.fe_len; | ||
842 | ), | ||
843 | |||
844 | TP_printk("dev %s inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u", | ||
845 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, | ||
846 | __entry->orig_group, __entry->orig_start, | ||
847 | __entry->orig_len, __entry->orig_logical, | ||
848 | __entry->result_group, __entry->result_start, | ||
849 | __entry->result_len, __entry->result_logical) | ||
850 | ); | ||
851 | |||
852 | TRACE_EVENT(ext4_mballoc_discard, | ||
853 | TP_PROTO(struct ext4_allocation_context *ac), | ||
854 | |||
855 | TP_ARGS(ac), | ||
856 | |||
857 | TP_STRUCT__entry( | ||
858 | __field( dev_t, dev ) | ||
859 | __field( ino_t, ino ) | ||
860 | __field( __u32, result_logical ) | ||
861 | __field( int, result_start ) | ||
862 | __field( __u32, result_group ) | ||
863 | __field( int, result_len ) | ||
864 | ), | ||
865 | |||
866 | TP_fast_assign( | ||
867 | __entry->dev = ac->ac_inode->i_sb->s_dev; | ||
868 | __entry->ino = ac->ac_inode->i_ino; | ||
869 | __entry->result_logical = ac->ac_b_ex.fe_logical; | ||
870 | __entry->result_start = ac->ac_b_ex.fe_start; | ||
871 | __entry->result_group = ac->ac_b_ex.fe_group; | ||
872 | __entry->result_len = ac->ac_b_ex.fe_len; | ||
873 | ), | ||
874 | |||
875 | TP_printk("dev %s inode %lu extent %u/%d/%u@%u ", | ||
876 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, | ||
877 | __entry->result_group, __entry->result_start, | ||
878 | __entry->result_len, __entry->result_logical) | ||
879 | ); | ||
880 | |||
881 | TRACE_EVENT(ext4_mballoc_free, | ||
882 | TP_PROTO(struct ext4_allocation_context *ac), | ||
883 | |||
884 | TP_ARGS(ac), | ||
885 | |||
886 | TP_STRUCT__entry( | ||
887 | __field( dev_t, dev ) | ||
888 | __field( ino_t, ino ) | ||
889 | __field( __u32, result_logical ) | ||
890 | __field( int, result_start ) | ||
891 | __field( __u32, result_group ) | ||
892 | __field( int, result_len ) | ||
893 | ), | ||
894 | |||
895 | TP_fast_assign( | ||
896 | __entry->dev = ac->ac_inode->i_sb->s_dev; | ||
897 | __entry->ino = ac->ac_inode->i_ino; | ||
898 | __entry->result_logical = ac->ac_b_ex.fe_logical; | ||
899 | __entry->result_start = ac->ac_b_ex.fe_start; | ||
900 | __entry->result_group = ac->ac_b_ex.fe_group; | ||
901 | __entry->result_len = ac->ac_b_ex.fe_len; | ||
902 | ), | ||
903 | |||
904 | TP_printk("dev %s inode %lu extent %u/%d/%u@%u ", | ||
905 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, | ||
906 | __entry->result_group, __entry->result_start, | ||
907 | __entry->result_len, __entry->result_logical) | ||
908 | ); | ||
909 | |||
672 | #endif /* _TRACE_EXT4_H */ | 910 | #endif /* _TRACE_EXT4_H */ |
673 | 911 | ||
674 | /* This part must be outside protection */ | 912 | /* This part must be outside protection */ |
diff --git a/include/trace/events/jbd2.h b/include/trace/events/jbd2.h index 10813fa0c8d0..3c60b75adb9e 100644 --- a/include/trace/events/jbd2.h +++ b/include/trace/events/jbd2.h | |||
@@ -7,6 +7,9 @@ | |||
7 | #include <linux/jbd2.h> | 7 | #include <linux/jbd2.h> |
8 | #include <linux/tracepoint.h> | 8 | #include <linux/tracepoint.h> |
9 | 9 | ||
10 | struct transaction_chp_stats_s; | ||
11 | struct transaction_run_stats_s; | ||
12 | |||
10 | TRACE_EVENT(jbd2_checkpoint, | 13 | TRACE_EVENT(jbd2_checkpoint, |
11 | 14 | ||
12 | TP_PROTO(journal_t *journal, int result), | 15 | TP_PROTO(journal_t *journal, int result), |
@@ -159,7 +162,82 @@ TRACE_EVENT(jbd2_submit_inode_data, | |||
159 | ), | 162 | ), |
160 | 163 | ||
161 | TP_printk("dev %s ino %lu", | 164 | TP_printk("dev %s ino %lu", |
162 | jbd2_dev_to_name(__entry->dev), __entry->ino) | 165 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino) |
166 | ); | ||
167 | |||
168 | TRACE_EVENT(jbd2_run_stats, | ||
169 | TP_PROTO(dev_t dev, unsigned long tid, | ||
170 | struct transaction_run_stats_s *stats), | ||
171 | |||
172 | TP_ARGS(dev, tid, stats), | ||
173 | |||
174 | TP_STRUCT__entry( | ||
175 | __field( dev_t, dev ) | ||
176 | __field( unsigned long, tid ) | ||
177 | __field( unsigned long, wait ) | ||
178 | __field( unsigned long, running ) | ||
179 | __field( unsigned long, locked ) | ||
180 | __field( unsigned long, flushing ) | ||
181 | __field( unsigned long, logging ) | ||
182 | __field( __u32, handle_count ) | ||
183 | __field( __u32, blocks ) | ||
184 | __field( __u32, blocks_logged ) | ||
185 | ), | ||
186 | |||
187 | TP_fast_assign( | ||
188 | __entry->dev = dev; | ||
189 | __entry->tid = tid; | ||
190 | __entry->wait = stats->rs_wait; | ||
191 | __entry->running = stats->rs_running; | ||
192 | __entry->locked = stats->rs_locked; | ||
193 | __entry->flushing = stats->rs_flushing; | ||
194 | __entry->logging = stats->rs_logging; | ||
195 | __entry->handle_count = stats->rs_handle_count; | ||
196 | __entry->blocks = stats->rs_blocks; | ||
197 | __entry->blocks_logged = stats->rs_blocks_logged; | ||
198 | ), | ||
199 | |||
200 | TP_printk("dev %s tid %lu wait %u running %u locked %u flushing %u " | ||
201 | "logging %u handle_count %u blocks %u blocks_logged %u", | ||
202 | jbd2_dev_to_name(__entry->dev), __entry->tid, | ||
203 | jiffies_to_msecs(__entry->wait), | ||
204 | jiffies_to_msecs(__entry->running), | ||
205 | jiffies_to_msecs(__entry->locked), | ||
206 | jiffies_to_msecs(__entry->flushing), | ||
207 | jiffies_to_msecs(__entry->logging), | ||
208 | __entry->handle_count, __entry->blocks, | ||
209 | __entry->blocks_logged) | ||
210 | ); | ||
211 | |||
212 | TRACE_EVENT(jbd2_checkpoint_stats, | ||
213 | TP_PROTO(dev_t dev, unsigned long tid, | ||
214 | struct transaction_chp_stats_s *stats), | ||
215 | |||
216 | TP_ARGS(dev, tid, stats), | ||
217 | |||
218 | TP_STRUCT__entry( | ||
219 | __field( dev_t, dev ) | ||
220 | __field( unsigned long, tid ) | ||
221 | __field( unsigned long, chp_time ) | ||
222 | __field( __u32, forced_to_close ) | ||
223 | __field( __u32, written ) | ||
224 | __field( __u32, dropped ) | ||
225 | ), | ||
226 | |||
227 | TP_fast_assign( | ||
228 | __entry->dev = dev; | ||
229 | __entry->tid = tid; | ||
230 | __entry->chp_time = stats->cs_chp_time; | ||
231 | __entry->forced_to_close= stats->cs_forced_to_close; | ||
232 | __entry->written = stats->cs_written; | ||
233 | __entry->dropped = stats->cs_dropped; | ||
234 | ), | ||
235 | |||
236 | TP_printk("dev %s tid %lu chp_time %u forced_to_close %u " | ||
237 | "written %u dropped %u", | ||
238 | jbd2_dev_to_name(__entry->dev), __entry->tid, | ||
239 | jiffies_to_msecs(__entry->chp_time), | ||
240 | __entry->forced_to_close, __entry->written, __entry->dropped) | ||
163 | ); | 241 | ); |
164 | 242 | ||
165 | #endif /* _TRACE_JBD2_H */ | 243 | #endif /* _TRACE_JBD2_H */ |
diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h index 1493c541f9c4..eaf46bdd18a5 100644 --- a/include/trace/events/kmem.h +++ b/include/trace/events/kmem.h | |||
@@ -225,6 +225,169 @@ TRACE_EVENT(kmem_cache_free, | |||
225 | 225 | ||
226 | TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr) | 226 | TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr) |
227 | ); | 227 | ); |
228 | |||
229 | TRACE_EVENT(mm_page_free_direct, | ||
230 | |||
231 | TP_PROTO(struct page *page, unsigned int order), | ||
232 | |||
233 | TP_ARGS(page, order), | ||
234 | |||
235 | TP_STRUCT__entry( | ||
236 | __field( struct page *, page ) | ||
237 | __field( unsigned int, order ) | ||
238 | ), | ||
239 | |||
240 | TP_fast_assign( | ||
241 | __entry->page = page; | ||
242 | __entry->order = order; | ||
243 | ), | ||
244 | |||
245 | TP_printk("page=%p pfn=%lu order=%d", | ||
246 | __entry->page, | ||
247 | page_to_pfn(__entry->page), | ||
248 | __entry->order) | ||
249 | ); | ||
250 | |||
251 | TRACE_EVENT(mm_pagevec_free, | ||
252 | |||
253 | TP_PROTO(struct page *page, int cold), | ||
254 | |||
255 | TP_ARGS(page, cold), | ||
256 | |||
257 | TP_STRUCT__entry( | ||
258 | __field( struct page *, page ) | ||
259 | __field( int, cold ) | ||
260 | ), | ||
261 | |||
262 | TP_fast_assign( | ||
263 | __entry->page = page; | ||
264 | __entry->cold = cold; | ||
265 | ), | ||
266 | |||
267 | TP_printk("page=%p pfn=%lu order=0 cold=%d", | ||
268 | __entry->page, | ||
269 | page_to_pfn(__entry->page), | ||
270 | __entry->cold) | ||
271 | ); | ||
272 | |||
273 | TRACE_EVENT(mm_page_alloc, | ||
274 | |||
275 | TP_PROTO(struct page *page, unsigned int order, | ||
276 | gfp_t gfp_flags, int migratetype), | ||
277 | |||
278 | TP_ARGS(page, order, gfp_flags, migratetype), | ||
279 | |||
280 | TP_STRUCT__entry( | ||
281 | __field( struct page *, page ) | ||
282 | __field( unsigned int, order ) | ||
283 | __field( gfp_t, gfp_flags ) | ||
284 | __field( int, migratetype ) | ||
285 | ), | ||
286 | |||
287 | TP_fast_assign( | ||
288 | __entry->page = page; | ||
289 | __entry->order = order; | ||
290 | __entry->gfp_flags = gfp_flags; | ||
291 | __entry->migratetype = migratetype; | ||
292 | ), | ||
293 | |||
294 | TP_printk("page=%p pfn=%lu order=%d migratetype=%d gfp_flags=%s", | ||
295 | __entry->page, | ||
296 | page_to_pfn(__entry->page), | ||
297 | __entry->order, | ||
298 | __entry->migratetype, | ||
299 | show_gfp_flags(__entry->gfp_flags)) | ||
300 | ); | ||
301 | |||
302 | TRACE_EVENT(mm_page_alloc_zone_locked, | ||
303 | |||
304 | TP_PROTO(struct page *page, unsigned int order, int migratetype), | ||
305 | |||
306 | TP_ARGS(page, order, migratetype), | ||
307 | |||
308 | TP_STRUCT__entry( | ||
309 | __field( struct page *, page ) | ||
310 | __field( unsigned int, order ) | ||
311 | __field( int, migratetype ) | ||
312 | ), | ||
313 | |||
314 | TP_fast_assign( | ||
315 | __entry->page = page; | ||
316 | __entry->order = order; | ||
317 | __entry->migratetype = migratetype; | ||
318 | ), | ||
319 | |||
320 | TP_printk("page=%p pfn=%lu order=%u migratetype=%d percpu_refill=%d", | ||
321 | __entry->page, | ||
322 | page_to_pfn(__entry->page), | ||
323 | __entry->order, | ||
324 | __entry->migratetype, | ||
325 | __entry->order == 0) | ||
326 | ); | ||
327 | |||
328 | TRACE_EVENT(mm_page_pcpu_drain, | ||
329 | |||
330 | TP_PROTO(struct page *page, int order, int migratetype), | ||
331 | |||
332 | TP_ARGS(page, order, migratetype), | ||
333 | |||
334 | TP_STRUCT__entry( | ||
335 | __field( struct page *, page ) | ||
336 | __field( int, order ) | ||
337 | __field( int, migratetype ) | ||
338 | ), | ||
339 | |||
340 | TP_fast_assign( | ||
341 | __entry->page = page; | ||
342 | __entry->order = order; | ||
343 | __entry->migratetype = migratetype; | ||
344 | ), | ||
345 | |||
346 | TP_printk("page=%p pfn=%lu order=%d migratetype=%d", | ||
347 | __entry->page, | ||
348 | page_to_pfn(__entry->page), | ||
349 | __entry->order, | ||
350 | __entry->migratetype) | ||
351 | ); | ||
352 | |||
353 | TRACE_EVENT(mm_page_alloc_extfrag, | ||
354 | |||
355 | TP_PROTO(struct page *page, | ||
356 | int alloc_order, int fallback_order, | ||
357 | int alloc_migratetype, int fallback_migratetype), | ||
358 | |||
359 | TP_ARGS(page, | ||
360 | alloc_order, fallback_order, | ||
361 | alloc_migratetype, fallback_migratetype), | ||
362 | |||
363 | TP_STRUCT__entry( | ||
364 | __field( struct page *, page ) | ||
365 | __field( int, alloc_order ) | ||
366 | __field( int, fallback_order ) | ||
367 | __field( int, alloc_migratetype ) | ||
368 | __field( int, fallback_migratetype ) | ||
369 | ), | ||
370 | |||
371 | TP_fast_assign( | ||
372 | __entry->page = page; | ||
373 | __entry->alloc_order = alloc_order; | ||
374 | __entry->fallback_order = fallback_order; | ||
375 | __entry->alloc_migratetype = alloc_migratetype; | ||
376 | __entry->fallback_migratetype = fallback_migratetype; | ||
377 | ), | ||
378 | |||
379 | TP_printk("page=%p pfn=%lu alloc_order=%d fallback_order=%d pageblock_order=%d alloc_migratetype=%d fallback_migratetype=%d fragmenting=%d change_ownership=%d", | ||
380 | __entry->page, | ||
381 | page_to_pfn(__entry->page), | ||
382 | __entry->alloc_order, | ||
383 | __entry->fallback_order, | ||
384 | pageblock_order, | ||
385 | __entry->alloc_migratetype, | ||
386 | __entry->fallback_migratetype, | ||
387 | __entry->fallback_order < pageblock_order, | ||
388 | __entry->alloc_migratetype == __entry->fallback_migratetype) | ||
389 | ); | ||
390 | |||
228 | #endif /* _TRACE_KMEM_H */ | 391 | #endif /* _TRACE_KMEM_H */ |
229 | 392 | ||
230 | /* This part must be outside protection */ | 393 | /* This part must be outside protection */ |
diff --git a/include/trace/events/power.h b/include/trace/events/power.h new file mode 100644 index 000000000000..ea6d579261ad --- /dev/null +++ b/include/trace/events/power.h | |||
@@ -0,0 +1,81 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM power | ||
3 | |||
4 | #if !defined(_TRACE_POWER_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_POWER_H | ||
6 | |||
7 | #include <linux/ktime.h> | ||
8 | #include <linux/tracepoint.h> | ||
9 | |||
10 | #ifndef _TRACE_POWER_ENUM_ | ||
11 | #define _TRACE_POWER_ENUM_ | ||
12 | enum { | ||
13 | POWER_NONE = 0, | ||
14 | POWER_CSTATE = 1, | ||
15 | POWER_PSTATE = 2, | ||
16 | }; | ||
17 | #endif | ||
18 | |||
19 | |||
20 | |||
21 | TRACE_EVENT(power_start, | ||
22 | |||
23 | TP_PROTO(unsigned int type, unsigned int state), | ||
24 | |||
25 | TP_ARGS(type, state), | ||
26 | |||
27 | TP_STRUCT__entry( | ||
28 | __field( u64, type ) | ||
29 | __field( u64, state ) | ||
30 | ), | ||
31 | |||
32 | TP_fast_assign( | ||
33 | __entry->type = type; | ||
34 | __entry->state = state; | ||
35 | ), | ||
36 | |||
37 | TP_printk("type=%lu state=%lu", (unsigned long)__entry->type, (unsigned long)__entry->state) | ||
38 | ); | ||
39 | |||
40 | TRACE_EVENT(power_end, | ||
41 | |||
42 | TP_PROTO(int dummy), | ||
43 | |||
44 | TP_ARGS(dummy), | ||
45 | |||
46 | TP_STRUCT__entry( | ||
47 | __field( u64, dummy ) | ||
48 | ), | ||
49 | |||
50 | TP_fast_assign( | ||
51 | __entry->dummy = 0xffff; | ||
52 | ), | ||
53 | |||
54 | TP_printk("dummy=%lu", (unsigned long)__entry->dummy) | ||
55 | |||
56 | ); | ||
57 | |||
58 | |||
59 | TRACE_EVENT(power_frequency, | ||
60 | |||
61 | TP_PROTO(unsigned int type, unsigned int state), | ||
62 | |||
63 | TP_ARGS(type, state), | ||
64 | |||
65 | TP_STRUCT__entry( | ||
66 | __field( u64, type ) | ||
67 | __field( u64, state ) | ||
68 | ), | ||
69 | |||
70 | TP_fast_assign( | ||
71 | __entry->type = type; | ||
72 | __entry->state = state; | ||
73 | ), | ||
74 | |||
75 | TP_printk("type=%lu state=%lu", (unsigned long)__entry->type, (unsigned long) __entry->state) | ||
76 | ); | ||
77 | |||
78 | #endif /* _TRACE_POWER_H */ | ||
79 | |||
80 | /* This part must be outside protection */ | ||
81 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index b48f1ad7c946..4069c43f4187 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h | |||
@@ -380,6 +380,39 @@ TRACE_EVENT(sched_stat_wait, | |||
380 | ); | 380 | ); |
381 | 381 | ||
382 | /* | 382 | /* |
383 | * Tracepoint for accounting runtime (time the task is executing | ||
384 | * on a CPU). | ||
385 | */ | ||
386 | TRACE_EVENT(sched_stat_runtime, | ||
387 | |||
388 | TP_PROTO(struct task_struct *tsk, u64 runtime, u64 vruntime), | ||
389 | |||
390 | TP_ARGS(tsk, runtime, vruntime), | ||
391 | |||
392 | TP_STRUCT__entry( | ||
393 | __array( char, comm, TASK_COMM_LEN ) | ||
394 | __field( pid_t, pid ) | ||
395 | __field( u64, runtime ) | ||
396 | __field( u64, vruntime ) | ||
397 | ), | ||
398 | |||
399 | TP_fast_assign( | ||
400 | memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); | ||
401 | __entry->pid = tsk->pid; | ||
402 | __entry->runtime = runtime; | ||
403 | __entry->vruntime = vruntime; | ||
404 | ) | ||
405 | TP_perf_assign( | ||
406 | __perf_count(runtime); | ||
407 | ), | ||
408 | |||
409 | TP_printk("task: %s:%d runtime: %Lu [ns], vruntime: %Lu [ns]", | ||
410 | __entry->comm, __entry->pid, | ||
411 | (unsigned long long)__entry->runtime, | ||
412 | (unsigned long long)__entry->vruntime) | ||
413 | ); | ||
414 | |||
415 | /* | ||
383 | * Tracepoint for accounting sleep time (time the task is not runnable, | 416 | * Tracepoint for accounting sleep time (time the task is not runnable, |
384 | * including iowait, see below). | 417 | * including iowait, see below). |
385 | */ | 418 | */ |
diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h new file mode 100644 index 000000000000..1844c48d640e --- /dev/null +++ b/include/trace/events/timer.h | |||
@@ -0,0 +1,342 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM timer | ||
3 | |||
4 | #if !defined(_TRACE_TIMER_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_TIMER_H | ||
6 | |||
7 | #include <linux/tracepoint.h> | ||
8 | #include <linux/hrtimer.h> | ||
9 | #include <linux/timer.h> | ||
10 | |||
11 | /** | ||
12 | * timer_init - called when the timer is initialized | ||
13 | * @timer: pointer to struct timer_list | ||
14 | */ | ||
15 | TRACE_EVENT(timer_init, | ||
16 | |||
17 | TP_PROTO(struct timer_list *timer), | ||
18 | |||
19 | TP_ARGS(timer), | ||
20 | |||
21 | TP_STRUCT__entry( | ||
22 | __field( void *, timer ) | ||
23 | ), | ||
24 | |||
25 | TP_fast_assign( | ||
26 | __entry->timer = timer; | ||
27 | ), | ||
28 | |||
29 | TP_printk("timer %p", __entry->timer) | ||
30 | ); | ||
31 | |||
32 | /** | ||
33 | * timer_start - called when the timer is started | ||
34 | * @timer: pointer to struct timer_list | ||
35 | * @expires: the timers expiry time | ||
36 | */ | ||
37 | TRACE_EVENT(timer_start, | ||
38 | |||
39 | TP_PROTO(struct timer_list *timer, unsigned long expires), | ||
40 | |||
41 | TP_ARGS(timer, expires), | ||
42 | |||
43 | TP_STRUCT__entry( | ||
44 | __field( void *, timer ) | ||
45 | __field( void *, function ) | ||
46 | __field( unsigned long, expires ) | ||
47 | __field( unsigned long, now ) | ||
48 | ), | ||
49 | |||
50 | TP_fast_assign( | ||
51 | __entry->timer = timer; | ||
52 | __entry->function = timer->function; | ||
53 | __entry->expires = expires; | ||
54 | __entry->now = jiffies; | ||
55 | ), | ||
56 | |||
57 | TP_printk("timer %p: func %pf, expires %lu, timeout %ld", | ||
58 | __entry->timer, __entry->function, __entry->expires, | ||
59 | (long)__entry->expires - __entry->now) | ||
60 | ); | ||
61 | |||
62 | /** | ||
63 | * timer_expire_entry - called immediately before the timer callback | ||
64 | * @timer: pointer to struct timer_list | ||
65 | * | ||
66 | * Allows to determine the timer latency. | ||
67 | */ | ||
68 | TRACE_EVENT(timer_expire_entry, | ||
69 | |||
70 | TP_PROTO(struct timer_list *timer), | ||
71 | |||
72 | TP_ARGS(timer), | ||
73 | |||
74 | TP_STRUCT__entry( | ||
75 | __field( void *, timer ) | ||
76 | __field( unsigned long, now ) | ||
77 | ), | ||
78 | |||
79 | TP_fast_assign( | ||
80 | __entry->timer = timer; | ||
81 | __entry->now = jiffies; | ||
82 | ), | ||
83 | |||
84 | TP_printk("timer %p: now %lu", __entry->timer, __entry->now) | ||
85 | ); | ||
86 | |||
87 | /** | ||
88 | * timer_expire_exit - called immediately after the timer callback returns | ||
89 | * @timer: pointer to struct timer_list | ||
90 | * | ||
91 | * When used in combination with the timer_expire_entry tracepoint we can | ||
92 | * determine the runtime of the timer callback function. | ||
93 | * | ||
94 | * NOTE: Do NOT derefernce timer in TP_fast_assign. The pointer might | ||
95 | * be invalid. We solely track the pointer. | ||
96 | */ | ||
97 | TRACE_EVENT(timer_expire_exit, | ||
98 | |||
99 | TP_PROTO(struct timer_list *timer), | ||
100 | |||
101 | TP_ARGS(timer), | ||
102 | |||
103 | TP_STRUCT__entry( | ||
104 | __field(void *, timer ) | ||
105 | ), | ||
106 | |||
107 | TP_fast_assign( | ||
108 | __entry->timer = timer; | ||
109 | ), | ||
110 | |||
111 | TP_printk("timer %p", __entry->timer) | ||
112 | ); | ||
113 | |||
114 | /** | ||
115 | * timer_cancel - called when the timer is canceled | ||
116 | * @timer: pointer to struct timer_list | ||
117 | */ | ||
118 | TRACE_EVENT(timer_cancel, | ||
119 | |||
120 | TP_PROTO(struct timer_list *timer), | ||
121 | |||
122 | TP_ARGS(timer), | ||
123 | |||
124 | TP_STRUCT__entry( | ||
125 | __field( void *, timer ) | ||
126 | ), | ||
127 | |||
128 | TP_fast_assign( | ||
129 | __entry->timer = timer; | ||
130 | ), | ||
131 | |||
132 | TP_printk("timer %p", __entry->timer) | ||
133 | ); | ||
134 | |||
135 | /** | ||
136 | * hrtimer_init - called when the hrtimer is initialized | ||
137 | * @timer: pointer to struct hrtimer | ||
138 | * @clockid: the hrtimers clock | ||
139 | * @mode: the hrtimers mode | ||
140 | */ | ||
141 | TRACE_EVENT(hrtimer_init, | ||
142 | |||
143 | TP_PROTO(struct hrtimer *timer, clockid_t clockid, | ||
144 | enum hrtimer_mode mode), | ||
145 | |||
146 | TP_ARGS(timer, clockid, mode), | ||
147 | |||
148 | TP_STRUCT__entry( | ||
149 | __field( void *, timer ) | ||
150 | __field( clockid_t, clockid ) | ||
151 | __field( enum hrtimer_mode, mode ) | ||
152 | ), | ||
153 | |||
154 | TP_fast_assign( | ||
155 | __entry->timer = timer; | ||
156 | __entry->clockid = clockid; | ||
157 | __entry->mode = mode; | ||
158 | ), | ||
159 | |||
160 | TP_printk("hrtimer %p, clockid %s, mode %s", __entry->timer, | ||
161 | __entry->clockid == CLOCK_REALTIME ? | ||
162 | "CLOCK_REALTIME" : "CLOCK_MONOTONIC", | ||
163 | __entry->mode == HRTIMER_MODE_ABS ? | ||
164 | "HRTIMER_MODE_ABS" : "HRTIMER_MODE_REL") | ||
165 | ); | ||
166 | |||
167 | /** | ||
168 | * hrtimer_start - called when the hrtimer is started | ||
169 | * @timer: pointer to struct hrtimer | ||
170 | */ | ||
171 | TRACE_EVENT(hrtimer_start, | ||
172 | |||
173 | TP_PROTO(struct hrtimer *timer), | ||
174 | |||
175 | TP_ARGS(timer), | ||
176 | |||
177 | TP_STRUCT__entry( | ||
178 | __field( void *, timer ) | ||
179 | __field( void *, function ) | ||
180 | __field( s64, expires ) | ||
181 | __field( s64, softexpires ) | ||
182 | ), | ||
183 | |||
184 | TP_fast_assign( | ||
185 | __entry->timer = timer; | ||
186 | __entry->function = timer->function; | ||
187 | __entry->expires = hrtimer_get_expires(timer).tv64; | ||
188 | __entry->softexpires = hrtimer_get_softexpires(timer).tv64; | ||
189 | ), | ||
190 | |||
191 | TP_printk("hrtimer %p, func %pf, expires %llu, softexpires %llu", | ||
192 | __entry->timer, __entry->function, | ||
193 | (unsigned long long)ktime_to_ns((ktime_t) { | ||
194 | .tv64 = __entry->expires }), | ||
195 | (unsigned long long)ktime_to_ns((ktime_t) { | ||
196 | .tv64 = __entry->softexpires })) | ||
197 | ); | ||
198 | |||
199 | /** | ||
200 | * htimmer_expire_entry - called immediately before the hrtimer callback | ||
201 | * @timer: pointer to struct hrtimer | ||
202 | * @now: pointer to variable which contains current time of the | ||
203 | * timers base. | ||
204 | * | ||
205 | * Allows to determine the timer latency. | ||
206 | */ | ||
207 | TRACE_EVENT(hrtimer_expire_entry, | ||
208 | |||
209 | TP_PROTO(struct hrtimer *timer, ktime_t *now), | ||
210 | |||
211 | TP_ARGS(timer, now), | ||
212 | |||
213 | TP_STRUCT__entry( | ||
214 | __field( void *, timer ) | ||
215 | __field( s64, now ) | ||
216 | ), | ||
217 | |||
218 | TP_fast_assign( | ||
219 | __entry->timer = timer; | ||
220 | __entry->now = now->tv64; | ||
221 | ), | ||
222 | |||
223 | TP_printk("hrtimer %p, now %llu", __entry->timer, | ||
224 | (unsigned long long)ktime_to_ns((ktime_t) { | ||
225 | .tv64 = __entry->now })) | ||
226 | ); | ||
227 | |||
228 | /** | ||
229 | * hrtimer_expire_exit - called immediately after the hrtimer callback returns | ||
230 | * @timer: pointer to struct hrtimer | ||
231 | * | ||
232 | * When used in combination with the hrtimer_expire_entry tracepoint we can | ||
233 | * determine the runtime of the callback function. | ||
234 | */ | ||
235 | TRACE_EVENT(hrtimer_expire_exit, | ||
236 | |||
237 | TP_PROTO(struct hrtimer *timer), | ||
238 | |||
239 | TP_ARGS(timer), | ||
240 | |||
241 | TP_STRUCT__entry( | ||
242 | __field( void *, timer ) | ||
243 | ), | ||
244 | |||
245 | TP_fast_assign( | ||
246 | __entry->timer = timer; | ||
247 | ), | ||
248 | |||
249 | TP_printk("hrtimer %p", __entry->timer) | ||
250 | ); | ||
251 | |||
252 | /** | ||
253 | * hrtimer_cancel - called when the hrtimer is canceled | ||
254 | * @timer: pointer to struct hrtimer | ||
255 | */ | ||
256 | TRACE_EVENT(hrtimer_cancel, | ||
257 | |||
258 | TP_PROTO(struct hrtimer *timer), | ||
259 | |||
260 | TP_ARGS(timer), | ||
261 | |||
262 | TP_STRUCT__entry( | ||
263 | __field( void *, timer ) | ||
264 | ), | ||
265 | |||
266 | TP_fast_assign( | ||
267 | __entry->timer = timer; | ||
268 | ), | ||
269 | |||
270 | TP_printk("hrtimer %p", __entry->timer) | ||
271 | ); | ||
272 | |||
273 | /** | ||
274 | * itimer_state - called when itimer is started or canceled | ||
275 | * @which: name of the interval timer | ||
276 | * @value: the itimers value, itimer is canceled if value->it_value is | ||
277 | * zero, otherwise it is started | ||
278 | * @expires: the itimers expiry time | ||
279 | */ | ||
280 | TRACE_EVENT(itimer_state, | ||
281 | |||
282 | TP_PROTO(int which, const struct itimerval *const value, | ||
283 | cputime_t expires), | ||
284 | |||
285 | TP_ARGS(which, value, expires), | ||
286 | |||
287 | TP_STRUCT__entry( | ||
288 | __field( int, which ) | ||
289 | __field( cputime_t, expires ) | ||
290 | __field( long, value_sec ) | ||
291 | __field( long, value_usec ) | ||
292 | __field( long, interval_sec ) | ||
293 | __field( long, interval_usec ) | ||
294 | ), | ||
295 | |||
296 | TP_fast_assign( | ||
297 | __entry->which = which; | ||
298 | __entry->expires = expires; | ||
299 | __entry->value_sec = value->it_value.tv_sec; | ||
300 | __entry->value_usec = value->it_value.tv_usec; | ||
301 | __entry->interval_sec = value->it_interval.tv_sec; | ||
302 | __entry->interval_usec = value->it_interval.tv_usec; | ||
303 | ), | ||
304 | |||
305 | TP_printk("which %d, expires %lu, it_value %lu.%lu, it_interval %lu.%lu", | ||
306 | __entry->which, __entry->expires, | ||
307 | __entry->value_sec, __entry->value_usec, | ||
308 | __entry->interval_sec, __entry->interval_usec) | ||
309 | ); | ||
310 | |||
311 | /** | ||
312 | * itimer_expire - called when itimer expires | ||
313 | * @which: type of the interval timer | ||
314 | * @pid: pid of the process which owns the timer | ||
315 | * @now: current time, used to calculate the latency of itimer | ||
316 | */ | ||
317 | TRACE_EVENT(itimer_expire, | ||
318 | |||
319 | TP_PROTO(int which, struct pid *pid, cputime_t now), | ||
320 | |||
321 | TP_ARGS(which, pid, now), | ||
322 | |||
323 | TP_STRUCT__entry( | ||
324 | __field( int , which ) | ||
325 | __field( pid_t, pid ) | ||
326 | __field( cputime_t, now ) | ||
327 | ), | ||
328 | |||
329 | TP_fast_assign( | ||
330 | __entry->which = which; | ||
331 | __entry->now = now; | ||
332 | __entry->pid = pid_nr(pid); | ||
333 | ), | ||
334 | |||
335 | TP_printk("which %d, pid %d, now %lu", __entry->which, | ||
336 | (int) __entry->pid, __entry->now) | ||
337 | ); | ||
338 | |||
339 | #endif /* _TRACE_TIMER_H */ | ||
340 | |||
341 | /* This part must be outside protection */ | ||
342 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h index fcfd9a1e4b96..e4612dbd7ba6 100644 --- a/include/trace/events/workqueue.h +++ b/include/trace/events/workqueue.h | |||
@@ -26,7 +26,7 @@ TRACE_EVENT(workqueue_insertion, | |||
26 | __entry->func = work->func; | 26 | __entry->func = work->func; |
27 | ), | 27 | ), |
28 | 28 | ||
29 | TP_printk("thread=%s:%d func=%pF", __entry->thread_comm, | 29 | TP_printk("thread=%s:%d func=%pf", __entry->thread_comm, |
30 | __entry->thread_pid, __entry->func) | 30 | __entry->thread_pid, __entry->func) |
31 | ); | 31 | ); |
32 | 32 | ||
@@ -48,7 +48,7 @@ TRACE_EVENT(workqueue_execution, | |||
48 | __entry->func = work->func; | 48 | __entry->func = work->func; |
49 | ), | 49 | ), |
50 | 50 | ||
51 | TP_printk("thread=%s:%d func=%pF", __entry->thread_comm, | 51 | TP_printk("thread=%s:%d func=%pf", __entry->thread_comm, |
52 | __entry->thread_pid, __entry->func) | 52 | __entry->thread_pid, __entry->func) |
53 | ); | 53 | ); |
54 | 54 | ||
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 72a3b437b829..cc0d9667e182 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -378,24 +378,18 @@ static inline int ftrace_get_offsets_##call( \ | |||
378 | #ifdef CONFIG_EVENT_PROFILE | 378 | #ifdef CONFIG_EVENT_PROFILE |
379 | 379 | ||
380 | /* | 380 | /* |
381 | * Generate the functions needed for tracepoint perf_counter support. | 381 | * Generate the functions needed for tracepoint perf_event support. |
382 | * | 382 | * |
383 | * NOTE: The insertion profile callback (ftrace_profile_<call>) is defined later | 383 | * NOTE: The insertion profile callback (ftrace_profile_<call>) is defined later |
384 | * | 384 | * |
385 | * static int ftrace_profile_enable_<call>(struct ftrace_event_call *event_call) | 385 | * static int ftrace_profile_enable_<call>(void) |
386 | * { | 386 | * { |
387 | * int ret = 0; | 387 | * return register_trace_<call>(ftrace_profile_<call>); |
388 | * | ||
389 | * if (!atomic_inc_return(&event_call->profile_count)) | ||
390 | * ret = register_trace_<call>(ftrace_profile_<call>); | ||
391 | * | ||
392 | * return ret; | ||
393 | * } | 388 | * } |
394 | * | 389 | * |
395 | * static void ftrace_profile_disable_<call>(struct ftrace_event_call *event_call) | 390 | * static void ftrace_profile_disable_<call>(void) |
396 | * { | 391 | * { |
397 | * if (atomic_add_negative(-1, &event->call->profile_count)) | 392 | * unregister_trace_<call>(ftrace_profile_<call>); |
398 | * unregister_trace_<call>(ftrace_profile_<call>); | ||
399 | * } | 393 | * } |
400 | * | 394 | * |
401 | */ | 395 | */ |
@@ -405,20 +399,14 @@ static inline int ftrace_get_offsets_##call( \ | |||
405 | \ | 399 | \ |
406 | static void ftrace_profile_##call(proto); \ | 400 | static void ftrace_profile_##call(proto); \ |
407 | \ | 401 | \ |
408 | static int ftrace_profile_enable_##call(struct ftrace_event_call *event_call) \ | 402 | static int ftrace_profile_enable_##call(void) \ |
409 | { \ | 403 | { \ |
410 | int ret = 0; \ | 404 | return register_trace_##call(ftrace_profile_##call); \ |
411 | \ | ||
412 | if (!atomic_inc_return(&event_call->profile_count)) \ | ||
413 | ret = register_trace_##call(ftrace_profile_##call); \ | ||
414 | \ | ||
415 | return ret; \ | ||
416 | } \ | 405 | } \ |
417 | \ | 406 | \ |
418 | static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\ | 407 | static void ftrace_profile_disable_##call(void) \ |
419 | { \ | 408 | { \ |
420 | if (atomic_add_negative(-1, &event_call->profile_count)) \ | 409 | unregister_trace_##call(ftrace_profile_##call); \ |
421 | unregister_trace_##call(ftrace_profile_##call); \ | ||
422 | } | 410 | } |
423 | 411 | ||
424 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 412 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
@@ -656,15 +644,16 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
656 | * { | 644 | * { |
657 | * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets; | 645 | * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets; |
658 | * struct ftrace_event_call *event_call = &event_<call>; | 646 | * struct ftrace_event_call *event_call = &event_<call>; |
659 | * extern void perf_tpcounter_event(int, u64, u64, void *, int); | 647 | * extern void perf_tp_event(int, u64, u64, void *, int); |
660 | * struct ftrace_raw_##call *entry; | 648 | * struct ftrace_raw_##call *entry; |
661 | * u64 __addr = 0, __count = 1; | 649 | * u64 __addr = 0, __count = 1; |
662 | * unsigned long irq_flags; | 650 | * unsigned long irq_flags; |
651 | * struct trace_entry *ent; | ||
663 | * int __entry_size; | 652 | * int __entry_size; |
664 | * int __data_size; | 653 | * int __data_size; |
654 | * int __cpu | ||
665 | * int pc; | 655 | * int pc; |
666 | * | 656 | * |
667 | * local_save_flags(irq_flags); | ||
668 | * pc = preempt_count(); | 657 | * pc = preempt_count(); |
669 | * | 658 | * |
670 | * __data_size = ftrace_get_offsets_<call>(&__data_offsets, args); | 659 | * __data_size = ftrace_get_offsets_<call>(&__data_offsets, args); |
@@ -675,25 +664,34 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
675 | * sizeof(u64)); | 664 | * sizeof(u64)); |
676 | * __entry_size -= sizeof(u32); | 665 | * __entry_size -= sizeof(u32); |
677 | * | 666 | * |
678 | * do { | 667 | * // Protect the non nmi buffer |
679 | * char raw_data[__entry_size]; <- allocate our sample in the stack | 668 | * // This also protects the rcu read side |
680 | * struct trace_entry *ent; | 669 | * local_irq_save(irq_flags); |
670 | * __cpu = smp_processor_id(); | ||
671 | * | ||
672 | * if (in_nmi()) | ||
673 | * raw_data = rcu_dereference(trace_profile_buf_nmi); | ||
674 | * else | ||
675 | * raw_data = rcu_dereference(trace_profile_buf); | ||
676 | * | ||
677 | * if (!raw_data) | ||
678 | * goto end; | ||
681 | * | 679 | * |
682 | * zero dead bytes from alignment to avoid stack leak to userspace: | 680 | * raw_data = per_cpu_ptr(raw_data, __cpu); |
683 | * | 681 | * |
684 | * *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL; | 682 | * //zero dead bytes from alignment to avoid stack leak to userspace: |
685 | * entry = (struct ftrace_raw_<call> *)raw_data; | 683 | * *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL; |
686 | * ent = &entry->ent; | 684 | * entry = (struct ftrace_raw_<call> *)raw_data; |
687 | * tracing_generic_entry_update(ent, irq_flags, pc); | 685 | * ent = &entry->ent; |
688 | * ent->type = event_call->id; | 686 | * tracing_generic_entry_update(ent, irq_flags, pc); |
687 | * ent->type = event_call->id; | ||
689 | * | 688 | * |
690 | * <tstruct> <- do some jobs with dynamic arrays | 689 | * <tstruct> <- do some jobs with dynamic arrays |
691 | * | 690 | * |
692 | * <assign> <- affect our values | 691 | * <assign> <- affect our values |
693 | * | 692 | * |
694 | * perf_tpcounter_event(event_call->id, __addr, __count, entry, | 693 | * perf_tp_event(event_call->id, __addr, __count, entry, |
695 | * __entry_size); <- submit them to perf counter | 694 | * __entry_size); <- submit them to perf counter |
696 | * } while (0); | ||
697 | * | 695 | * |
698 | * } | 696 | * } |
699 | */ | 697 | */ |
@@ -712,15 +710,17 @@ static void ftrace_profile_##call(proto) \ | |||
712 | { \ | 710 | { \ |
713 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ | 711 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ |
714 | struct ftrace_event_call *event_call = &event_##call; \ | 712 | struct ftrace_event_call *event_call = &event_##call; \ |
715 | extern void perf_tpcounter_event(int, u64, u64, void *, int); \ | 713 | extern void perf_tp_event(int, u64, u64, void *, int); \ |
716 | struct ftrace_raw_##call *entry; \ | 714 | struct ftrace_raw_##call *entry; \ |
717 | u64 __addr = 0, __count = 1; \ | 715 | u64 __addr = 0, __count = 1; \ |
718 | unsigned long irq_flags; \ | 716 | unsigned long irq_flags; \ |
717 | struct trace_entry *ent; \ | ||
719 | int __entry_size; \ | 718 | int __entry_size; \ |
720 | int __data_size; \ | 719 | int __data_size; \ |
720 | char *raw_data; \ | ||
721 | int __cpu; \ | ||
721 | int pc; \ | 722 | int pc; \ |
722 | \ | 723 | \ |
723 | local_save_flags(irq_flags); \ | ||
724 | pc = preempt_count(); \ | 724 | pc = preempt_count(); \ |
725 | \ | 725 | \ |
726 | __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ | 726 | __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ |
@@ -728,23 +728,38 @@ static void ftrace_profile_##call(proto) \ | |||
728 | sizeof(u64)); \ | 728 | sizeof(u64)); \ |
729 | __entry_size -= sizeof(u32); \ | 729 | __entry_size -= sizeof(u32); \ |
730 | \ | 730 | \ |
731 | do { \ | 731 | if (WARN_ONCE(__entry_size > FTRACE_MAX_PROFILE_SIZE, \ |
732 | char raw_data[__entry_size]; \ | 732 | "profile buffer not large enough")) \ |
733 | struct trace_entry *ent; \ | 733 | return; \ |
734 | \ | ||
735 | local_irq_save(irq_flags); \ | ||
736 | __cpu = smp_processor_id(); \ | ||
734 | \ | 737 | \ |
735 | *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL; \ | 738 | if (in_nmi()) \ |
736 | entry = (struct ftrace_raw_##call *)raw_data; \ | 739 | raw_data = rcu_dereference(trace_profile_buf_nmi); \ |
737 | ent = &entry->ent; \ | 740 | else \ |
738 | tracing_generic_entry_update(ent, irq_flags, pc); \ | 741 | raw_data = rcu_dereference(trace_profile_buf); \ |
739 | ent->type = event_call->id; \ | ||
740 | \ | 742 | \ |
741 | tstruct \ | 743 | if (!raw_data) \ |
744 | goto end; \ | ||
742 | \ | 745 | \ |
743 | { assign; } \ | 746 | raw_data = per_cpu_ptr(raw_data, __cpu); \ |
744 | \ | 747 | \ |
745 | perf_tpcounter_event(event_call->id, __addr, __count, entry,\ | 748 | *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL; \ |
749 | entry = (struct ftrace_raw_##call *)raw_data; \ | ||
750 | ent = &entry->ent; \ | ||
751 | tracing_generic_entry_update(ent, irq_flags, pc); \ | ||
752 | ent->type = event_call->id; \ | ||
753 | \ | ||
754 | tstruct \ | ||
755 | \ | ||
756 | { assign; } \ | ||
757 | \ | ||
758 | perf_tp_event(event_call->id, __addr, __count, entry, \ | ||
746 | __entry_size); \ | 759 | __entry_size); \ |
747 | } while (0); \ | 760 | \ |
761 | end: \ | ||
762 | local_irq_restore(irq_flags); \ | ||
748 | \ | 763 | \ |
749 | } | 764 | } |
750 | 765 | ||