Skip to content

Commit

Permalink
Merge branch 'tip/tracing/ftrace' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/kernel/git/rostedt/linux-2.6-trace into tracing/ftrace
  • Loading branch information
Ingo Molnar committed Mar 10, 2009
2 parents 12e87e3 + 157587d commit 9a1043d
Show file tree
Hide file tree
Showing 19 changed files with 575 additions and 537 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
10 changes: 5 additions & 5 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 Expand Up @@ -157,7 +157,7 @@ static inline void tracepoint_synchronize_unregister(void)
#define TRACE_FORMAT(name, proto, args, fmt) \
DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))

#define TRACE_EVENT_FORMAT(name, proto, args, fmt, struct, tpfmt) \
TRACE_FORMAT(name, PARAMS(proto), PARAMS(args), PARAMS(fmt))
#define TRACE_EVENT(name, proto, args, struct, print, assign) \
DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))

#endif
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
46 changes: 28 additions & 18 deletions include/trace/irq_event_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,36 @@
#undef TRACE_SYSTEM
#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),
TRACE_STRUCT(
TRACE_FIELD(int, irq, irq)
),
TPRAWFMT("irq %d")
/*
* Tracepoint for entry of interrupt handler:
*/
TRACE_FORMAT(irq_handler_entry,
TP_PROTO(int irq, struct irqaction *action),
TP_ARGS(irq, action),
TP_FMT("irq=%d handler=%s", irq, action->name)
);

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",
irq, action->name, ret ? "handled" : "unhandled"),
TRACE_STRUCT(
TRACE_FIELD(int, irq, irq)
TRACE_FIELD(int, ret, ret)
/*
* Tracepoint for return of an interrupt handler:
*/
TRACE_EVENT(irq_handler_exit,

TP_PROTO(int irq, struct irqaction *action, int ret),

TP_ARGS(irq, action, ret),

TP_STRUCT__entry(
__field( int, irq )
__field( int, ret )
),
TPRAWFMT("irq %d ret %d")
);

TP_printk("irq=%d return=%s",
__entry->irq, __entry->ret ? "handled" : "unhandled"),

TP_fast_assign(
__entry->irq = irq;
__entry->ret = ret;
)
);

#undef TRACE_SYSTEM
26 changes: 13 additions & 13 deletions include/trace/lockdep_event_types.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#ifndef TRACE_EVENT_FORMAT
#ifndef TRACE_FORMAT
# error Do not include this file directly.
# error Unless you know what you are doing.
#endif
Expand All @@ -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 9a1043d

Please sign in to comment.