diff options
author | Len Brown <len.brown@intel.com> | 2010-08-15 01:06:31 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2010-08-15 01:06:31 -0400 |
commit | 95ee46aa8698f2000647dfb362400fadbb5807cf (patch) | |
tree | e5a05c7297f997e191c73091934e42e3195c0e40 /include/trace | |
parent | cfa806f059801dbe7e435745eb2e187c8bfe1e7f (diff) | |
parent | 92fa5bd9a946b6e7aab6764e7312e4e3d9bed295 (diff) |
Merge branch 'linus' into release
Conflicts:
drivers/acpi/debug.c
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/boot.h | 60 | ||||
-rw-r--r-- | include/trace/events/block.h | 15 | ||||
-rw-r--r-- | include/trace/events/ext4.h | 20 | ||||
-rw-r--r-- | include/trace/events/gfpflags.h | 37 | ||||
-rw-r--r-- | include/trace/events/kmem.h | 38 | ||||
-rw-r--r-- | include/trace/events/power.h | 27 | ||||
-rw-r--r-- | include/trace/events/sched.h | 32 | ||||
-rw-r--r-- | include/trace/events/timer.h | 80 | ||||
-rw-r--r-- | include/trace/events/vmscan.h | 275 | ||||
-rw-r--r-- | include/trace/events/workqueue.h | 92 | ||||
-rw-r--r-- | include/trace/events/writeback.h | 159 | ||||
-rw-r--r-- | include/trace/ftrace.h | 23 | ||||
-rw-r--r-- | include/trace/syscall.h | 1 |
13 files changed, 556 insertions, 303 deletions
diff --git a/include/trace/boot.h b/include/trace/boot.h deleted file mode 100644 index 088ea089e31d..000000000000 --- a/include/trace/boot.h +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | #ifndef _LINUX_TRACE_BOOT_H | ||
2 | #define _LINUX_TRACE_BOOT_H | ||
3 | |||
4 | #include <linux/module.h> | ||
5 | #include <linux/kallsyms.h> | ||
6 | #include <linux/init.h> | ||
7 | |||
8 | /* | ||
9 | * Structure which defines the trace of an initcall | ||
10 | * while it is called. | ||
11 | * You don't have to fill the func field since it is | ||
12 | * only used internally by the tracer. | ||
13 | */ | ||
14 | struct boot_trace_call { | ||
15 | pid_t caller; | ||
16 | char func[KSYM_SYMBOL_LEN]; | ||
17 | }; | ||
18 | |||
19 | /* | ||
20 | * Structure which defines the trace of an initcall | ||
21 | * while it returns. | ||
22 | */ | ||
23 | struct boot_trace_ret { | ||
24 | char func[KSYM_SYMBOL_LEN]; | ||
25 | int result; | ||
26 | unsigned long long duration; /* nsecs */ | ||
27 | }; | ||
28 | |||
29 | #ifdef CONFIG_BOOT_TRACER | ||
30 | /* Append the traces on the ring-buffer */ | ||
31 | extern void trace_boot_call(struct boot_trace_call *bt, initcall_t fn); | ||
32 | extern void trace_boot_ret(struct boot_trace_ret *bt, initcall_t fn); | ||
33 | |||
34 | /* Tells the tracer that smp_pre_initcall is finished. | ||
35 | * So we can start the tracing | ||
36 | */ | ||
37 | extern void start_boot_trace(void); | ||
38 | |||
39 | /* Resume the tracing of other necessary events | ||
40 | * such as sched switches | ||
41 | */ | ||
42 | extern void enable_boot_trace(void); | ||
43 | |||
44 | /* Suspend this tracing. Actually, only sched_switches tracing have | ||
45 | * to be suspended. Initcalls doesn't need it.) | ||
46 | */ | ||
47 | extern void disable_boot_trace(void); | ||
48 | #else | ||
49 | static inline | ||
50 | void trace_boot_call(struct boot_trace_call *bt, initcall_t fn) { } | ||
51 | |||
52 | static inline | ||
53 | void trace_boot_ret(struct boot_trace_ret *bt, initcall_t fn) { } | ||
54 | |||
55 | static inline void start_boot_trace(void) { } | ||
56 | static inline void enable_boot_trace(void) { } | ||
57 | static inline void disable_boot_trace(void) { } | ||
58 | #endif /* CONFIG_BOOT_TRACER */ | ||
59 | |||
60 | #endif /* __LINUX_TRACE_BOOT_H */ | ||
diff --git a/include/trace/events/block.h b/include/trace/events/block.h index d870a918559c..d8ce278515c3 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h | |||
@@ -25,8 +25,10 @@ DECLARE_EVENT_CLASS(block_rq_with_error, | |||
25 | 25 | ||
26 | TP_fast_assign( | 26 | TP_fast_assign( |
27 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; | 27 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; |
28 | __entry->sector = blk_pc_request(rq) ? 0 : blk_rq_pos(rq); | 28 | __entry->sector = (rq->cmd_type == REQ_TYPE_BLOCK_PC) ? |
29 | __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq); | 29 | 0 : blk_rq_pos(rq); |
30 | __entry->nr_sector = (rq->cmd_type == REQ_TYPE_BLOCK_PC) ? | ||
31 | 0 : blk_rq_sectors(rq); | ||
30 | __entry->errors = rq->errors; | 32 | __entry->errors = rq->errors; |
31 | 33 | ||
32 | blk_fill_rwbs_rq(__entry->rwbs, rq); | 34 | blk_fill_rwbs_rq(__entry->rwbs, rq); |
@@ -109,9 +111,12 @@ DECLARE_EVENT_CLASS(block_rq, | |||
109 | 111 | ||
110 | TP_fast_assign( | 112 | TP_fast_assign( |
111 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; | 113 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; |
112 | __entry->sector = blk_pc_request(rq) ? 0 : blk_rq_pos(rq); | 114 | __entry->sector = (rq->cmd_type == REQ_TYPE_BLOCK_PC) ? |
113 | __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq); | 115 | 0 : blk_rq_pos(rq); |
114 | __entry->bytes = blk_pc_request(rq) ? blk_rq_bytes(rq) : 0; | 116 | __entry->nr_sector = (rq->cmd_type == REQ_TYPE_BLOCK_PC) ? |
117 | 0 : blk_rq_sectors(rq); | ||
118 | __entry->bytes = (rq->cmd_type == REQ_TYPE_BLOCK_PC) ? | ||
119 | blk_rq_bytes(rq) : 0; | ||
115 | 120 | ||
116 | blk_fill_rwbs_rq(__entry->rwbs, rq); | 121 | blk_fill_rwbs_rq(__entry->rwbs, rq); |
117 | blk_dump_cmd(__get_str(cmd), rq); | 122 | blk_dump_cmd(__get_str(cmd), rq); |
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h index f3865c7b4166..01e9e0076a92 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h | |||
@@ -395,11 +395,12 @@ DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_group_pa, | |||
395 | ); | 395 | ); |
396 | 396 | ||
397 | TRACE_EVENT(ext4_mb_release_inode_pa, | 397 | TRACE_EVENT(ext4_mb_release_inode_pa, |
398 | TP_PROTO(struct ext4_allocation_context *ac, | 398 | TP_PROTO(struct super_block *sb, |
399 | struct ext4_allocation_context *ac, | ||
399 | struct ext4_prealloc_space *pa, | 400 | struct ext4_prealloc_space *pa, |
400 | unsigned long long block, unsigned int count), | 401 | unsigned long long block, unsigned int count), |
401 | 402 | ||
402 | TP_ARGS(ac, pa, block, count), | 403 | TP_ARGS(sb, ac, pa, block, count), |
403 | 404 | ||
404 | TP_STRUCT__entry( | 405 | TP_STRUCT__entry( |
405 | __field( dev_t, dev ) | 406 | __field( dev_t, dev ) |
@@ -410,8 +411,9 @@ TRACE_EVENT(ext4_mb_release_inode_pa, | |||
410 | ), | 411 | ), |
411 | 412 | ||
412 | TP_fast_assign( | 413 | TP_fast_assign( |
413 | __entry->dev = ac->ac_sb->s_dev; | 414 | __entry->dev = sb->s_dev; |
414 | __entry->ino = ac->ac_inode->i_ino; | 415 | __entry->ino = (ac && ac->ac_inode) ? |
416 | ac->ac_inode->i_ino : 0; | ||
415 | __entry->block = block; | 417 | __entry->block = block; |
416 | __entry->count = count; | 418 | __entry->count = count; |
417 | ), | 419 | ), |
@@ -422,10 +424,11 @@ TRACE_EVENT(ext4_mb_release_inode_pa, | |||
422 | ); | 424 | ); |
423 | 425 | ||
424 | TRACE_EVENT(ext4_mb_release_group_pa, | 426 | TRACE_EVENT(ext4_mb_release_group_pa, |
425 | TP_PROTO(struct ext4_allocation_context *ac, | 427 | TP_PROTO(struct super_block *sb, |
428 | struct ext4_allocation_context *ac, | ||
426 | struct ext4_prealloc_space *pa), | 429 | struct ext4_prealloc_space *pa), |
427 | 430 | ||
428 | TP_ARGS(ac, pa), | 431 | TP_ARGS(sb, ac, pa), |
429 | 432 | ||
430 | TP_STRUCT__entry( | 433 | TP_STRUCT__entry( |
431 | __field( dev_t, dev ) | 434 | __field( dev_t, dev ) |
@@ -436,8 +439,9 @@ TRACE_EVENT(ext4_mb_release_group_pa, | |||
436 | ), | 439 | ), |
437 | 440 | ||
438 | TP_fast_assign( | 441 | TP_fast_assign( |
439 | __entry->dev = ac->ac_sb->s_dev; | 442 | __entry->dev = sb->s_dev; |
440 | __entry->ino = ac->ac_inode->i_ino; | 443 | __entry->ino = (ac && ac->ac_inode) ? |
444 | ac->ac_inode->i_ino : 0; | ||
441 | __entry->pa_pstart = pa->pa_pstart; | 445 | __entry->pa_pstart = pa->pa_pstart; |
442 | __entry->pa_len = pa->pa_len; | 446 | __entry->pa_len = pa->pa_len; |
443 | ), | 447 | ), |
diff --git a/include/trace/events/gfpflags.h b/include/trace/events/gfpflags.h new file mode 100644 index 000000000000..e3615c093741 --- /dev/null +++ b/include/trace/events/gfpflags.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * The order of these masks is important. Matching masks will be seen | ||
3 | * first and the left over flags will end up showing by themselves. | ||
4 | * | ||
5 | * For example, if we have GFP_KERNEL before GFP_USER we wil get: | ||
6 | * | ||
7 | * GFP_KERNEL|GFP_HARDWALL | ||
8 | * | ||
9 | * Thus most bits set go first. | ||
10 | */ | ||
11 | #define show_gfp_flags(flags) \ | ||
12 | (flags) ? __print_flags(flags, "|", \ | ||
13 | {(unsigned long)GFP_HIGHUSER_MOVABLE, "GFP_HIGHUSER_MOVABLE"}, \ | ||
14 | {(unsigned long)GFP_HIGHUSER, "GFP_HIGHUSER"}, \ | ||
15 | {(unsigned long)GFP_USER, "GFP_USER"}, \ | ||
16 | {(unsigned long)GFP_TEMPORARY, "GFP_TEMPORARY"}, \ | ||
17 | {(unsigned long)GFP_KERNEL, "GFP_KERNEL"}, \ | ||
18 | {(unsigned long)GFP_NOFS, "GFP_NOFS"}, \ | ||
19 | {(unsigned long)GFP_ATOMIC, "GFP_ATOMIC"}, \ | ||
20 | {(unsigned long)GFP_NOIO, "GFP_NOIO"}, \ | ||
21 | {(unsigned long)__GFP_HIGH, "GFP_HIGH"}, \ | ||
22 | {(unsigned long)__GFP_WAIT, "GFP_WAIT"}, \ | ||
23 | {(unsigned long)__GFP_IO, "GFP_IO"}, \ | ||
24 | {(unsigned long)__GFP_COLD, "GFP_COLD"}, \ | ||
25 | {(unsigned long)__GFP_NOWARN, "GFP_NOWARN"}, \ | ||
26 | {(unsigned long)__GFP_REPEAT, "GFP_REPEAT"}, \ | ||
27 | {(unsigned long)__GFP_NOFAIL, "GFP_NOFAIL"}, \ | ||
28 | {(unsigned long)__GFP_NORETRY, "GFP_NORETRY"}, \ | ||
29 | {(unsigned long)__GFP_COMP, "GFP_COMP"}, \ | ||
30 | {(unsigned long)__GFP_ZERO, "GFP_ZERO"}, \ | ||
31 | {(unsigned long)__GFP_NOMEMALLOC, "GFP_NOMEMALLOC"}, \ | ||
32 | {(unsigned long)__GFP_HARDWALL, "GFP_HARDWALL"}, \ | ||
33 | {(unsigned long)__GFP_THISNODE, "GFP_THISNODE"}, \ | ||
34 | {(unsigned long)__GFP_RECLAIMABLE, "GFP_RECLAIMABLE"}, \ | ||
35 | {(unsigned long)__GFP_MOVABLE, "GFP_MOVABLE"} \ | ||
36 | ) : "GFP_NOWAIT" | ||
37 | |||
diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h index 3adca0ca9dbe..a9c87ad8331c 100644 --- a/include/trace/events/kmem.h +++ b/include/trace/events/kmem.h | |||
@@ -6,43 +6,7 @@ | |||
6 | 6 | ||
7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
8 | #include <linux/tracepoint.h> | 8 | #include <linux/tracepoint.h> |
9 | 9 | #include "gfpflags.h" | |
10 | /* | ||
11 | * The order of these masks is important. Matching masks will be seen | ||
12 | * first and the left over flags will end up showing by themselves. | ||
13 | * | ||
14 | * For example, if we have GFP_KERNEL before GFP_USER we wil get: | ||
15 | * | ||
16 | * GFP_KERNEL|GFP_HARDWALL | ||
17 | * | ||
18 | * Thus most bits set go first. | ||
19 | */ | ||
20 | #define show_gfp_flags(flags) \ | ||
21 | (flags) ? __print_flags(flags, "|", \ | ||
22 | {(unsigned long)GFP_HIGHUSER_MOVABLE, "GFP_HIGHUSER_MOVABLE"}, \ | ||
23 | {(unsigned long)GFP_HIGHUSER, "GFP_HIGHUSER"}, \ | ||
24 | {(unsigned long)GFP_USER, "GFP_USER"}, \ | ||
25 | {(unsigned long)GFP_TEMPORARY, "GFP_TEMPORARY"}, \ | ||
26 | {(unsigned long)GFP_KERNEL, "GFP_KERNEL"}, \ | ||
27 | {(unsigned long)GFP_NOFS, "GFP_NOFS"}, \ | ||
28 | {(unsigned long)GFP_ATOMIC, "GFP_ATOMIC"}, \ | ||
29 | {(unsigned long)GFP_NOIO, "GFP_NOIO"}, \ | ||
30 | {(unsigned long)__GFP_HIGH, "GFP_HIGH"}, \ | ||
31 | {(unsigned long)__GFP_WAIT, "GFP_WAIT"}, \ | ||
32 | {(unsigned long)__GFP_IO, "GFP_IO"}, \ | ||
33 | {(unsigned long)__GFP_COLD, "GFP_COLD"}, \ | ||
34 | {(unsigned long)__GFP_NOWARN, "GFP_NOWARN"}, \ | ||
35 | {(unsigned long)__GFP_REPEAT, "GFP_REPEAT"}, \ | ||
36 | {(unsigned long)__GFP_NOFAIL, "GFP_NOFAIL"}, \ | ||
37 | {(unsigned long)__GFP_NORETRY, "GFP_NORETRY"}, \ | ||
38 | {(unsigned long)__GFP_COMP, "GFP_COMP"}, \ | ||
39 | {(unsigned long)__GFP_ZERO, "GFP_ZERO"}, \ | ||
40 | {(unsigned long)__GFP_NOMEMALLOC, "GFP_NOMEMALLOC"}, \ | ||
41 | {(unsigned long)__GFP_HARDWALL, "GFP_HARDWALL"}, \ | ||
42 | {(unsigned long)__GFP_THISNODE, "GFP_THISNODE"}, \ | ||
43 | {(unsigned long)__GFP_RECLAIMABLE, "GFP_RECLAIMABLE"}, \ | ||
44 | {(unsigned long)__GFP_MOVABLE, "GFP_MOVABLE"} \ | ||
45 | ) : "GFP_NOWAIT" | ||
46 | 10 | ||
47 | DECLARE_EVENT_CLASS(kmem_alloc, | 11 | DECLARE_EVENT_CLASS(kmem_alloc, |
48 | 12 | ||
diff --git a/include/trace/events/power.h b/include/trace/events/power.h index c4efe9b8280d..35a2a6e7bf1e 100644 --- a/include/trace/events/power.h +++ b/include/trace/events/power.h | |||
@@ -18,52 +18,55 @@ enum { | |||
18 | 18 | ||
19 | DECLARE_EVENT_CLASS(power, | 19 | DECLARE_EVENT_CLASS(power, |
20 | 20 | ||
21 | TP_PROTO(unsigned int type, unsigned int state), | 21 | TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), |
22 | 22 | ||
23 | TP_ARGS(type, state), | 23 | TP_ARGS(type, state, cpu_id), |
24 | 24 | ||
25 | TP_STRUCT__entry( | 25 | TP_STRUCT__entry( |
26 | __field( u64, type ) | 26 | __field( u64, type ) |
27 | __field( u64, state ) | 27 | __field( u64, state ) |
28 | __field( u64, cpu_id ) | ||
28 | ), | 29 | ), |
29 | 30 | ||
30 | TP_fast_assign( | 31 | TP_fast_assign( |
31 | __entry->type = type; | 32 | __entry->type = type; |
32 | __entry->state = state; | 33 | __entry->state = state; |
34 | __entry->cpu_id = cpu_id; | ||
33 | ), | 35 | ), |
34 | 36 | ||
35 | TP_printk("type=%lu state=%lu", (unsigned long)__entry->type, (unsigned long)__entry->state) | 37 | TP_printk("type=%lu state=%lu cpu_id=%lu", (unsigned long)__entry->type, |
38 | (unsigned long)__entry->state, (unsigned long)__entry->cpu_id) | ||
36 | ); | 39 | ); |
37 | 40 | ||
38 | DEFINE_EVENT(power, power_start, | 41 | DEFINE_EVENT(power, power_start, |
39 | 42 | ||
40 | TP_PROTO(unsigned int type, unsigned int state), | 43 | TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), |
41 | 44 | ||
42 | TP_ARGS(type, state) | 45 | TP_ARGS(type, state, cpu_id) |
43 | ); | 46 | ); |
44 | 47 | ||
45 | DEFINE_EVENT(power, power_frequency, | 48 | DEFINE_EVENT(power, power_frequency, |
46 | 49 | ||
47 | TP_PROTO(unsigned int type, unsigned int state), | 50 | TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), |
48 | 51 | ||
49 | TP_ARGS(type, state) | 52 | TP_ARGS(type, state, cpu_id) |
50 | ); | 53 | ); |
51 | 54 | ||
52 | TRACE_EVENT(power_end, | 55 | TRACE_EVENT(power_end, |
53 | 56 | ||
54 | TP_PROTO(int dummy), | 57 | TP_PROTO(unsigned int cpu_id), |
55 | 58 | ||
56 | TP_ARGS(dummy), | 59 | TP_ARGS(cpu_id), |
57 | 60 | ||
58 | TP_STRUCT__entry( | 61 | TP_STRUCT__entry( |
59 | __field( u64, dummy ) | 62 | __field( u64, cpu_id ) |
60 | ), | 63 | ), |
61 | 64 | ||
62 | TP_fast_assign( | 65 | TP_fast_assign( |
63 | __entry->dummy = 0xffff; | 66 | __entry->cpu_id = cpu_id; |
64 | ), | 67 | ), |
65 | 68 | ||
66 | TP_printk("dummy=%lu", (unsigned long)__entry->dummy) | 69 | TP_printk("cpu_id=%lu", (unsigned long)__entry->cpu_id) |
67 | 70 | ||
68 | ); | 71 | ); |
69 | 72 | ||
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index b9e1dd6c6208..9208c92aeab5 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h | |||
@@ -50,31 +50,6 @@ TRACE_EVENT(sched_kthread_stop_ret, | |||
50 | ); | 50 | ); |
51 | 51 | ||
52 | /* | 52 | /* |
53 | * Tracepoint for waiting on task to unschedule: | ||
54 | */ | ||
55 | TRACE_EVENT(sched_wait_task, | ||
56 | |||
57 | TP_PROTO(struct task_struct *p), | ||
58 | |||
59 | TP_ARGS(p), | ||
60 | |||
61 | TP_STRUCT__entry( | ||
62 | __array( char, comm, TASK_COMM_LEN ) | ||
63 | __field( pid_t, pid ) | ||
64 | __field( int, prio ) | ||
65 | ), | ||
66 | |||
67 | TP_fast_assign( | ||
68 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); | ||
69 | __entry->pid = p->pid; | ||
70 | __entry->prio = p->prio; | ||
71 | ), | ||
72 | |||
73 | TP_printk("comm=%s pid=%d prio=%d", | ||
74 | __entry->comm, __entry->pid, __entry->prio) | ||
75 | ); | ||
76 | |||
77 | /* | ||
78 | * Tracepoint for waking up a task: | 53 | * Tracepoint for waking up a task: |
79 | */ | 54 | */ |
80 | DECLARE_EVENT_CLASS(sched_wakeup_template, | 55 | DECLARE_EVENT_CLASS(sched_wakeup_template, |
@@ -240,6 +215,13 @@ DEFINE_EVENT(sched_process_template, sched_process_exit, | |||
240 | TP_ARGS(p)); | 215 | TP_ARGS(p)); |
241 | 216 | ||
242 | /* | 217 | /* |
218 | * Tracepoint for waiting on task to unschedule: | ||
219 | */ | ||
220 | DEFINE_EVENT(sched_process_template, sched_wait_task, | ||
221 | TP_PROTO(struct task_struct *p), | ||
222 | TP_ARGS(p)); | ||
223 | |||
224 | /* | ||
243 | * Tracepoint for a waiting task: | 225 | * Tracepoint for a waiting task: |
244 | */ | 226 | */ |
245 | TRACE_EVENT(sched_process_wait, | 227 | TRACE_EVENT(sched_process_wait, |
diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h index 9496b965d62a..c624126a9c8a 100644 --- a/include/trace/events/timer.h +++ b/include/trace/events/timer.h | |||
@@ -8,11 +8,7 @@ | |||
8 | #include <linux/hrtimer.h> | 8 | #include <linux/hrtimer.h> |
9 | #include <linux/timer.h> | 9 | #include <linux/timer.h> |
10 | 10 | ||
11 | /** | 11 | DECLARE_EVENT_CLASS(timer_class, |
12 | * timer_init - called when the timer is initialized | ||
13 | * @timer: pointer to struct timer_list | ||
14 | */ | ||
15 | TRACE_EVENT(timer_init, | ||
16 | 12 | ||
17 | TP_PROTO(struct timer_list *timer), | 13 | TP_PROTO(struct timer_list *timer), |
18 | 14 | ||
@@ -30,6 +26,17 @@ TRACE_EVENT(timer_init, | |||
30 | ); | 26 | ); |
31 | 27 | ||
32 | /** | 28 | /** |
29 | * timer_init - called when the timer is initialized | ||
30 | * @timer: pointer to struct timer_list | ||
31 | */ | ||
32 | DEFINE_EVENT(timer_class, timer_init, | ||
33 | |||
34 | TP_PROTO(struct timer_list *timer), | ||
35 | |||
36 | TP_ARGS(timer) | ||
37 | ); | ||
38 | |||
39 | /** | ||
33 | * timer_start - called when the timer is started | 40 | * timer_start - called when the timer is started |
34 | * @timer: pointer to struct timer_list | 41 | * @timer: pointer to struct timer_list |
35 | * @expires: the timers expiry time | 42 | * @expires: the timers expiry time |
@@ -94,42 +101,22 @@ TRACE_EVENT(timer_expire_entry, | |||
94 | * NOTE: Do NOT derefernce timer in TP_fast_assign. The pointer might | 101 | * NOTE: Do NOT derefernce timer in TP_fast_assign. The pointer might |
95 | * be invalid. We solely track the pointer. | 102 | * be invalid. We solely track the pointer. |
96 | */ | 103 | */ |
97 | TRACE_EVENT(timer_expire_exit, | 104 | DEFINE_EVENT(timer_class, timer_expire_exit, |
98 | 105 | ||
99 | TP_PROTO(struct timer_list *timer), | 106 | TP_PROTO(struct timer_list *timer), |
100 | 107 | ||
101 | TP_ARGS(timer), | 108 | 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 | ); | 109 | ); |
113 | 110 | ||
114 | /** | 111 | /** |
115 | * timer_cancel - called when the timer is canceled | 112 | * timer_cancel - called when the timer is canceled |
116 | * @timer: pointer to struct timer_list | 113 | * @timer: pointer to struct timer_list |
117 | */ | 114 | */ |
118 | TRACE_EVENT(timer_cancel, | 115 | DEFINE_EVENT(timer_class, timer_cancel, |
119 | 116 | ||
120 | TP_PROTO(struct timer_list *timer), | 117 | TP_PROTO(struct timer_list *timer), |
121 | 118 | ||
122 | TP_ARGS(timer), | 119 | 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 | ); | 120 | ); |
134 | 121 | ||
135 | /** | 122 | /** |
@@ -224,14 +211,7 @@ TRACE_EVENT(hrtimer_expire_entry, | |||
224 | (unsigned long long)ktime_to_ns((ktime_t) { .tv64 = __entry->now })) | 211 | (unsigned long long)ktime_to_ns((ktime_t) { .tv64 = __entry->now })) |
225 | ); | 212 | ); |
226 | 213 | ||
227 | /** | 214 | DECLARE_EVENT_CLASS(hrtimer_class, |
228 | * hrtimer_expire_exit - called immediately after the hrtimer callback returns | ||
229 | * @timer: pointer to struct hrtimer | ||
230 | * | ||
231 | * When used in combination with the hrtimer_expire_entry tracepoint we can | ||
232 | * determine the runtime of the callback function. | ||
233 | */ | ||
234 | TRACE_EVENT(hrtimer_expire_exit, | ||
235 | 215 | ||
236 | TP_PROTO(struct hrtimer *hrtimer), | 216 | TP_PROTO(struct hrtimer *hrtimer), |
237 | 217 | ||
@@ -249,24 +229,28 @@ TRACE_EVENT(hrtimer_expire_exit, | |||
249 | ); | 229 | ); |
250 | 230 | ||
251 | /** | 231 | /** |
252 | * hrtimer_cancel - called when the hrtimer is canceled | 232 | * hrtimer_expire_exit - called immediately after the hrtimer callback returns |
253 | * @hrtimer: pointer to struct hrtimer | 233 | * @timer: pointer to struct hrtimer |
234 | * | ||
235 | * When used in combination with the hrtimer_expire_entry tracepoint we can | ||
236 | * determine the runtime of the callback function. | ||
254 | */ | 237 | */ |
255 | TRACE_EVENT(hrtimer_cancel, | 238 | DEFINE_EVENT(hrtimer_class, hrtimer_expire_exit, |
256 | 239 | ||
257 | TP_PROTO(struct hrtimer *hrtimer), | 240 | TP_PROTO(struct hrtimer *hrtimer), |
258 | 241 | ||
259 | TP_ARGS(hrtimer), | 242 | TP_ARGS(hrtimer) |
243 | ); | ||
260 | 244 | ||
261 | TP_STRUCT__entry( | 245 | /** |
262 | __field( void *, hrtimer ) | 246 | * hrtimer_cancel - called when the hrtimer is canceled |
263 | ), | 247 | * @hrtimer: pointer to struct hrtimer |
248 | */ | ||
249 | DEFINE_EVENT(hrtimer_class, hrtimer_cancel, | ||
264 | 250 | ||
265 | TP_fast_assign( | 251 | TP_PROTO(struct hrtimer *hrtimer), |
266 | __entry->hrtimer = hrtimer; | ||
267 | ), | ||
268 | 252 | ||
269 | TP_printk("hrtimer=%p", __entry->hrtimer) | 253 | TP_ARGS(hrtimer) |
270 | ); | 254 | ); |
271 | 255 | ||
272 | /** | 256 | /** |
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h new file mode 100644 index 000000000000..370aa5a87322 --- /dev/null +++ b/include/trace/events/vmscan.h | |||
@@ -0,0 +1,275 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM vmscan | ||
3 | |||
4 | #if !defined(_TRACE_VMSCAN_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_VMSCAN_H | ||
6 | |||
7 | #include <linux/types.h> | ||
8 | #include <linux/tracepoint.h> | ||
9 | #include "gfpflags.h" | ||
10 | |||
11 | #define RECLAIM_WB_ANON 0x0001u | ||
12 | #define RECLAIM_WB_FILE 0x0002u | ||
13 | #define RECLAIM_WB_SYNC 0x0004u | ||
14 | #define RECLAIM_WB_ASYNC 0x0008u | ||
15 | |||
16 | #define show_reclaim_flags(flags) \ | ||
17 | (flags) ? __print_flags(flags, "|", \ | ||
18 | {RECLAIM_WB_ANON, "RECLAIM_WB_ANON"}, \ | ||
19 | {RECLAIM_WB_FILE, "RECLAIM_WB_FILE"}, \ | ||
20 | {RECLAIM_WB_SYNC, "RECLAIM_WB_SYNC"}, \ | ||
21 | {RECLAIM_WB_ASYNC, "RECLAIM_WB_ASYNC"} \ | ||
22 | ) : "RECLAIM_WB_NONE" | ||
23 | |||
24 | #define trace_reclaim_flags(page, sync) ( \ | ||
25 | (page_is_file_cache(page) ? RECLAIM_WB_FILE : RECLAIM_WB_ANON) | \ | ||
26 | (sync == PAGEOUT_IO_SYNC ? RECLAIM_WB_SYNC : RECLAIM_WB_ASYNC) \ | ||
27 | ) | ||
28 | |||
29 | TRACE_EVENT(mm_vmscan_kswapd_sleep, | ||
30 | |||
31 | TP_PROTO(int nid), | ||
32 | |||
33 | TP_ARGS(nid), | ||
34 | |||
35 | TP_STRUCT__entry( | ||
36 | __field( int, nid ) | ||
37 | ), | ||
38 | |||
39 | TP_fast_assign( | ||
40 | __entry->nid = nid; | ||
41 | ), | ||
42 | |||
43 | TP_printk("nid=%d", __entry->nid) | ||
44 | ); | ||
45 | |||
46 | TRACE_EVENT(mm_vmscan_kswapd_wake, | ||
47 | |||
48 | TP_PROTO(int nid, int order), | ||
49 | |||
50 | TP_ARGS(nid, order), | ||
51 | |||
52 | TP_STRUCT__entry( | ||
53 | __field( int, nid ) | ||
54 | __field( int, order ) | ||
55 | ), | ||
56 | |||
57 | TP_fast_assign( | ||
58 | __entry->nid = nid; | ||
59 | __entry->order = order; | ||
60 | ), | ||
61 | |||
62 | TP_printk("nid=%d order=%d", __entry->nid, __entry->order) | ||
63 | ); | ||
64 | |||
65 | TRACE_EVENT(mm_vmscan_wakeup_kswapd, | ||
66 | |||
67 | TP_PROTO(int nid, int zid, int order), | ||
68 | |||
69 | TP_ARGS(nid, zid, order), | ||
70 | |||
71 | TP_STRUCT__entry( | ||
72 | __field( int, nid ) | ||
73 | __field( int, zid ) | ||
74 | __field( int, order ) | ||
75 | ), | ||
76 | |||
77 | TP_fast_assign( | ||
78 | __entry->nid = nid; | ||
79 | __entry->zid = zid; | ||
80 | __entry->order = order; | ||
81 | ), | ||
82 | |||
83 | TP_printk("nid=%d zid=%d order=%d", | ||
84 | __entry->nid, | ||
85 | __entry->zid, | ||
86 | __entry->order) | ||
87 | ); | ||
88 | |||
89 | DECLARE_EVENT_CLASS(mm_vmscan_direct_reclaim_begin_template, | ||
90 | |||
91 | TP_PROTO(int order, int may_writepage, gfp_t gfp_flags), | ||
92 | |||
93 | TP_ARGS(order, may_writepage, gfp_flags), | ||
94 | |||
95 | TP_STRUCT__entry( | ||
96 | __field( int, order ) | ||
97 | __field( int, may_writepage ) | ||
98 | __field( gfp_t, gfp_flags ) | ||
99 | ), | ||
100 | |||
101 | TP_fast_assign( | ||
102 | __entry->order = order; | ||
103 | __entry->may_writepage = may_writepage; | ||
104 | __entry->gfp_flags = gfp_flags; | ||
105 | ), | ||
106 | |||
107 | TP_printk("order=%d may_writepage=%d gfp_flags=%s", | ||
108 | __entry->order, | ||
109 | __entry->may_writepage, | ||
110 | show_gfp_flags(__entry->gfp_flags)) | ||
111 | ); | ||
112 | |||
113 | DEFINE_EVENT(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_direct_reclaim_begin, | ||
114 | |||
115 | TP_PROTO(int order, int may_writepage, gfp_t gfp_flags), | ||
116 | |||
117 | TP_ARGS(order, may_writepage, gfp_flags) | ||
118 | ); | ||
119 | |||
120 | DEFINE_EVENT(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_reclaim_begin, | ||
121 | |||
122 | TP_PROTO(int order, int may_writepage, gfp_t gfp_flags), | ||
123 | |||
124 | TP_ARGS(order, may_writepage, gfp_flags) | ||
125 | ); | ||
126 | |||
127 | DEFINE_EVENT(mm_vmscan_direct_reclaim_begin_template, mm_vmscan_memcg_softlimit_reclaim_begin, | ||
128 | |||
129 | TP_PROTO(int order, int may_writepage, gfp_t gfp_flags), | ||
130 | |||
131 | TP_ARGS(order, may_writepage, gfp_flags) | ||
132 | ); | ||
133 | |||
134 | DECLARE_EVENT_CLASS(mm_vmscan_direct_reclaim_end_template, | ||
135 | |||
136 | TP_PROTO(unsigned long nr_reclaimed), | ||
137 | |||
138 | TP_ARGS(nr_reclaimed), | ||
139 | |||
140 | TP_STRUCT__entry( | ||
141 | __field( unsigned long, nr_reclaimed ) | ||
142 | ), | ||
143 | |||
144 | TP_fast_assign( | ||
145 | __entry->nr_reclaimed = nr_reclaimed; | ||
146 | ), | ||
147 | |||
148 | TP_printk("nr_reclaimed=%lu", __entry->nr_reclaimed) | ||
149 | ); | ||
150 | |||
151 | DEFINE_EVENT(mm_vmscan_direct_reclaim_end_template, mm_vmscan_direct_reclaim_end, | ||
152 | |||
153 | TP_PROTO(unsigned long nr_reclaimed), | ||
154 | |||
155 | TP_ARGS(nr_reclaimed) | ||
156 | ); | ||
157 | |||
158 | DEFINE_EVENT(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_reclaim_end, | ||
159 | |||
160 | TP_PROTO(unsigned long nr_reclaimed), | ||
161 | |||
162 | TP_ARGS(nr_reclaimed) | ||
163 | ); | ||
164 | |||
165 | DEFINE_EVENT(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_softlimit_reclaim_end, | ||
166 | |||
167 | TP_PROTO(unsigned long nr_reclaimed), | ||
168 | |||
169 | TP_ARGS(nr_reclaimed) | ||
170 | ); | ||
171 | |||
172 | |||
173 | DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template, | ||
174 | |||
175 | TP_PROTO(int order, | ||
176 | unsigned long nr_requested, | ||
177 | unsigned long nr_scanned, | ||
178 | unsigned long nr_taken, | ||
179 | unsigned long nr_lumpy_taken, | ||
180 | unsigned long nr_lumpy_dirty, | ||
181 | unsigned long nr_lumpy_failed, | ||
182 | int isolate_mode), | ||
183 | |||
184 | TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode), | ||
185 | |||
186 | TP_STRUCT__entry( | ||
187 | __field(int, order) | ||
188 | __field(unsigned long, nr_requested) | ||
189 | __field(unsigned long, nr_scanned) | ||
190 | __field(unsigned long, nr_taken) | ||
191 | __field(unsigned long, nr_lumpy_taken) | ||
192 | __field(unsigned long, nr_lumpy_dirty) | ||
193 | __field(unsigned long, nr_lumpy_failed) | ||
194 | __field(int, isolate_mode) | ||
195 | ), | ||
196 | |||
197 | TP_fast_assign( | ||
198 | __entry->order = order; | ||
199 | __entry->nr_requested = nr_requested; | ||
200 | __entry->nr_scanned = nr_scanned; | ||
201 | __entry->nr_taken = nr_taken; | ||
202 | __entry->nr_lumpy_taken = nr_lumpy_taken; | ||
203 | __entry->nr_lumpy_dirty = nr_lumpy_dirty; | ||
204 | __entry->nr_lumpy_failed = nr_lumpy_failed; | ||
205 | __entry->isolate_mode = isolate_mode; | ||
206 | ), | ||
207 | |||
208 | TP_printk("isolate_mode=%d order=%d nr_requested=%lu nr_scanned=%lu nr_taken=%lu contig_taken=%lu contig_dirty=%lu contig_failed=%lu", | ||
209 | __entry->isolate_mode, | ||
210 | __entry->order, | ||
211 | __entry->nr_requested, | ||
212 | __entry->nr_scanned, | ||
213 | __entry->nr_taken, | ||
214 | __entry->nr_lumpy_taken, | ||
215 | __entry->nr_lumpy_dirty, | ||
216 | __entry->nr_lumpy_failed) | ||
217 | ); | ||
218 | |||
219 | DEFINE_EVENT(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate, | ||
220 | |||
221 | TP_PROTO(int order, | ||
222 | unsigned long nr_requested, | ||
223 | unsigned long nr_scanned, | ||
224 | unsigned long nr_taken, | ||
225 | unsigned long nr_lumpy_taken, | ||
226 | unsigned long nr_lumpy_dirty, | ||
227 | unsigned long nr_lumpy_failed, | ||
228 | int isolate_mode), | ||
229 | |||
230 | TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode) | ||
231 | |||
232 | ); | ||
233 | |||
234 | DEFINE_EVENT(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate, | ||
235 | |||
236 | TP_PROTO(int order, | ||
237 | unsigned long nr_requested, | ||
238 | unsigned long nr_scanned, | ||
239 | unsigned long nr_taken, | ||
240 | unsigned long nr_lumpy_taken, | ||
241 | unsigned long nr_lumpy_dirty, | ||
242 | unsigned long nr_lumpy_failed, | ||
243 | int isolate_mode), | ||
244 | |||
245 | TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode) | ||
246 | |||
247 | ); | ||
248 | |||
249 | TRACE_EVENT(mm_vmscan_writepage, | ||
250 | |||
251 | TP_PROTO(struct page *page, | ||
252 | int reclaim_flags), | ||
253 | |||
254 | TP_ARGS(page, reclaim_flags), | ||
255 | |||
256 | TP_STRUCT__entry( | ||
257 | __field(struct page *, page) | ||
258 | __field(int, reclaim_flags) | ||
259 | ), | ||
260 | |||
261 | TP_fast_assign( | ||
262 | __entry->page = page; | ||
263 | __entry->reclaim_flags = reclaim_flags; | ||
264 | ), | ||
265 | |||
266 | TP_printk("page=%p pfn=%lu flags=%s", | ||
267 | __entry->page, | ||
268 | page_to_pfn(__entry->page), | ||
269 | show_reclaim_flags(__entry->reclaim_flags)) | ||
270 | ); | ||
271 | |||
272 | #endif /* _TRACE_VMSCAN_H */ | ||
273 | |||
274 | /* This part must be outside protection */ | ||
275 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h deleted file mode 100644 index d6c974474e70..000000000000 --- a/include/trace/events/workqueue.h +++ /dev/null | |||
@@ -1,92 +0,0 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM workqueue | ||
3 | |||
4 | #if !defined(_TRACE_WORKQUEUE_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_WORKQUEUE_H | ||
6 | |||
7 | #include <linux/workqueue.h> | ||
8 | #include <linux/sched.h> | ||
9 | #include <linux/tracepoint.h> | ||
10 | |||
11 | DECLARE_EVENT_CLASS(workqueue, | ||
12 | |||
13 | TP_PROTO(struct task_struct *wq_thread, struct work_struct *work), | ||
14 | |||
15 | TP_ARGS(wq_thread, work), | ||
16 | |||
17 | TP_STRUCT__entry( | ||
18 | __array(char, thread_comm, TASK_COMM_LEN) | ||
19 | __field(pid_t, thread_pid) | ||
20 | __field(work_func_t, func) | ||
21 | ), | ||
22 | |||
23 | TP_fast_assign( | ||
24 | memcpy(__entry->thread_comm, wq_thread->comm, TASK_COMM_LEN); | ||
25 | __entry->thread_pid = wq_thread->pid; | ||
26 | __entry->func = work->func; | ||
27 | ), | ||
28 | |||
29 | TP_printk("thread=%s:%d func=%pf", __entry->thread_comm, | ||
30 | __entry->thread_pid, __entry->func) | ||
31 | ); | ||
32 | |||
33 | DEFINE_EVENT(workqueue, workqueue_insertion, | ||
34 | |||
35 | TP_PROTO(struct task_struct *wq_thread, struct work_struct *work), | ||
36 | |||
37 | TP_ARGS(wq_thread, work) | ||
38 | ); | ||
39 | |||
40 | DEFINE_EVENT(workqueue, workqueue_execution, | ||
41 | |||
42 | TP_PROTO(struct task_struct *wq_thread, struct work_struct *work), | ||
43 | |||
44 | TP_ARGS(wq_thread, work) | ||
45 | ); | ||
46 | |||
47 | /* Trace the creation of one workqueue thread on a cpu */ | ||
48 | TRACE_EVENT(workqueue_creation, | ||
49 | |||
50 | TP_PROTO(struct task_struct *wq_thread, int cpu), | ||
51 | |||
52 | TP_ARGS(wq_thread, cpu), | ||
53 | |||
54 | TP_STRUCT__entry( | ||
55 | __array(char, thread_comm, TASK_COMM_LEN) | ||
56 | __field(pid_t, thread_pid) | ||
57 | __field(int, cpu) | ||
58 | ), | ||
59 | |||
60 | TP_fast_assign( | ||
61 | memcpy(__entry->thread_comm, wq_thread->comm, TASK_COMM_LEN); | ||
62 | __entry->thread_pid = wq_thread->pid; | ||
63 | __entry->cpu = cpu; | ||
64 | ), | ||
65 | |||
66 | TP_printk("thread=%s:%d cpu=%d", __entry->thread_comm, | ||
67 | __entry->thread_pid, __entry->cpu) | ||
68 | ); | ||
69 | |||
70 | TRACE_EVENT(workqueue_destruction, | ||
71 | |||
72 | TP_PROTO(struct task_struct *wq_thread), | ||
73 | |||
74 | TP_ARGS(wq_thread), | ||
75 | |||
76 | TP_STRUCT__entry( | ||
77 | __array(char, thread_comm, TASK_COMM_LEN) | ||
78 | __field(pid_t, thread_pid) | ||
79 | ), | ||
80 | |||
81 | TP_fast_assign( | ||
82 | memcpy(__entry->thread_comm, wq_thread->comm, TASK_COMM_LEN); | ||
83 | __entry->thread_pid = wq_thread->pid; | ||
84 | ), | ||
85 | |||
86 | TP_printk("thread=%s:%d", __entry->thread_comm, __entry->thread_pid) | ||
87 | ); | ||
88 | |||
89 | #endif /* _TRACE_WORKQUEUE_H */ | ||
90 | |||
91 | /* This part must be outside protection */ | ||
92 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h new file mode 100644 index 000000000000..f345f66ae9d1 --- /dev/null +++ b/include/trace/events/writeback.h | |||
@@ -0,0 +1,159 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM writeback | ||
3 | |||
4 | #if !defined(_TRACE_WRITEBACK_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_WRITEBACK_H | ||
6 | |||
7 | #include <linux/backing-dev.h> | ||
8 | #include <linux/device.h> | ||
9 | #include <linux/writeback.h> | ||
10 | |||
11 | struct wb_writeback_work; | ||
12 | |||
13 | DECLARE_EVENT_CLASS(writeback_work_class, | ||
14 | TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_work *work), | ||
15 | TP_ARGS(bdi, work), | ||
16 | TP_STRUCT__entry( | ||
17 | __array(char, name, 32) | ||
18 | __field(long, nr_pages) | ||
19 | __field(dev_t, sb_dev) | ||
20 | __field(int, sync_mode) | ||
21 | __field(int, for_kupdate) | ||
22 | __field(int, range_cyclic) | ||
23 | __field(int, for_background) | ||
24 | ), | ||
25 | TP_fast_assign( | ||
26 | strncpy(__entry->name, dev_name(bdi->dev), 32); | ||
27 | __entry->nr_pages = work->nr_pages; | ||
28 | __entry->sb_dev = work->sb ? work->sb->s_dev : 0; | ||
29 | __entry->sync_mode = work->sync_mode; | ||
30 | __entry->for_kupdate = work->for_kupdate; | ||
31 | __entry->range_cyclic = work->range_cyclic; | ||
32 | __entry->for_background = work->for_background; | ||
33 | ), | ||
34 | TP_printk("bdi %s: sb_dev %d:%d nr_pages=%ld sync_mode=%d " | ||
35 | "kupdate=%d range_cyclic=%d background=%d", | ||
36 | __entry->name, | ||
37 | MAJOR(__entry->sb_dev), MINOR(__entry->sb_dev), | ||
38 | __entry->nr_pages, | ||
39 | __entry->sync_mode, | ||
40 | __entry->for_kupdate, | ||
41 | __entry->range_cyclic, | ||
42 | __entry->for_background | ||
43 | ) | ||
44 | ); | ||
45 | #define DEFINE_WRITEBACK_WORK_EVENT(name) \ | ||
46 | DEFINE_EVENT(writeback_work_class, name, \ | ||
47 | TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_work *work), \ | ||
48 | TP_ARGS(bdi, work)) | ||
49 | DEFINE_WRITEBACK_WORK_EVENT(writeback_nothread); | ||
50 | DEFINE_WRITEBACK_WORK_EVENT(writeback_queue); | ||
51 | DEFINE_WRITEBACK_WORK_EVENT(writeback_exec); | ||
52 | |||
53 | TRACE_EVENT(writeback_pages_written, | ||
54 | TP_PROTO(long pages_written), | ||
55 | TP_ARGS(pages_written), | ||
56 | TP_STRUCT__entry( | ||
57 | __field(long, pages) | ||
58 | ), | ||
59 | TP_fast_assign( | ||
60 | __entry->pages = pages_written; | ||
61 | ), | ||
62 | TP_printk("%ld", __entry->pages) | ||
63 | ); | ||
64 | |||
65 | DECLARE_EVENT_CLASS(writeback_class, | ||
66 | TP_PROTO(struct backing_dev_info *bdi), | ||
67 | TP_ARGS(bdi), | ||
68 | TP_STRUCT__entry( | ||
69 | __array(char, name, 32) | ||
70 | ), | ||
71 | TP_fast_assign( | ||
72 | strncpy(__entry->name, dev_name(bdi->dev), 32); | ||
73 | ), | ||
74 | TP_printk("bdi %s", | ||
75 | __entry->name | ||
76 | ) | ||
77 | ); | ||
78 | #define DEFINE_WRITEBACK_EVENT(name) \ | ||
79 | DEFINE_EVENT(writeback_class, name, \ | ||
80 | TP_PROTO(struct backing_dev_info *bdi), \ | ||
81 | TP_ARGS(bdi)) | ||
82 | |||
83 | DEFINE_WRITEBACK_EVENT(writeback_nowork); | ||
84 | DEFINE_WRITEBACK_EVENT(writeback_wake_thread); | ||
85 | DEFINE_WRITEBACK_EVENT(writeback_wake_forker_thread); | ||
86 | DEFINE_WRITEBACK_EVENT(writeback_bdi_register); | ||
87 | DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister); | ||
88 | DEFINE_WRITEBACK_EVENT(writeback_thread_start); | ||
89 | DEFINE_WRITEBACK_EVENT(writeback_thread_stop); | ||
90 | |||
91 | DECLARE_EVENT_CLASS(wbc_class, | ||
92 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), | ||
93 | TP_ARGS(wbc, bdi), | ||
94 | TP_STRUCT__entry( | ||
95 | __array(char, name, 32) | ||
96 | __field(long, nr_to_write) | ||
97 | __field(long, pages_skipped) | ||
98 | __field(int, sync_mode) | ||
99 | __field(int, nonblocking) | ||
100 | __field(int, encountered_congestion) | ||
101 | __field(int, for_kupdate) | ||
102 | __field(int, for_background) | ||
103 | __field(int, for_reclaim) | ||
104 | __field(int, range_cyclic) | ||
105 | __field(int, more_io) | ||
106 | __field(unsigned long, older_than_this) | ||
107 | __field(long, range_start) | ||
108 | __field(long, range_end) | ||
109 | ), | ||
110 | |||
111 | TP_fast_assign( | ||
112 | strncpy(__entry->name, dev_name(bdi->dev), 32); | ||
113 | __entry->nr_to_write = wbc->nr_to_write; | ||
114 | __entry->pages_skipped = wbc->pages_skipped; | ||
115 | __entry->sync_mode = wbc->sync_mode; | ||
116 | __entry->for_kupdate = wbc->for_kupdate; | ||
117 | __entry->for_background = wbc->for_background; | ||
118 | __entry->for_reclaim = wbc->for_reclaim; | ||
119 | __entry->range_cyclic = wbc->range_cyclic; | ||
120 | __entry->more_io = wbc->more_io; | ||
121 | __entry->older_than_this = wbc->older_than_this ? | ||
122 | *wbc->older_than_this : 0; | ||
123 | __entry->range_start = (long)wbc->range_start; | ||
124 | __entry->range_end = (long)wbc->range_end; | ||
125 | ), | ||
126 | |||
127 | TP_printk("bdi %s: towrt=%ld skip=%ld mode=%d kupd=%d " | ||
128 | "bgrd=%d reclm=%d cyclic=%d more=%d older=0x%lx " | ||
129 | "start=0x%lx end=0x%lx", | ||
130 | __entry->name, | ||
131 | __entry->nr_to_write, | ||
132 | __entry->pages_skipped, | ||
133 | __entry->sync_mode, | ||
134 | __entry->for_kupdate, | ||
135 | __entry->for_background, | ||
136 | __entry->for_reclaim, | ||
137 | __entry->range_cyclic, | ||
138 | __entry->more_io, | ||
139 | __entry->older_than_this, | ||
140 | __entry->range_start, | ||
141 | __entry->range_end) | ||
142 | ) | ||
143 | |||
144 | #define DEFINE_WBC_EVENT(name) \ | ||
145 | DEFINE_EVENT(wbc_class, name, \ | ||
146 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \ | ||
147 | TP_ARGS(wbc, bdi)) | ||
148 | DEFINE_WBC_EVENT(wbc_writeback_start); | ||
149 | DEFINE_WBC_EVENT(wbc_writeback_written); | ||
150 | DEFINE_WBC_EVENT(wbc_writeback_wait); | ||
151 | DEFINE_WBC_EVENT(wbc_balance_dirty_start); | ||
152 | DEFINE_WBC_EVENT(wbc_balance_dirty_written); | ||
153 | DEFINE_WBC_EVENT(wbc_balance_dirty_wait); | ||
154 | DEFINE_WBC_EVENT(wbc_writepage); | ||
155 | |||
156 | #endif /* _TRACE_WRITEBACK_H */ | ||
157 | |||
158 | /* This part must be outside protection */ | ||
159 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 5a64905d7278..a9377c0083ad 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -75,15 +75,12 @@ | |||
75 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | 75 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ |
76 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) | 76 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) |
77 | 77 | ||
78 | #undef __cpparg | ||
79 | #define __cpparg(arg...) arg | ||
80 | |||
81 | /* Callbacks are meaningless to ftrace. */ | 78 | /* Callbacks are meaningless to ftrace. */ |
82 | #undef TRACE_EVENT_FN | 79 | #undef TRACE_EVENT_FN |
83 | #define TRACE_EVENT_FN(name, proto, args, tstruct, \ | 80 | #define TRACE_EVENT_FN(name, proto, args, tstruct, \ |
84 | assign, print, reg, unreg) \ | 81 | assign, print, reg, unreg) \ |
85 | TRACE_EVENT(name, __cpparg(proto), __cpparg(args), \ | 82 | TRACE_EVENT(name, PARAMS(proto), PARAMS(args), \ |
86 | __cpparg(tstruct), __cpparg(assign), __cpparg(print)) \ | 83 | PARAMS(tstruct), PARAMS(assign), PARAMS(print)) \ |
87 | 84 | ||
88 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 85 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
89 | 86 | ||
@@ -145,7 +142,7 @@ | |||
145 | * struct trace_seq *s = &iter->seq; | 142 | * struct trace_seq *s = &iter->seq; |
146 | * struct ftrace_raw_<call> *field; <-- defined in stage 1 | 143 | * struct ftrace_raw_<call> *field; <-- defined in stage 1 |
147 | * struct trace_entry *entry; | 144 | * struct trace_entry *entry; |
148 | * struct trace_seq *p; | 145 | * struct trace_seq *p = &iter->tmp_seq; |
149 | * int ret; | 146 | * int ret; |
150 | * | 147 | * |
151 | * entry = iter->ent; | 148 | * entry = iter->ent; |
@@ -157,12 +154,10 @@ | |||
157 | * | 154 | * |
158 | * field = (typeof(field))entry; | 155 | * field = (typeof(field))entry; |
159 | * | 156 | * |
160 | * p = &get_cpu_var(ftrace_event_seq); | ||
161 | * trace_seq_init(p); | 157 | * trace_seq_init(p); |
162 | * ret = trace_seq_printf(s, "%s: ", <call>); | 158 | * ret = trace_seq_printf(s, "%s: ", <call>); |
163 | * if (ret) | 159 | * if (ret) |
164 | * ret = trace_seq_printf(s, <TP_printk> "\n"); | 160 | * ret = trace_seq_printf(s, <TP_printk> "\n"); |
165 | * put_cpu(); | ||
166 | * if (!ret) | 161 | * if (!ret) |
167 | * return TRACE_TYPE_PARTIAL_LINE; | 162 | * return TRACE_TYPE_PARTIAL_LINE; |
168 | * | 163 | * |
@@ -216,7 +211,7 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \ | |||
216 | struct trace_seq *s = &iter->seq; \ | 211 | struct trace_seq *s = &iter->seq; \ |
217 | struct ftrace_raw_##call *field; \ | 212 | struct ftrace_raw_##call *field; \ |
218 | struct trace_entry *entry; \ | 213 | struct trace_entry *entry; \ |
219 | struct trace_seq *p; \ | 214 | struct trace_seq *p = &iter->tmp_seq; \ |
220 | int ret; \ | 215 | int ret; \ |
221 | \ | 216 | \ |
222 | event = container_of(trace_event, struct ftrace_event_call, \ | 217 | event = container_of(trace_event, struct ftrace_event_call, \ |
@@ -231,12 +226,10 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \ | |||
231 | \ | 226 | \ |
232 | field = (typeof(field))entry; \ | 227 | field = (typeof(field))entry; \ |
233 | \ | 228 | \ |
234 | p = &get_cpu_var(ftrace_event_seq); \ | ||
235 | trace_seq_init(p); \ | 229 | trace_seq_init(p); \ |
236 | ret = trace_seq_printf(s, "%s: ", event->name); \ | 230 | ret = trace_seq_printf(s, "%s: ", event->name); \ |
237 | if (ret) \ | 231 | if (ret) \ |
238 | ret = trace_seq_printf(s, print); \ | 232 | ret = trace_seq_printf(s, print); \ |
239 | put_cpu(); \ | ||
240 | if (!ret) \ | 233 | if (!ret) \ |
241 | return TRACE_TYPE_PARTIAL_LINE; \ | 234 | return TRACE_TYPE_PARTIAL_LINE; \ |
242 | \ | 235 | \ |
@@ -255,7 +248,7 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \ | |||
255 | struct trace_seq *s = &iter->seq; \ | 248 | struct trace_seq *s = &iter->seq; \ |
256 | struct ftrace_raw_##template *field; \ | 249 | struct ftrace_raw_##template *field; \ |
257 | struct trace_entry *entry; \ | 250 | struct trace_entry *entry; \ |
258 | struct trace_seq *p; \ | 251 | struct trace_seq *p = &iter->tmp_seq; \ |
259 | int ret; \ | 252 | int ret; \ |
260 | \ | 253 | \ |
261 | entry = iter->ent; \ | 254 | entry = iter->ent; \ |
@@ -267,12 +260,10 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags, \ | |||
267 | \ | 260 | \ |
268 | field = (typeof(field))entry; \ | 261 | field = (typeof(field))entry; \ |
269 | \ | 262 | \ |
270 | p = &get_cpu_var(ftrace_event_seq); \ | ||
271 | trace_seq_init(p); \ | 263 | trace_seq_init(p); \ |
272 | ret = trace_seq_printf(s, "%s: ", #call); \ | 264 | ret = trace_seq_printf(s, "%s: ", #call); \ |
273 | if (ret) \ | 265 | if (ret) \ |
274 | ret = trace_seq_printf(s, print); \ | 266 | ret = trace_seq_printf(s, print); \ |
275 | put_cpu(); \ | ||
276 | if (!ret) \ | 267 | if (!ret) \ |
277 | return TRACE_TYPE_PARTIAL_LINE; \ | 268 | return TRACE_TYPE_PARTIAL_LINE; \ |
278 | \ | 269 | \ |
@@ -439,6 +430,7 @@ static inline notrace int ftrace_get_offsets_##call( \ | |||
439 | * .fields = LIST_HEAD_INIT(event_class_##call.fields), | 430 | * .fields = LIST_HEAD_INIT(event_class_##call.fields), |
440 | * .raw_init = trace_event_raw_init, | 431 | * .raw_init = trace_event_raw_init, |
441 | * .probe = ftrace_raw_event_##call, | 432 | * .probe = ftrace_raw_event_##call, |
433 | * .reg = ftrace_event_reg, | ||
442 | * }; | 434 | * }; |
443 | * | 435 | * |
444 | * static struct ftrace_event_call __used | 436 | * static struct ftrace_event_call __used |
@@ -567,6 +559,7 @@ static struct ftrace_event_class __used event_class_##call = { \ | |||
567 | .fields = LIST_HEAD_INIT(event_class_##call.fields),\ | 559 | .fields = LIST_HEAD_INIT(event_class_##call.fields),\ |
568 | .raw_init = trace_event_raw_init, \ | 560 | .raw_init = trace_event_raw_init, \ |
569 | .probe = ftrace_raw_event_##call, \ | 561 | .probe = ftrace_raw_event_##call, \ |
562 | .reg = ftrace_event_reg, \ | ||
570 | _TRACE_PERF_INIT(call) \ | 563 | _TRACE_PERF_INIT(call) \ |
571 | }; | 564 | }; |
572 | 565 | ||
@@ -705,7 +698,7 @@ perf_trace_##call(void *__data, proto) \ | |||
705 | int __data_size; \ | 698 | int __data_size; \ |
706 | int rctx; \ | 699 | int rctx; \ |
707 | \ | 700 | \ |
708 | perf_fetch_caller_regs(&__regs, 1); \ | 701 | perf_fetch_caller_regs(&__regs); \ |
709 | \ | 702 | \ |
710 | __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ | 703 | __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ |
711 | __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),\ | 704 | __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),\ |
diff --git a/include/trace/syscall.h b/include/trace/syscall.h index 257e08960d7b..31966a4fb8cc 100644 --- a/include/trace/syscall.h +++ b/include/trace/syscall.h | |||
@@ -26,7 +26,6 @@ struct syscall_metadata { | |||
26 | const char **types; | 26 | const char **types; |
27 | const char **args; | 27 | const char **args; |
28 | struct list_head enter_fields; | 28 | struct list_head enter_fields; |
29 | struct list_head exit_fields; | ||
30 | 29 | ||
31 | struct ftrace_event_call *enter_event; | 30 | struct ftrace_event_call *enter_event; |
32 | struct ftrace_event_call *exit_event; | 31 | struct ftrace_event_call *exit_event; |