Skip to content

Commit

Permalink
tracing: replace TP<var> with TP_<var>
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Steven Rostedt committed Mar 10, 2009
1 parent 156b5f1 commit 2939b04
Show file tree
Hide file tree
Showing 14 changed files with 154 additions and 209 deletions.
8 changes: 4 additions & 4 deletions Documentation/tracepoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ In include/trace/subsys.h :
#include <linux/tracepoint.h>

DECLARE_TRACE(subsys_eventname,
TPPROTO(int firstarg, struct task_struct *p),
TPARGS(firstarg, p));
TP_PROTO(int firstarg, struct task_struct *p),
TP_ARGS(firstarg, p));

In subsys/file.c (where the tracing statement must be added) :

Expand All @@ -66,10 +66,10 @@ Where :
- subsys is the name of your subsystem.
- eventname is the name of the event to trace.

- TPPROTO(int firstarg, struct task_struct *p) is the prototype of the
- TP_PROTO(int firstarg, struct task_struct *p) is the prototype of the
function called by this tracepoint.

- TPARGS(firstarg, p) are the parameters names, same as found in the
- TP_ARGS(firstarg, p) are the parameters names, same as found in the
prototype.

Connecting a function (probe) to a tracepoint is done by providing a
Expand Down
6 changes: 3 additions & 3 deletions include/linux/tracepoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ struct tracepoint {
* Keep in sync with vmlinux.lds.h.
*/

#define TPPROTO(args...) args
#define TPARGS(args...) args
#define TP_PROTO(args...) args
#define TP_ARGS(args...) args

#ifdef CONFIG_TRACEPOINTS

Expand Down Expand Up @@ -65,7 +65,7 @@ struct tracepoint {
{ \
if (unlikely(__tracepoint_##name.state)) \
__DO_TRACE(&__tracepoint_##name, \
TPPROTO(proto), TPARGS(args)); \
TP_PROTO(proto), TP_ARGS(args)); \
} \
static inline int register_trace_##name(void (*probe)(proto)) \
{ \
Expand Down
70 changes: 35 additions & 35 deletions include/trace/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,72 +5,72 @@
#include <linux/tracepoint.h>

DECLARE_TRACE(block_rq_abort,
TPPROTO(struct request_queue *q, struct request *rq),
TPARGS(q, rq));
TP_PROTO(struct request_queue *q, struct request *rq),
TP_ARGS(q, rq));

DECLARE_TRACE(block_rq_insert,
TPPROTO(struct request_queue *q, struct request *rq),
TPARGS(q, rq));
TP_PROTO(struct request_queue *q, struct request *rq),
TP_ARGS(q, rq));

DECLARE_TRACE(block_rq_issue,
TPPROTO(struct request_queue *q, struct request *rq),
TPARGS(q, rq));
TP_PROTO(struct request_queue *q, struct request *rq),
TP_ARGS(q, rq));

DECLARE_TRACE(block_rq_requeue,
TPPROTO(struct request_queue *q, struct request *rq),
TPARGS(q, rq));
TP_PROTO(struct request_queue *q, struct request *rq),
TP_ARGS(q, rq));

DECLARE_TRACE(block_rq_complete,
TPPROTO(struct request_queue *q, struct request *rq),
TPARGS(q, rq));
TP_PROTO(struct request_queue *q, struct request *rq),
TP_ARGS(q, rq));

DECLARE_TRACE(block_bio_bounce,
TPPROTO(struct request_queue *q, struct bio *bio),
TPARGS(q, bio));
TP_PROTO(struct request_queue *q, struct bio *bio),
TP_ARGS(q, bio));

DECLARE_TRACE(block_bio_complete,
TPPROTO(struct request_queue *q, struct bio *bio),
TPARGS(q, bio));
TP_PROTO(struct request_queue *q, struct bio *bio),
TP_ARGS(q, bio));

DECLARE_TRACE(block_bio_backmerge,
TPPROTO(struct request_queue *q, struct bio *bio),
TPARGS(q, bio));
TP_PROTO(struct request_queue *q, struct bio *bio),
TP_ARGS(q, bio));

DECLARE_TRACE(block_bio_frontmerge,
TPPROTO(struct request_queue *q, struct bio *bio),
TPARGS(q, bio));
TP_PROTO(struct request_queue *q, struct bio *bio),
TP_ARGS(q, bio));

DECLARE_TRACE(block_bio_queue,
TPPROTO(struct request_queue *q, struct bio *bio),
TPARGS(q, bio));
TP_PROTO(struct request_queue *q, struct bio *bio),
TP_ARGS(q, bio));

DECLARE_TRACE(block_getrq,
TPPROTO(struct request_queue *q, struct bio *bio, int rw),
TPARGS(q, bio, rw));
TP_PROTO(struct request_queue *q, struct bio *bio, int rw),
TP_ARGS(q, bio, rw));

DECLARE_TRACE(block_sleeprq,
TPPROTO(struct request_queue *q, struct bio *bio, int rw),
TPARGS(q, bio, rw));
TP_PROTO(struct request_queue *q, struct bio *bio, int rw),
TP_ARGS(q, bio, rw));

DECLARE_TRACE(block_plug,
TPPROTO(struct request_queue *q),
TPARGS(q));
TP_PROTO(struct request_queue *q),
TP_ARGS(q));

