diff options
Diffstat (limited to 'include/trace')
| -rw-r--r-- | include/trace/block.h | 76 | ||||
| -rw-r--r-- | include/trace/boot.h | 60 | ||||
| -rw-r--r-- | include/trace/sched.h | 24 |
3 files changed, 148 insertions, 12 deletions
diff --git a/include/trace/block.h b/include/trace/block.h new file mode 100644 index 000000000000..25c6a1fd5b77 --- /dev/null +++ b/include/trace/block.h | |||
| @@ -0,0 +1,76 @@ | |||
| 1 | #ifndef _TRACE_BLOCK_H | ||
| 2 | #define _TRACE_BLOCK_H | ||
| 3 | |||
| 4 | #include <linux/blkdev.h> | ||
| 5 | #include <linux/tracepoint.h> | ||
| 6 | |||
| 7 | DECLARE_TRACE(block_rq_abort, | ||
| 8 | TPPROTO(struct request_queue *q, struct request *rq), | ||
| 9 | TPARGS(q, rq)); | ||
| 10 | |||
| 11 | DECLARE_TRACE(block_rq_insert, | ||
| 12 | TPPROTO(struct request_queue *q, struct request *rq), | ||
| 13 | TPARGS(q, rq)); | ||
| 14 | |||
| 15 | DECLARE_TRACE(block_rq_issue, | ||
| 16 | TPPROTO(struct request_queue *q, struct request *rq), | ||
| 17 | TPARGS(q, rq)); | ||
| 18 | |||
| 19 | DECLARE_TRACE(block_rq_requeue, | ||
| 20 | TPPROTO(struct request_queue *q, struct request *rq), | ||
| 21 | TPARGS(q, rq)); | ||
| 22 | |||
| 23 | DECLARE_TRACE(block_rq_complete, | ||
| 24 | TPPROTO(struct request_queue *q, struct request *rq), | ||
| 25 | TPARGS(q, rq)); | ||
| 26 | |||
| 27 | DECLARE_TRACE(block_bio_bounce, | ||
| 28 | TPPROTO(struct request_queue *q, struct bio *bio), | ||
| 29 | TPARGS(q, bio)); | ||
| 30 | |||
| 31 | DECLARE_TRACE(block_bio_complete, | ||
| 32 | TPPROTO(struct request_queue *q, struct bio *bio), | ||
| 33 | TPARGS(q, bio)); | ||
| 34 | |||
| 35 | DECLARE_TRACE(block_bio_backmerge, | ||
| 36 | TPPROTO(struct request_queue *q, struct bio *bio), | ||
| 37 | TPARGS(q, bio)); | ||
| 38 | |||
| 39 | DECLARE_TRACE(block_bio_frontmerge, | ||
| 40 | TPPROTO(struct request_queue *q, struct bio *bio), | ||
| 41 | TPARGS(q, bio)); | ||
| 42 | |||
| 43 | DECLARE_TRACE(block_bio_queue, | ||
| 44 | TPPROTO(struct request_queue *q, struct bio *bio), | ||
| 45 | TPARGS(q, bio)); | ||
| 46 | |||
| 47 | DECLARE_TRACE(block_getrq, | ||
| 48 | TPPROTO(struct request_queue *q, struct bio *bio, int rw), | ||
| 49 | TPARGS(q, bio, rw)); | ||
| 50 | |||
| 51 | DECLARE_TRACE(block_sleeprq, | ||
| 52 | TPPROTO(struct request_queue *q, struct bio *bio, int rw), | ||
| 53 | TPARGS(q, bio, rw)); | ||
| 54 | |||
| 55 | DECLARE_TRACE(block_plug, | ||
| 56 | TPPROTO(struct request_queue *q), | ||
| 57 | TPARGS(q)); | ||
| 58 | |||
| 59 | DECLARE_TRACE(block_unplug_timer, | ||
| 60 | TPPROTO(struct request_queue *q), | ||
| 61 | TPARGS(q)); | ||
| 62 | |||
| 63 | DECLARE_TRACE(block_unplug_io, | ||
| 64 | TPPROTO(struct request_queue *q), | ||
| 65 | TPARGS(q)); | ||
| 66 | |||
| 67 | DECLARE_TRACE(block_split, | ||
| 68 | TPPROTO(struct request_queue *q, struct bio *bio, unsigned int pdu), | ||
| 69 | TPARGS(q, bio, pdu)); | ||
| 70 | |||
| 71 | DECLARE_TRACE(block_remap, | ||
| 72 | TPPROTO(struct request_queue *q, struct bio *bio, dev_t dev, | ||
| 73 | sector_t from, sector_t to), | ||
| 74 | TPARGS(q, bio, dev, from, to)); | ||
| 75 | |||
| 76 | #endif | ||
diff --git a/include/trace/boot.h b/include/trace/boot.h new file mode 100644 index 000000000000..088ea089e31d --- /dev/null +++ b/include/trace/boot.h | |||
| @@ -0,0 +1,60 @@ | |||
| 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/sched.h b/include/trace/sched.h index ad47369d01b5..9b2854abf7e2 100644 --- a/include/trace/sched.h +++ b/include/trace/sched.h | |||
| @@ -4,52 +4,52 @@ | |||
| 4 | #include <linux/sched.h> | 4 | #include <linux/sched.h> |
| 5 | #include <linux/tracepoint.h> | 5 | #include <linux/tracepoint.h> |
| 6 | 6 | ||
| 7 | DEFINE_TRACE(sched_kthread_stop, | 7 | DECLARE_TRACE(sched_kthread_stop, |
| 8 | TPPROTO(struct task_struct *t), | 8 | TPPROTO(struct task_struct *t), |
| 9 | TPARGS(t)); | 9 | TPARGS(t)); |
| 10 | 10 | ||
| 11 | DEFINE_TRACE(sched_kthread_stop_ret, | 11 | DECLARE_TRACE(sched_kthread_stop_ret, |
| 12 | TPPROTO(int ret), | 12 | TPPROTO(int ret), |
| 13 | TPARGS(ret)); | 13 | TPARGS(ret)); |
| 14 | 14 | ||
| 15 | DEFINE_TRACE(sched_wait_task, | 15 | DECLARE_TRACE(sched_wait_task, |
| 16 | TPPROTO(struct rq *rq, struct task_struct *p), | 16 | TPPROTO(struct rq *rq, struct task_struct *p), |
| 17 | TPARGS(rq, p)); | 17 | TPARGS(rq, p)); |
| 18 | 18 | ||
| 19 | DEFINE_TRACE(sched_wakeup, | 19 | DECLARE_TRACE(sched_wakeup, |
| 20 | TPPROTO(struct rq *rq, struct task_struct *p), | 20 | TPPROTO(struct rq *rq, struct task_struct *p), |
| 21 | TPARGS(rq, p)); | 21 | TPARGS(rq, p)); |
| 22 | 22 | ||
| 23 | DEFINE_TRACE(sched_wakeup_new, | 23 | DECLARE_TRACE(sched_wakeup_new, |
| 24 | TPPROTO(struct rq *rq, struct task_struct *p), | 24 | TPPROTO(struct rq *rq, struct task_struct *p), |
| 25 | TPARGS(rq, p)); | 25 | TPARGS(rq, p)); |
| 26 | 26 | ||
| 27 | DEFINE_TRACE(sched_switch, | 27 | DECLARE_TRACE(sched_switch, |
| 28 | TPPROTO(struct rq *rq, struct task_struct *prev, | 28 | TPPROTO(struct rq *rq, struct task_struct *prev, |
| 29 | struct task_struct *next), | 29 | struct task_struct *next), |
| 30 | TPARGS(rq, prev, next)); | 30 | TPARGS(rq, prev, next)); |
| 31 | 31 | ||
| 32 | DEFINE_TRACE(sched_migrate_task, | 32 | DECLARE_TRACE(sched_migrate_task, |
| 33 | TPPROTO(struct rq *rq, struct task_struct *p, int dest_cpu), | 33 | TPPROTO(struct rq *rq, struct task_struct *p, int dest_cpu), |
| 34 | TPARGS(rq, p, dest_cpu)); | 34 | TPARGS(rq, p, dest_cpu)); |
| 35 | 35 | ||
| 36 | DEFINE_TRACE(sched_process_free, | 36 | DECLARE_TRACE(sched_process_free, |
| 37 | TPPROTO(struct task_struct *p), | 37 | TPPROTO(struct task_struct *p), |
| 38 | TPARGS(p)); | 38 | TPARGS(p)); |
| 39 | 39 | ||
| 40 | DEFINE_TRACE(sched_process_exit, | 40 | DECLARE_TRACE(sched_process_exit, |
| 41 | TPPROTO(struct task_struct *p), | 41 | TPPROTO(struct task_struct *p), |
| 42 | TPARGS(p)); | 42 | TPARGS(p)); |
| 43 | 43 | ||
| 44 | DEFINE_TRACE(sched_process_wait, | 44 | DECLARE_TRACE(sched_process_wait, |
| 45 | TPPROTO(struct pid *pid), | 45 | TPPROTO(struct pid *pid), |
| 46 | TPARGS(pid)); | 46 | TPARGS(pid)); |
| 47 | 47 | ||
| 48 | DEFINE_TRACE(sched_process_fork, | 48 | DECLARE_TRACE(sched_process_fork, |
| 49 | TPPROTO(struct task_struct *parent, struct task_struct *child), | 49 | TPPROTO(struct task_struct *parent, struct task_struct *child), |
| 50 | TPARGS(parent, child)); | 50 | TPARGS(parent, child)); |
| 51 | 51 | ||
| 52 | DEFINE_TRACE(sched_signal_send, | 52 | DECLARE_TRACE(sched_signal_send, |
| 53 | TPPROTO(int sig, struct task_struct *p), | 53 | TPPROTO(int sig, struct task_struct *p), |
| 54 | TPARGS(sig, p)); | 54 | TPARGS(sig, p)); |
| 55 | 55 | ||
