aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-03-09 15:47:18 -0400
committerSteven Rostedt <srostedt@redhat.com>2009-03-10 00:35:04 -0400
commit2939b0469d04ba9ac791aca9a81625d7eb50662b (patch)
tree573f10c39f34c670fdc6832415642738c5afb3f9
parent156b5f172a64103bcb13b6d26288388b9019caa3 (diff)
tracing: replace TP<var> with TP_<var>
Impact: clean up The macros TPPROTO, TPARGS, TPFMT, TPRAWFMT, and TPCMD all look a bit ugly. This patch adds an underscore to their names. Signed-off-by: Steven Rostedt <srostedt@redhat.com>
-rw-r--r--Documentation/tracepoints.txt8
-rw-r--r--include/linux/tracepoint.h6
-rw-r--r--include/trace/block.h70
-rw-r--r--include/trace/irq_event_types.h16
-rw-r--r--include/trace/lockdep_event_types.h24
-rw-r--r--include/trace/power.h12
-rw-r--r--include/trace/sched_event_types.h98
-rw-r--r--include/trace/workqueue.h16
-rw-r--r--kernel/trace/trace_event_types.h28
-rw-r--r--kernel/trace/trace_events_stage_2.h6
-rw-r--r--kernel/trace/trace_events_stage_3.h8
-rw-r--r--kernel/trace/trace_export.c8
-rw-r--r--kernel/trace/trace_format.h55
-rw-r--r--samples/tracepoints/tp-samples-trace.h8
14 files changed, 154 insertions, 209 deletions
diff --git a/Documentation/tracepoints.txt b/Documentation/tracepoints.txt
index 6f0a044f5b5e..4ff43c6de299 100644
--- a/Documentation/tracepoints.txt
+++ b/Documentation/tracepoints.txt
@@ -45,8 +45,8 @@ In include/trace/subsys.h :
45#include <linux/tracepoint.h> 45#include <linux/tracepoint.h>
46 46
47DECLARE_TRACE(subsys_eventname, 47DECLARE_TRACE(subsys_eventname,
48 TPPROTO(int firstarg, struct task_struct *p), 48 TP_PROTO(int firstarg, struct task_struct *p),
49 TPARGS(firstarg, p)); 49 TP_ARGS(firstarg, p));
50 50
51In subsys/file.c (where the tracing statement must be added) : 51In subsys/file.c (where the tracing statement must be added) :
52 52
@@ -66,10 +66,10 @@ Where :
66 - subsys is the name of your subsystem. 66 - subsys is the name of your subsystem.
67 - eventname is the name of the event to trace. 67 - eventname is the name of the event to trace.
68 68
69- TPPROTO(int firstarg, struct task_struct *p) is the prototype of the 69- TP_PROTO(int firstarg, struct task_struct *p) is the prototype of the
70 function called by this tracepoint. 70 function called by this tracepoint.
71 71
72- TPARGS(firstarg, p) are the parameters names, same as found in the 72- TP_ARGS(firstarg, p) are the parameters names, same as found in the
73 prototype. 73 prototype.
74 74
75Connecting a function (probe) to a tracepoint is done by providing a 75Connecting a function (probe) to a tracepoint is done by providing a
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index 152b2f03fb86..3bcc3e171443 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -31,8 +31,8 @@ struct tracepoint {
31 * Keep in sync with vmlinux.lds.h. 31 * Keep in sync with vmlinux.lds.h.
32 */ 32 */
33 33
34#define TPPROTO(args...) args 34#define TP_PROTO(args...) args
35#define TPARGS(args...) args 35#define TP_ARGS(args...) args
36 36
37#ifdef CONFIG_TRACEPOINTS 37#ifdef CONFIG_TRACEPOINTS
38 38
@@ -65,7 +65,7 @@ struct tracepoint {
65 { \ 65 { \
66 if (unlikely(__tracepoint_##name.state)) \ 66 if (unlikely(__tracepoint_##name.state)) \
67 __DO_TRACE(&__tracepoint_##name, \ 67 __DO_TRACE(&__tracepoint_##name, \
68 TPPROTO(proto), TPARGS(args)); \ 68 TP_PROTO(proto), TP_ARGS(args)); \
69 } \ 69 } \
70 static inline int register_trace_##name(void (*probe)(proto)) \ 70 static inline int register_trace_##name(void (*probe)(proto)) \
71 { \ 71 { \
diff --git a/include/trace/block.h b/include/trace/block.h
index 25c6a1fd5b77..25b7068b819e 100644
--- a/include/trace/block.h
+++ b/include/trace/block.h
@@ -5,72 +5,72 @@
5#include <linux/tracepoint.h> 5#include <linux/tracepoint.h>
6 6
7DECLARE_TRACE(block_rq_abort, 7DECLARE_TRACE(block_rq_abort,
8 TPPROTO(struct request_queue *q, struct request *rq), 8 TP_PROTO(struct request_queue *q, struct request *rq),
9 TPARGS(q, rq)); 9 TP_ARGS(q, rq));
10 10
11DECLARE_TRACE(block_rq_insert, 11DECLARE_TRACE(block_rq_insert,
12 TPPROTO(struct request_queue *q, struct request *rq), 12 TP_PROTO(struct request_queue *q, struct request *rq),
13 TPARGS(q, rq)); 13 TP_ARGS(q, rq));
14 14
15DECLARE_TRACE(block_rq_issue, 15DECLARE_TRACE(block_rq_issue,
16 TPPROTO(struct request_queue *q, struct request *rq), 16 TP_PROTO(struct request_queue *q, struct request *rq),
17 TPARGS(q, rq)); 17 TP_ARGS(q, rq));
18 18
19DECLARE_TRACE(block_rq_requeue, 19DECLARE_TRACE(block_rq_requeue,
20 TPPROTO(struct request_queue *q, struct request *rq), 20 TP_PROTO(struct request_queue *q, struct request *rq),
21 TPARGS(q, rq)); 21 TP_ARGS(q, rq));
22 22
23DECLARE_TRACE(block_rq_complete, 23DECLARE_TRACE(block_rq_complete,
24 TPPROTO(struct request_queue *q, struct request *rq), 24 TP_PROTO(struct request_queue *q, struct request *rq),
25 TPARGS(q, rq)); 25 TP_ARGS(q, rq));
26 26
27DECLARE_TRACE(block_bio_bounce, 27DECLARE_TRACE(block_bio_bounce,
28 TPPROTO(struct request_queue *q, struct bio *bio), 28 TP_PROTO(struct request_queue *q, struct bio *bio),
29 TPARGS(q, bio)); 29 TP_ARGS(q, bio));
30 30
31DECLARE_TRACE(block_bio_complete, 31DECLARE_TRACE(block_bio_complete,
32 TPPROTO(struct request_queue *q, struct bio *bio), 32 TP_PROTO(struct request_queue *q, struct bio *bio),
33 TPARGS(q, bio)); 33 TP_ARGS(q, bio));
34 34
35DECLARE_TRACE(block_bio_backmerge, 35DECLARE_TRACE(block_bio_backmerge,
36 TPPROTO(struct request_queue *q, struct bio *bio), 36 TP_PROTO(struct request_queue *q, struct bio *bio),
37 TPARGS(q, bio)); 37 TP_ARGS(q, bio));
38 38
39DECLARE_TRACE(block_bio_frontmerge, 39DECLARE_TRACE(block_bio_frontmerge,
40 TPPROTO(struct request_queue *q, struct bio *bio), 40 TP_PROTO(struct request_queue *q, struct bio *bio),
41 TPARGS(q, bio)); 41 TP_ARGS(q, bio));
42 42
43DECLARE_TRACE(block_bio_queue, 43DECLARE_TRACE(block_bio_queue,
44 TPPROTO(struct request_queue *q, struct bio *bio), 44 TP_PROTO(struct request_queue *q, struct bio *bio),
45 TPARGS(q, bio)); 45 TP_ARGS(q, bio));
46 46
47DECLARE_TRACE(block_getrq, 47DECLARE_TRACE(block_getrq,
48 TPPROTO(struct request_queue *q, struct bio *bio, int rw), 48 TP_PROTO(struct request_queue *q, struct bio *bio, int rw),
49 TPARGS(q, bio, rw)); 49 TP_ARGS(q, bio, rw));
50 50
51DECLARE_TRACE(block_sleeprq, 51DECLARE_TRACE(block_sleeprq,
52 TPPROTO(struct request_queue *q, struct bio *bio, int rw), 52 TP_PROTO(struct request_queue *q, struct bio *bio, int rw),
53 TPARGS(q, bio, rw)); 53 TP_ARGS(q, bio, rw));
54 54
55DECLARE_TRACE(block_plug, 55DECLARE_TRACE(block_plug,
56 TPPROTO(struct request_queue *q), 56 TP_PROTO(struct request_queue *q),
57 TPARGS(q)); 57 TP_ARGS(q));
58 58
59DECLARE_TRACE(block_unplug_timer, 59DECLARE_TRACE(block_unplug_timer,
60 TPPROTO(struct request_queue *q), 60 TP_PROTO(struct request_queue *q),
61 TPARGS(q)); 61 TP_ARGS(q));
62 62
63DECLARE_TRACE(block_unplug_io, 63DECLARE_TRACE(block_unplug_io,
64 TPPROTO(struct request_queue *q), 64 TP_PROTO(struct request_queue *q),
65 TPARGS(q)); 65 TP_ARGS(q));
66 66
67DECLARE_TRACE(block_split, 67DECLARE_TRACE(block_split,
68 TPPROTO(struct request_queue *q, struct bio *bio, unsigned int pdu), 68 TP_PROTO(struct request_queue *q, struct bio *bio, unsigned int pdu),
69 TPARGS(q, bio, pdu)); 69 TP_ARGS(q, bio, pdu));
70 70
71DECLARE_TRACE(block_remap, 71DECLARE_TRACE(block_remap,
72 TPPROTO(struct request_queue *q, struct bio *bio, dev_t dev, 72 TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev,
73 sector_t from, sector_t to), 73 sector_t from, sector_t to),
74 TPARGS(q, bio, dev, from, to)); 74 TP_ARGS(q, bio, dev, from, to));
75 75
76#endif 76#endif
diff --git a/include/trace/irq_event_types.h b/include/trace/irq_event_types.h
index 65850bc5ea06..0147d9eef5f4 100644
--- a/include/trace/irq_event_types.h
+++ b/include/trace/irq_event_types.h
@@ -9,25 +9,25 @@
9#define TRACE_SYSTEM irq 9#define TRACE_SYSTEM irq
10 10
11TRACE_EVENT_FORMAT(irq_handler_entry, 11TRACE_EVENT_FORMAT(irq_handler_entry,
12 TPPROTO(int irq, struct irqaction *action), 12 TP_PROTO(int irq, struct irqaction *action),
13 TPARGS(irq, action), 13 TP_ARGS(irq, action),
14 TPFMT("irq=%d handler=%s", irq, action->name), 14 TP_FMT("irq=%d handler=%s", irq, action->name),
15 TRACE_STRUCT( 15 TRACE_STRUCT(
16 TRACE_FIELD(int, irq, irq) 16 TRACE_FIELD(int, irq, irq)
17 ), 17 ),
18 TPRAWFMT("irq %d") 18 TP_RAW_FMT("irq %d")
19 ); 19 );
20 20
21TRACE_EVENT_FORMAT(irq_handler_exit, 21TRACE_EVENT_FORMAT(irq_handler_exit,
22 TPPROTO(int irq, struct irqaction *action, int ret), 22 TP_PROTO(int irq, struct irqaction *action, int ret),
23 TPARGS(irq, action, ret), 23 TP_ARGS(irq, action, ret),
24 TPFMT("irq=%d handler=%s return=%s", 24 TP_FMT("irq=%d handler=%s return=%s",
25 irq, action->name, ret ? "handled" : "unhandled"), 25 irq, action->name, ret ? "handled" : "unhandled"),
26 TRACE_STRUCT( 26 TRACE_STRUCT(
27 TRACE_FIELD(int, irq, irq) 27 TRACE_FIELD(int, irq, irq)
28 TRACE_FIELD(int, ret, ret) 28 TRACE_FIELD(int, ret, ret)
29 ), 29 ),
30 TPRAWFMT("irq %d ret %d") 30 TP_RAW_FMT("irq %d ret %d")
31 ); 31 );
32 32
33#undef TRACE_SYSTEM 33#undef TRACE_SYSTEM
diff --git a/include/trace/lockdep_event_types.h b/include/trace/lockdep_event_types.h
index f713d74a82b4..1f00e8b3543e 100644
--- a/include/trace/lockdep_event_types.h
+++ b/include/trace/lockdep_event_types.h
@@ -10,32 +10,32 @@
10#ifdef CONFIG_LOCKDEP 10#ifdef CONFIG_LOCKDEP
11 11
12TRACE_FORMAT(lock_acquire, 12TRACE_FORMAT(lock_acquire,
13 TPPROTO(struct lockdep_map *lock, unsigned int subclass, 13 TP_PROTO(struct lockdep_map *lock, unsigned int subclass,
14 int trylock, int read, int check, 14 int trylock, int read, int check,
15 struct lockdep_map *next_lock, unsigned long ip), 15 struct lockdep_map *next_lock, unsigned long ip),
16 TPARGS(lock, subclass, trylock, read, check, next_lock, ip), 16 TP_ARGS(lock, subclass, trylock, read, check, next_lock, ip),
17 TPFMT("%s%s%s", trylock ? "try " : "", 17 TP_FMT("%s%s%s", trylock ? "try " : "",
18 read ? "read " : "", lock->name) 18 read ? "read " : "", lock->name)
19 ); 19 );
20 20
21TRACE_FORMAT(lock_release, 21TRACE_FORMAT(lock_release,
22 TPPROTO(struct lockdep_map *lock, int nested, unsigned long ip), 22 TP_PROTO(struct lockdep_map *lock, int nested, unsigned long ip),
23 TPARGS(lock, nested, ip), 23 TP_ARGS(lock, nested, ip),
24 TPFMT("%s", lock->name) 24 TP_FMT("%s", lock->name)
25 ); 25 );
26 26
27#ifdef CONFIG_LOCK_STAT 27#ifdef CONFIG_LOCK_STAT
28 28
29TRACE_FORMAT(lock_contended, 29TRACE_FORMAT(lock_contended,
30 TPPROTO(struct lockdep_map *lock, unsigned long ip), 30 TP_PROTO(struct lockdep_map *lock, unsigned long ip),
31 TPARGS(lock, ip), 31 TP_ARGS(lock, ip),
32 TPFMT("%s", lock->name) 32 TP_FMT("%s", lock->name)
33 ); 33 );
34 34
35TRACE_FORMAT(lock_acquired, 35TRACE_FORMAT(lock_acquired,
36 TPPROTO(struct lockdep_map *lock, unsigned long ip), 36 TP_PROTO(struct lockdep_map *lock, unsigned long ip),
37 TPARGS(lock, ip), 37 TP_ARGS(lock, ip),
38 TPFMT("%s", lock->name) 38 TP_FMT("%s", lock->name)
39 ); 39 );
40 40
41#endif 41#endif
diff --git a/include/trace/power.h b/include/trace/power.h
index 38aca537e497..ef204666e983 100644
--- a/include/trace/power.h
+++ b/include/trace/power.h
@@ -18,15 +18,15 @@ struct power_trace {
18}; 18};
19 19
20DECLARE_TRACE(power_start, 20DECLARE_TRACE(power_start,
21 TPPROTO(struct power_trace *it, unsigned int type, unsigned int state), 21 TP_PROTO(struct power_trace *it, unsigned int type, unsigned int state),
22 TPARGS(it, type, state)); 22 TP_ARGS(it, type, state));
23 23
24DECLARE_TRACE(power_mark, 24DECLARE_TRACE(power_mark,
25 TPPROTO(struct power_trace *it, unsigned int type, unsigned int state), 25 TP_PROTO(struct power_trace *it, unsigned int type, unsigned int state),
26 TPARGS(it, type, state)); 26 TP_ARGS(it, type, state));
27 27
28DECLARE_TRACE(power_end, 28DECLARE_TRACE(power_end,
29 TPPROTO(struct power_trace *it), 29 TP_PROTO(struct power_trace *it),
30 TPARGS(it)); 30 TP_ARGS(it));
31 31
32#endif /* _TRACE_POWER_H */ 32#endif /* _TRACE_POWER_H */
diff --git a/include/trace/sched_event_types.h b/include/trace/sched_event_types.h
index a6de5c1601a0..71b14828a957 100644
--- a/include/trace/sched_event_types.h
+++ b/include/trace/sched_event_types.h
@@ -9,143 +9,143 @@
9#define TRACE_SYSTEM sched 9#define TRACE_SYSTEM sched
10 10
11TRACE_EVENT_FORMAT(sched_kthread_stop, 11TRACE_EVENT_FORMAT(sched_kthread_stop,
12 TPPROTO(struct task_struct *t), 12 TP_PROTO(struct task_struct *t),
13 TPARGS(t), 13 TP_ARGS(t),
14 TPFMT("task %s:%d", t->comm, t->pid), 14 TP_FMT("task %s:%d", t->comm, t->pid),
15 TRACE_STRUCT( 15 TRACE_STRUCT(
16 TRACE_FIELD(pid_t, pid, t->pid) 16 TRACE_FIELD(pid_t, pid, t->pid)
17 ), 17 ),
18 TPRAWFMT("task %d") 18 TP_RAW_FMT("task %d")
19 ); 19 );
20 20
21TRACE_EVENT_FORMAT(sched_kthread_stop_ret, 21TRACE_EVENT_FORMAT(sched_kthread_stop_ret,
22 TPPROTO(int ret), 22 TP_PROTO(int ret),
23 TPARGS(ret), 23 TP_ARGS(ret),
24 TPFMT("ret=%d", ret), 24 TP_FMT("ret=%d", ret),
25 TRACE_STRUCT( 25 TRACE_STRUCT(
26 TRACE_FIELD(int, ret, ret) 26 TRACE_FIELD(int, ret, ret)
27 ), 27 ),
28 TPRAWFMT("ret=%d") 28 TP_RAW_FMT("ret=%d")
29 ); 29 );
30 30
31TRACE_EVENT_FORMAT(sched_wait_task, 31TRACE_EVENT_FORMAT(sched_wait_task,
32 TPPROTO(struct rq *rq, struct task_struct *p), 32 TP_PROTO(struct rq *rq, struct task_struct *p),
33 TPARGS(rq, p), 33 TP_ARGS(rq, p),
34 TPFMT("task %s:%d", p->comm, p->pid), 34 TP_FMT("task %s:%d", p->comm, p->pid),
35 TRACE_STRUCT( 35 TRACE_STRUCT(
36 TRACE_FIELD(pid_t, pid, p->pid) 36 TRACE_FIELD(pid_t, pid, p->pid)
37 ), 37 ),
38 TPRAWFMT("task %d") 38 TP_RAW_FMT("task %d")
39 ); 39 );
40 40
41TRACE_EVENT_FORMAT(sched_wakeup, 41TRACE_EVENT_FORMAT(sched_wakeup,
42 TPPROTO(struct rq *rq, struct task_struct *p, int success), 42 TP_PROTO(struct rq *rq, struct task_struct *p, int success),
43 TPARGS(rq, p, success), 43 TP_ARGS(rq, p, success),
44 TPFMT("task %s:%d %s", 44 TP_FMT("task %s:%d %s",
45 p->comm, p->pid, success ? "succeeded" : "failed"), 45 p->comm, p->pid, success ? "succeeded" : "failed"),
46 TRACE_STRUCT( 46 TRACE_STRUCT(
47 TRACE_FIELD(pid_t, pid, p->pid) 47 TRACE_FIELD(pid_t, pid, p->pid)
48 TRACE_FIELD(int, success, success) 48 TRACE_FIELD(int, success, success)
49 ), 49 ),
50 TPRAWFMT("task %d success=%d") 50 TP_RAW_FMT("task %d success=%d")
51 ); 51 );
52 52
53TRACE_EVENT_FORMAT(sched_wakeup_new, 53TRACE_EVENT_FORMAT(sched_wakeup_new,
54 TPPROTO(struct rq *rq, struct task_struct *p, int success), 54 TP_PROTO(struct rq *rq, struct task_struct *p, int success),
55 TPARGS(rq, p, success), 55 TP_ARGS(rq, p, success),
56 TPFMT("task %s:%d", 56 TP_FMT("task %s:%d",
57 p->comm, p->pid, success ? "succeeded" : "failed"), 57 p->comm, p->pid, success ? "succeeded" : "failed"),
58 TRACE_STRUCT( 58 TRACE_STRUCT(
59 TRACE_FIELD(pid_t, pid, p->pid) 59 TRACE_FIELD(pid_t, pid, p->pid)
60 TRACE_FIELD(int, success, success) 60 TRACE_FIELD(int, success, success)
61 ), 61 ),
62 TPRAWFMT("task %d success=%d") 62 TP_RAW_FMT("task %d success=%d")
63 ); 63 );
64 64
65TRACE_EVENT_FORMAT(sched_switch, 65TRACE_EVENT_FORMAT(sched_switch,
66 TPPROTO(struct rq *rq, struct task_struct *prev, 66 TP_PROTO(struct rq *rq, struct task_struct *prev,
67 struct task_struct *next), 67 struct task_struct *next),
68 TPARGS(rq, prev, next), 68 TP_ARGS(rq, prev, next),
69 TPFMT("task %s:%d ==> %s:%d", 69 TP_FMT("task %s:%d ==> %s:%d",
70 prev->comm, prev->pid, next->comm, next->pid), 70 prev->comm, prev->pid, next->comm, next->pid),
71 TRACE_STRUCT( 71 TRACE_STRUCT(
72 TRACE_FIELD(pid_t, prev_pid, prev->pid) 72 TRACE_FIELD(pid_t, prev_pid, prev->pid)
73 TRACE_FIELD(int, prev_prio, prev->prio) 73 TRACE_FIELD(int, prev_prio, prev->prio)
74 TRACE_FIELD_SPECIAL(char next_comm[TASK_COMM_LEN], 74 TRACE_FIELD_SPECIAL(char next_comm[TASK_COMM_LEN],
75 next_comm, 75 next_comm,
76 TPCMD(memcpy(TRACE_ENTRY->next_comm, 76 TP_CMD(memcpy(TRACE_ENTRY->next_comm,
77 next->comm, 77 next->comm,
78 TASK_COMM_LEN))) 78 TASK_COMM_LEN)))
79 TRACE_FIELD(pid_t, next_pid, next->pid) 79 TRACE_FIELD(pid_t, next_pid, next->pid)
80 TRACE_FIELD(int, next_prio, next->prio) 80 TRACE_FIELD(int, next_prio, next->prio)
81 ), 81 ),
82 TPRAWFMT("prev %d:%d ==> next %s:%d:%d") 82 TP_RAW_FMT("prev %d:%d ==> next %s:%d:%d")
83 ); 83 );
84 84
85TRACE_EVENT_FORMAT(sched_migrate_task, 85TRACE_EVENT_FORMAT(sched_migrate_task,
86 TPPROTO(struct task_struct *p, int orig_cpu, int dest_cpu), 86 TP_PROTO(struct task_struct *p, int orig_cpu, int dest_cpu),
87 TPARGS(p, orig_cpu, dest_cpu), 87 TP_ARGS(p, orig_cpu, dest_cpu),
88 TPFMT("task %s:%d from: %d to: %d", 88 TP_FMT("task %s:%d from: %d to: %d",
89 p->comm, p->pid, orig_cpu, dest_cpu), 89 p->comm, p->pid, orig_cpu, dest_cpu),
90 TRACE_STRUCT( 90 TRACE_STRUCT(
91 TRACE_FIELD(pid_t, pid, p->pid) 91 TRACE_FIELD(pid_t, pid, p->pid)
92 TRACE_FIELD(int, orig_cpu, orig_cpu) 92 TRACE_FIELD(int, orig_cpu, orig_cpu)
93 TRACE_FIELD(int, dest_cpu, dest_cpu) 93 TRACE_FIELD(int, dest_cpu, dest_cpu)
94 ), 94 ),
95 TPRAWFMT("task %d from: %d to: %d") 95 TP_RAW_FMT("task %d from: %d to: %d")
96 ); 96 );
97 97
98TRACE_EVENT_FORMAT(sched_process_free, 98TRACE_EVENT_FORMAT(sched_process_free,
99 TPPROTO(struct task_struct *p), 99 TP_PROTO(struct task_struct *p),
100 TPARGS(p), 100 TP_ARGS(p),
101 TPFMT("task %s:%d", p->comm, p->pid), 101 TP_FMT("task %s:%d", p->comm, p->pid),
102 TRACE_STRUCT( 102 TRACE_STRUCT(
103 TRACE_FIELD(pid_t, pid, p->pid) 103 TRACE_FIELD(pid_t, pid, p->pid)
104 ), 104 ),
105 TPRAWFMT("task %d") 105 TP_RAW_FMT("task %d")
106 ); 106 );
107 107
108TRACE_EVENT_FORMAT(sched_process_exit, 108TRACE_EVENT_FORMAT(sched_process_exit,
109 TPPROTO(struct task_struct *p), 109 TP_PROTO(struct task_struct *p),
110 TPARGS(p), 110 TP_ARGS(p),
111 TPFMT("task %s:%d", p->comm, p->pid), 111 TP_FMT("task %s:%d", p->comm, p->pid),
112 TRACE_STRUCT( 112 TRACE_STRUCT(
113 TRACE_FIELD(pid_t, pid, p->pid) 113 TRACE_FIELD(pid_t, pid, p->pid)
114 ), 114 ),
115 TPRAWFMT("task %d") 115 TP_RAW_FMT("task %d")
116 ); 116 );
117 117
118TRACE_EVENT_FORMAT(sched_process_wait, 118TRACE_EVENT_FORMAT(sched_process_wait,
119 TPPROTO(struct pid *pid), 119 TP_PROTO(struct pid *pid),
120 TPARGS(pid), 120 TP_ARGS(pid),
121 TPFMT("pid %d", pid_nr(pid)), 121 TP_FMT("pid %d", pid_nr(pid)),
122 TRACE_STRUCT( 122 TRACE_STRUCT(
123 TRACE_FIELD(pid_t, pid, pid_nr(pid)) 123 TRACE_FIELD(pid_t, pid, pid_nr(pid))
124 ), 124 ),
125 TPRAWFMT("task %d") 125 TP_RAW_FMT("task %d")
126 ); 126 );
127 127
128TRACE_EVENT_FORMAT(sched_process_fork, 128TRACE_EVENT_FORMAT(sched_process_fork,
129 TPPROTO(struct task_struct *parent, struct task_struct *child), 129 TP_PROTO(struct task_struct *parent, struct task_struct *child),
130 TPARGS(parent, child), 130 TP_ARGS(parent, child),
131 TPFMT("parent %s:%d child %s:%d", 131 TP_FMT("parent %s:%d child %s:%d",
132 parent->comm, parent->pid, child->comm, child->pid), 132 parent->comm, parent->pid, child->comm, child->pid),
133 TRACE_STRUCT( 133 TRACE_STRUCT(
134 TRACE_FIELD(pid_t, parent, parent->pid) 134 TRACE_FIELD(pid_t, parent, parent->pid)
135 TRACE_FIELD(pid_t, child, child->pid) 135 TRACE_FIELD(pid_t, child, child->pid)
136 ), 136 ),
137 TPRAWFMT("parent %d child %d") 137 TP_RAW_FMT("parent %d child %d")
138 ); 138 );
139 139
140TRACE_EVENT_FORMAT(sched_signal_send, 140TRACE_EVENT_FORMAT(sched_signal_send,
141 TPPROTO(int sig, struct task_struct *p), 141 TP_PROTO(int sig, struct task_struct *p),
142 TPARGS(sig, p), 142 TP_ARGS(sig, p),
143 TPFMT("sig: %d task %s:%d", sig, p->comm, p->pid), 143 TP_FMT("sig: %d task %s:%d", sig, p->comm, p->pid),
144 TRACE_STRUCT( 144 TRACE_STRUCT(
145 TRACE_FIELD(int, sig, sig) 145 TRACE_FIELD(int, sig, sig)
146 TRACE_FIELD(pid_t, pid, p->pid) 146 TRACE_FIELD(pid_t, pid, p->pid)
147 ), 147 ),
148 TPRAWFMT("sig: %d task %d") 148 TP_RAW_FMT("sig: %d task %d")
149 ); 149 );
150 150
151#undef TRACE_SYSTEM 151#undef TRACE_SYSTEM
diff --git a/include/trace/workqueue.h b/include/trace/workqueue.h
index 867829df4571..7626523deeba 100644
--- a/include/trace/workqueue.h
+++ b/include/trace/workqueue.h
@@ -6,20 +6,20 @@
6#include <linux/sched.h> 6#include <linux/sched.h>
7 7
8DECLARE_TRACE(workqueue_insertion, 8DECLARE_TRACE(workqueue_insertion,
9 TPPROTO(struct task_struct *wq_thread, struct work_struct *work), 9 TP_PROTO(struct task_struct *wq_thread, struct work_struct *work),
10 TPARGS(wq_thread, work)); 10 TP_ARGS(wq_thread, work));
11 11
12DECLARE_TRACE(workqueue_execution, 12DECLARE_TRACE(workqueue_execution,
13 TPPROTO(struct task_struct *wq_thread, struct work_struct *work), 13 TP_PROTO(struct task_struct *wq_thread, struct work_struct *work),
14 TPARGS(wq_thread, work)); 14 TP_ARGS(wq_thread, work));
15 15
16/* Trace the creation of one workqueue thread on a cpu */ 16/* Trace the creation of one workqueue thread on a cpu */
17DECLARE_TRACE(workqueue_creation, 17DECLARE_TRACE(workqueue_creation,
18 TPPROTO(struct task_struct *wq_thread, int cpu), 18 TP_PROTO(struct task_struct *wq_thread, int cpu),
19 TPARGS(wq_thread, cpu)); 19 TP_ARGS(wq_thread, cpu));
20 20
21DECLARE_TRACE(workqueue_destruction, 21DECLARE_TRACE(workqueue_destruction,
22 TPPROTO(struct task_struct *wq_thread), 22 TP_PROTO(struct task_struct *wq_thread),
23 TPARGS(wq_thread)); 23 TP_ARGS(wq_thread));
24 24
25#endif /* __TRACE_WORKQUEUE_H */ 25#endif /* __TRACE_WORKQUEUE_H */
diff --git a/kernel/trace/trace_event_types.h b/kernel/trace/trace_event_types.h
index fb4eba166433..d94179aa1fc2 100644
--- a/kernel/trace/trace_event_types.h
+++ b/kernel/trace/trace_event_types.h
@@ -10,7 +10,7 @@ TRACE_EVENT_FORMAT(function, TRACE_FN, ftrace_entry, ignore,
10 TRACE_FIELD(unsigned long, ip, ip) 10 TRACE_FIELD(unsigned long, ip, ip)
11 TRACE_FIELD(unsigned long, parent_ip, parent_ip) 11 TRACE_FIELD(unsigned long, parent_ip, parent_ip)
12 ), 12 ),
13 TPRAWFMT(" %lx <-- %lx") 13 TP_RAW_FMT(" %lx <-- %lx")
14); 14);
15 15
16TRACE_EVENT_FORMAT(funcgraph_entry, TRACE_GRAPH_ENT, 16TRACE_EVENT_FORMAT(funcgraph_entry, TRACE_GRAPH_ENT,
@@ -19,7 +19,7 @@ TRACE_EVENT_FORMAT(funcgraph_entry, TRACE_GRAPH_ENT,
19 TRACE_FIELD(unsigned long, graph_ent.func, func) 19 TRACE_FIELD(unsigned long, graph_ent.func, func)
20 TRACE_FIELD(int, graph_ent.depth, depth) 20 TRACE_FIELD(int, graph_ent.depth, depth)
21 ), 21 ),
22 TPRAWFMT("--> %lx (%d)") 22 TP_RAW_FMT("--> %lx (%d)")
23); 23);
24 24
25TRACE_EVENT_FORMAT(funcgraph_exit, TRACE_GRAPH_RET, 25TRACE_EVENT_FORMAT(funcgraph_exit, TRACE_GRAPH_RET,
@@ -28,7 +28,7 @@ TRACE_EVENT_FORMAT(funcgraph_exit, TRACE_GRAPH_RET,
28 TRACE_FIELD(unsigned long, ret.func, func) 28 TRACE_FIELD(unsigned long, ret.func, func)
29 TRACE_FIELD(int, ret.depth, depth) 29 TRACE_FIELD(int, ret.depth, depth)
30 ), 30 ),
31 TPRAWFMT("<-- %lx (%d)") 31 TP_RAW_FMT("<-- %lx (%d)")
32); 32);
33 33
34TRACE_EVENT_FORMAT(wakeup, TRACE_WAKE, ctx_switch_entry, ignore, 34TRACE_EVENT_FORMAT(wakeup, TRACE_WAKE, ctx_switch_entry, ignore,
@@ -41,7 +41,7 @@ TRACE_EVENT_FORMAT(wakeup, TRACE_WAKE, ctx_switch_entry, ignore,
41 TRACE_FIELD(unsigned char, next_state, next_state) 41 TRACE_FIELD(unsigned char, next_state, next_state)
42 TRACE_FIELD(unsigned int, next_cpu, next_cpu) 42 TRACE_FIELD(unsigned int, next_cpu, next_cpu)
43 ), 43 ),
44 TPRAWFMT("%u:%u:%u ==+ %u:%u:%u [%03u]") 44 TP_RAW_FMT("%u:%u:%u ==+ %u:%u:%u [%03u]")
45); 45);
46 46
47TRACE_EVENT_FORMAT(context_switch, TRACE_CTX, ctx_switch_entry, ignore, 47TRACE_EVENT_FORMAT(context_switch, TRACE_CTX, ctx_switch_entry, ignore,
@@ -54,7 +54,7 @@ TRACE_EVENT_FORMAT(context_switch, TRACE_CTX, ctx_switch_entry, ignore,
54 TRACE_FIELD(unsigned char, next_state, next_state) 54 TRACE_FIELD(unsigned char, next_state, next_state)
55 TRACE_FIELD(unsigned int, next_cpu, next_cpu) 55 TRACE_FIELD(unsigned int, next_cpu, next_cpu)
56 ), 56 ),
57 TPRAWFMT("%u:%u:%u ==+ %u:%u:%u [%03u]") 57 TP_RAW_FMT("%u:%u:%u ==+ %u:%u:%u [%03u]")
58); 58);
59 59
60TRACE_EVENT_FORMAT(special, TRACE_SPECIAL, special_entry, ignore, 60TRACE_EVENT_FORMAT(special, TRACE_SPECIAL, special_entry, ignore,
@@ -63,7 +63,7 @@ TRACE_EVENT_FORMAT(special, TRACE_SPECIAL, special_entry, ignore,
63 TRACE_FIELD(unsigned long, arg2, arg2) 63 TRACE_FIELD(unsigned long, arg2, arg2)
64 TRACE_FIELD(unsigned long, arg3, arg3) 64 TRACE_FIELD(unsigned long, arg3, arg3)
65 ), 65 ),
66 TPRAWFMT("(%08lx) (%08lx) (%08lx)") 66 TP_RAW_FMT("(%08lx) (%08lx) (%08lx)")
67); 67);
68 68
69/* 69/*
@@ -83,7 +83,7 @@ TRACE_EVENT_FORMAT(kernel_stack, TRACE_STACK, stack_entry, ignore,
83 TRACE_FIELD(unsigned long, caller[6], stack6) 83 TRACE_FIELD(unsigned long, caller[6], stack6)
84 TRACE_FIELD(unsigned long, caller[7], stack7) 84 TRACE_FIELD(unsigned long, caller[7], stack7)
85 ), 85 ),
86 TPRAWFMT("\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n" 86 TP_RAW_FMT("\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n"
87 "\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n") 87 "\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n")
88); 88);
89 89
@@ -98,7 +98,7 @@ TRACE_EVENT_FORMAT(user_stack, TRACE_USER_STACK, userstack_entry, ignore,
98 TRACE_FIELD(unsigned long, caller[6], stack6) 98 TRACE_FIELD(unsigned long, caller[6], stack6)
99 TRACE_FIELD(unsigned long, caller[7], stack7) 99 TRACE_FIELD(unsigned long, caller[7], stack7)
100 ), 100 ),
101 TPRAWFMT("\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n" 101 TP_RAW_FMT("\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n"
102 "\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n") 102 "\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n\t=> (%08lx)\n")
103); 103);
104 104
@@ -108,7 +108,7 @@ TRACE_EVENT_FORMAT(print, TRACE_PRINT, print_entry, ignore,
108 TRACE_FIELD(unsigned int, depth, depth) 108 TRACE_FIELD(unsigned int, depth, depth)
109 TRACE_FIELD_ZERO_CHAR(buf) 109 TRACE_FIELD_ZERO_CHAR(buf)
110 ), 110 ),
111 TPRAWFMT("%08lx (%d) %s") 111 TP_RAW_FMT("%08lx (%d) %s")
112); 112);
113 113
114TRACE_EVENT_FORMAT(branch, TRACE_BRANCH, trace_branch, ignore, 114TRACE_EVENT_FORMAT(branch, TRACE_BRANCH, trace_branch, ignore,
@@ -118,7 +118,7 @@ TRACE_EVENT_FORMAT(branch, TRACE_BRANCH, trace_branch, ignore,
118 TRACE_FIELD_SPECIAL(char file[TRACE_FUNC_SIZE+1], file, file) 118 TRACE_FIELD_SPECIAL(char file[TRACE_FUNC_SIZE+1], file, file)
119 TRACE_FIELD(char, correct, correct) 119 TRACE_FIELD(char, correct, correct)
120 ), 120 ),
121 TPRAWFMT("%u:%s:%s (%u)") 121 TP_RAW_FMT("%u:%s:%s (%u)")
122); 122);
123 123
124TRACE_EVENT_FORMAT(hw_branch, TRACE_HW_BRANCHES, hw_branch_entry, ignore, 124TRACE_EVENT_FORMAT(hw_branch, TRACE_HW_BRANCHES, hw_branch_entry, ignore,
@@ -126,7 +126,7 @@ TRACE_EVENT_FORMAT(hw_branch, TRACE_HW_BRANCHES, hw_branch_entry, ignore,
126 TRACE_FIELD(u64, from, from) 126 TRACE_FIELD(u64, from, from)
127 TRACE_FIELD(u64, to, to) 127 TRACE_FIELD(u64, to, to)
128 ), 128 ),
129 TPRAWFMT("from: %llx to: %llx") 129 TP_RAW_FMT("from: %llx to: %llx")
130); 130);
131 131
132TRACE_EVENT_FORMAT(power, TRACE_POWER, trace_power, ignore, 132TRACE_EVENT_FORMAT(power, TRACE_POWER, trace_power, ignore,
@@ -136,7 +136,7 @@ TRACE_EVENT_FORMAT(power, TRACE_POWER, trace_power, ignore,
136 TRACE_FIELD(int, state_data.type, type) 136 TRACE_FIELD(int, state_data.type, type)
137 TRACE_FIELD(int, state_data.state, state) 137 TRACE_FIELD(int, state_data.state, state)
138 ), 138 ),
139 TPRAWFMT("%llx->%llx type:%u state:%u") 139 TP_RAW_FMT("%llx->%llx type:%u state:%u")
140); 140);
141 141
142TRACE_EVENT_FORMAT(kmem_alloc, TRACE_KMEM_ALLOC, kmemtrace_alloc_entry, ignore, 142TRACE_EVENT_FORMAT(kmem_alloc, TRACE_KMEM_ALLOC, kmemtrace_alloc_entry, ignore,
@@ -149,7 +149,7 @@ TRACE_EVENT_FORMAT(kmem_alloc, TRACE_KMEM_ALLOC, kmemtrace_alloc_entry, ignore,
149 TRACE_FIELD(gfp_t, gfp_flags, gfp_flags) 149 TRACE_FIELD(gfp_t, gfp_flags, gfp_flags)
150 TRACE_FIELD(int, node, node) 150 TRACE_FIELD(int, node, node)
151 ), 151 ),
152 TPRAWFMT("type:%u call_site:%lx ptr:%p req:%lu alloc:%lu" 152 TP_RAW_FMT("type:%u call_site:%lx ptr:%p req:%lu alloc:%lu"
153 " flags:%x node:%d") 153 " flags:%x node:%d")
154); 154);
155 155
@@ -159,7 +159,7 @@ TRACE_EVENT_FORMAT(kmem_free, TRACE_KMEM_FREE, kmemtrace_free_entry, ignore,
159 TRACE_FIELD(unsigned long, call_site, call_site) 159 TRACE_FIELD(unsigned long, call_site, call_site)
160 TRACE_FIELD(const void *, ptr, ptr) 160 TRACE_FIELD(const void *, ptr, ptr)
161 ), 161 ),
162 TPRAWFMT("type:%u call_site:%lx ptr:%p") 162 TP_RAW_FMT("type:%u call_site:%lx ptr:%p")
163); 163);
164 164
165#undef TRACE_SYSTEM 165#undef TRACE_SYSTEM
diff --git a/kernel/trace/trace_events_stage_2.h b/kernel/trace/trace_events_stage_2.h
index d24a97e74aea..8e2e0f56c2a8 100644
--- a/kernel/trace/trace_events_stage_2.h
+++ b/kernel/trace/trace_events_stage_2.h
@@ -20,7 +20,7 @@
20 * 20 *
21 * field = (typeof(field))entry; 21 * field = (typeof(field))entry;
22 * 22 *
23 * ret = trace_seq_printf(s, <TPRAWFMT> "%s", <ARGS> "\n"); 23 * ret = trace_seq_printf(s, <TP_RAW_FMT> "%s", <ARGS> "\n");
24 * if (!ret) 24 * if (!ret)
25 * return TRACE_TYPE_PARTIAL_LINE; 25 * return TRACE_TYPE_PARTIAL_LINE;
26 * 26 *
@@ -44,8 +44,8 @@
44 field->item, 44 field->item,
45 45
46 46
47#undef TPRAWFMT 47#undef TP_RAW_FMT
48#define TPRAWFMT(args...) args 48#define TP_RAW_FMT(args...) args
49 49
50#undef TRACE_EVENT_FORMAT 50#undef TRACE_EVENT_FORMAT
51#define TRACE_EVENT_FORMAT(call, proto, args, fmt, tstruct, tpfmt) \ 51#define TRACE_EVENT_FORMAT(call, proto, args, fmt, tstruct, tpfmt) \
diff --git a/kernel/trace/trace_events_stage_3.h b/kernel/trace/trace_events_stage_3.h
index 2c8d76c7dbed..557ca52bcdcd 100644
--- a/kernel/trace/trace_events_stage_3.h
+++ b/kernel/trace/trace_events_stage_3.h
@@ -106,8 +106,8 @@
106 * 106 *
107 */ 107 */
108 108
109#undef TPFMT 109#undef TP_FMT
110#define TPFMT(fmt, args...) fmt "\n", ##args 110#define TP_FMT(fmt, args...) fmt "\n", ##args
111 111
112#define _TRACE_FORMAT(call, proto, args, fmt) \ 112#define _TRACE_FORMAT(call, proto, args, fmt) \
113static void ftrace_event_##call(proto) \ 113static void ftrace_event_##call(proto) \
@@ -152,8 +152,8 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
152#define TRACE_FIELD(type, item, assign)\ 152#define TRACE_FIELD(type, item, assign)\
153 entry->item = assign; 153 entry->item = assign;
154 154
155#undef TPCMD 155#undef TP_CMD
156#define TPCMD(cmd...) cmd 156#define TP_CMD(cmd...) cmd
157 157
158#undef TRACE_ENTRY 158#undef TRACE_ENTRY
159#define TRACE_ENTRY entry 159#define TRACE_ENTRY entry
diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c
index 7162ab49d05d..e62bc10f8103 100644
--- a/kernel/trace/trace_export.c
+++ b/kernel/trace/trace_export.c
@@ -26,8 +26,8 @@
26 return 0; 26 return 0;
27 27
28 28
29#undef TPRAWFMT 29#undef TP_RAW_FMT
30#define TPRAWFMT(args...) args 30#define TP_RAW_FMT(args...) args
31 31
32#undef TRACE_EVENT_FORMAT 32#undef TRACE_EVENT_FORMAT
33#define TRACE_EVENT_FORMAT(call, proto, args, fmt, tstruct, tpfmt) \ 33#define TRACE_EVENT_FORMAT(call, proto, args, fmt, tstruct, tpfmt) \
@@ -57,8 +57,8 @@ ftrace_format_##call(struct trace_seq *s) \
57#define TRACE_FIELD(type, item, assign)\ 57#define TRACE_FIELD(type, item, assign)\
58 entry->item = assign; 58 entry->item = assign;
59 59
60#undef TPCMD 60#undef TP_CMD
61#define TPCMD(cmd...) cmd 61#define TP_CMD(cmd...) cmd
62 62
63#undef TRACE_ENTRY 63#undef TRACE_ENTRY
64#define TRACE_ENTRY entry 64#define TRACE_ENTRY entry
diff --git a/kernel/trace/trace_format.h b/kernel/trace/trace_format.h
deleted file mode 100644
index 97e59a9c82ea..000000000000
--- a/kernel/trace/trace_format.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * Setup the showing format of trace point.
3 *
4 * int
5 * ftrace_format_##call(struct trace_seq *s)
6 * {
7 * struct ftrace_raw_##call field;
8 * int ret;
9 *
10 * ret = trace_seq_printf(s, #type " " #item ";"
11 * " size:%d; offset:%d;\n",
12 * sizeof(field.type),
13 * offsetof(struct ftrace_raw_##call,
14 * item));
15 *
16 * }
17 */
18
19#undef TRACE_STRUCT
20#define TRACE_STRUCT(args...) args
21
22#undef TRACE_FIELD
23#define TRACE_FIELD(type, item, assign) \
24 ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \
25 "offset:%u;\tsize:%u;\n", \
26 (unsigned int)offsetof(typeof(field), item), \
27 (unsigned int)sizeof(field.item)); \
28 if (!ret) \
29 return 0;
30
31
32#undef TRACE_FIELD_SPECIAL
33#define TRACE_FIELD_SPECIAL(type_item, item, cmd) \
34 ret = trace_seq_printf(s, "\tfield special:" #type_item ";\t" \
35 "offset:%u;\tsize:%u;\n", \
36 (unsigned int)offsetof(typeof(field), item), \
37 (unsigned int)sizeof(field.item)); \
38 if (!ret) \
39 return 0;
40
41#undef TRACE_EVENT_FORMAT
42#define TRACE_EVENT_FORMAT(call, proto, args, fmt, tstruct, tpfmt) \
43static int \
44ftrace_format_##call(struct trace_seq *s) \
45{ \
46 struct ftrace_raw_##call field; \
47 int ret; \
48 \
49 tstruct; \
50 \
51 trace_seq_printf(s, "\nprint fmt: \"%s\"\n", tpfmt); \
52 \
53 return ret; \
54}
55
diff --git a/samples/tracepoints/tp-samples-trace.h b/samples/tracepoints/tp-samples-trace.h
index 01724e04c556..dffdc49878af 100644
--- a/samples/tracepoints/tp-samples-trace.h
+++ b/samples/tracepoints/tp-samples-trace.h
@@ -5,9 +5,9 @@
5#include <linux/tracepoint.h> 5#include <linux/tracepoint.h>
6 6
7DECLARE_TRACE(subsys_event, 7DECLARE_TRACE(subsys_event,
8 TPPROTO(struct inode *inode, struct file *file), 8 TP_PROTO(struct inode *inode, struct file *file),
9 TPARGS(inode, file)); 9 TP_ARGS(inode, file));
10DECLARE_TRACE(subsys_eventb, 10DECLARE_TRACE(subsys_eventb,
11 TPPROTO(void), 11 TP_PROTO(void),
12 TPARGS()); 12 TP_ARGS());
13#endif 13#endif