DECLARE_TRACE(block_unplug_timer,
TPPROTO(struct request_queue *q),
TPARGS(q));
TP_PROTO(struct request_queue *q),
TP_ARGS(q));

DECLARE_TRACE(block_unplug_io,
TPPROTO(struct request_queue *q),
TPARGS(q));
TP_PROTO(struct request_queue *q),
TP_ARGS(q));

DECLARE_TRACE(block_split,
TPPROTO(struct request_queue *q, struct bio *bio, unsigned int pdu),
TPARGS(q, bio, pdu));
TP_PROTO(struct request_queue *q, struct bio *bio, unsigned int pdu),
TP_ARGS(q, bio, pdu));

DECLARE_TRACE(block_remap,
TPPROTO(struct request_queue *q, struct bio *bio, dev_t dev,
sector_t from, sector_t to),
TPARGS(q, bio, dev, from, to));
TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev,
sector_t from, sector_t to),
TP_ARGS(q, bio, dev, from, to));

#endif
16 changes: 8 additions & 8 deletions include/trace/irq_event_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@
#define TRACE_SYSTEM irq

TRACE_EVENT_FORMAT(irq_handler_entry,
TPPROTO(int irq, struct irqaction *action),
TPARGS(irq, action),
TPFMT("irq=%d handler=%s", irq, action->name),
TP_PROTO(int irq, struct irqaction *action),
TP_ARGS(irq, action),
TP_FMT("irq=%d handler=%s", irq, action->name),
TRACE_STRUCT(
TRACE_FIELD(int, irq, irq)
),
TPRAWFMT("irq %d")
TP_RAW_FMT("irq %d")
);

TRACE_EVENT_FORMAT(irq_handler_exit,
TPPROTO(int irq, struct irqaction *action, int ret),
TPARGS(irq, action, ret),
TPFMT("irq=%d handler=%s return=%s",
TP_PROTO(int irq, struct irqaction *action, int ret),
TP_ARGS(irq, action, ret),
TP_FMT("irq=%d handler=%s return=%s",
irq, action->name, ret ? "handled" : "unhandled"),
TRACE_STRUCT(
TRACE_FIELD(int, irq, irq)
TRACE_FIELD(int, ret, ret)
),
TPRAWFMT("irq %d ret %d")
TP_RAW_FMT("irq %d ret %d")
);

#undef TRACE_SYSTEM
24 changes: 12 additions & 12 deletions include/trace/lockdep_event_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,32 @@
#ifdef CONFIG_LOCKDEP

TRACE_FORMAT(lock_acquire,
TPPROTO(struct lockdep_map *lock, unsigned int subclass,
TP_PROTO(struct lockdep_map *lock, unsigned int subclass,
int trylock, int read, int check,
struct lockdep_map *next_lock, unsigned long ip),
TPARGS(lock, subclass, trylock, read, check, next_lock, ip),
TPFMT("%s%s%s", trylock ? "try " : "",
TP_ARGS(lock, subclass, trylock, read, check, next_lock, ip),
TP_FMT("%s%s%s", trylock ? "try " : "",
read ? "read " : "", lock->name)
);

TRACE_FORMAT(lock_release,
TPPROTO(struct lockdep_map *lock, int nested, unsigned long ip),
TPARGS(lock, nested, ip),
TPFMT("%s", lock->name)
TP_PROTO(struct lockdep_map *lock, int nested, unsigned long ip),
TP_ARGS(lock, nested, ip),
TP_FMT("%s", lock->name)
);

#ifdef CONFIG_LOCK_STAT

TRACE_FORMAT(lock_contended,
TPPROTO(struct lockdep_map *lock, unsigned long ip),
TPARGS(lock, ip),
TPFMT("%s", lock->name)
TP_PROTO(struct lockdep_map *lock, unsigned long ip),
TP_ARGS(lock, ip),
TP_FMT("%s", lock->name)
);

TRACE_FORMAT(lock_acquired,
TPPROTO(struct lockdep_map *lock, unsigned long ip),
TPARGS(lock, ip),
TPFMT("%s", lock->name)
TP_PROTO(struct lockdep_map *lock, unsigned long ip),
TP_ARGS(lock, ip),
TP_FMT("%s", lock->name)
);

#endif
Expand Down
12 changes: 6 additions & 6 deletions include/trace/power.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ struct power_trace {
};

DECLARE_TRACE(power_start,
TPPROTO(struct power_trace *it, unsigned int type, unsigned int state),
TPARGS(it, type, state));
TP_PROTO(struct power_trace *it, unsigned int type, unsigned int state),
TP_ARGS(it, type, state));

DECLARE_TRACE(power_mark,
TPPROTO(struct power_trace *it, unsigned int type, unsigned int state),
TPARGS(it, type, state));
TP_PROTO(struct power_trace *it, unsigned int type, unsigned int state),
TP_ARGS(it, type, state));

DECLARE_TRACE(power_end,
TPPROTO(struct power_trace *it),
TPARGS(it));
TP_PROTO(struct power_trace *it),
TP_ARGS(it));

#endif /* _TRACE_POWER_H */
Loading

0 comments on commit 2939b04

Please sign in to comment.