diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/tracepoint.h | 3 | ||||
| -rw-r--r-- | include/trace/sched_event_types.h | 48 |
2 files changed, 35 insertions, 16 deletions
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 3bcc3e171443..6b4f1bb3701e 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
| @@ -160,4 +160,7 @@ static inline void tracepoint_synchronize_unregister(void) | |||
| 160 | #define TRACE_EVENT_FORMAT(name, proto, args, fmt, struct, tpfmt) \ | 160 | #define TRACE_EVENT_FORMAT(name, proto, args, fmt, struct, tpfmt) \ |
| 161 | TRACE_FORMAT(name, PARAMS(proto), PARAMS(args), PARAMS(fmt)) | 161 | TRACE_FORMAT(name, PARAMS(proto), PARAMS(args), PARAMS(fmt)) |
| 162 | 162 | ||
| 163 | #define TRACE_EVENT(name, proto, args, struct, print, assign) \ | ||
| 164 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | ||
| 165 | |||
| 163 | #endif | 166 | #endif |
diff --git a/include/trace/sched_event_types.h b/include/trace/sched_event_types.h index 71b14828a957..aa77fb754038 100644 --- a/include/trace/sched_event_types.h +++ b/include/trace/sched_event_types.h | |||
| @@ -62,25 +62,41 @@ TRACE_EVENT_FORMAT(sched_wakeup_new, | |||
| 62 | TP_RAW_FMT("task %d success=%d") | 62 | TP_RAW_FMT("task %d success=%d") |
| 63 | ); | 63 | ); |
| 64 | 64 | ||
| 65 | TRACE_EVENT_FORMAT(sched_switch, | 65 | /* |
| 66 | * Tracepoint for task switches, performed by the scheduler: | ||
| 67 | * | ||
| 68 | * (NOTE: the 'rq' argument is not used by generic trace events, | ||
| 69 | * but used by the latency tracer plugin. ) | ||
| 70 | */ | ||
| 71 | TRACE_EVENT(sched_switch, | ||
| 72 | |||
| 66 | TP_PROTO(struct rq *rq, struct task_struct *prev, | 73 | TP_PROTO(struct rq *rq, struct task_struct *prev, |
| 67 | struct task_struct *next), | 74 | struct task_struct *next), |
| 75 | |||
| 68 | TP_ARGS(rq, prev, next), | 76 | TP_ARGS(rq, prev, next), |
| 69 | TP_FMT("task %s:%d ==> %s:%d", | 77 | |
| 70 | prev->comm, prev->pid, next->comm, next->pid), | 78 | TP_STRUCT__entry( |
| 71 | TRACE_STRUCT( | 79 | __array( char, prev_comm, TASK_COMM_LEN ) |
| 72 | TRACE_FIELD(pid_t, prev_pid, prev->pid) | 80 | __field( pid_t, prev_pid ) |
| 73 | TRACE_FIELD(int, prev_prio, prev->prio) | 81 | __field( int, prev_prio ) |
| 74 | TRACE_FIELD_SPECIAL(char next_comm[TASK_COMM_LEN], | 82 | __array( char, next_comm, TASK_COMM_LEN ) |
| 75 | next_comm, | 83 | __field( pid_t, next_pid ) |
| 76 | TP_CMD(memcpy(TRACE_ENTRY->next_comm, | 84 | __field( int, next_prio ) |
| 77 | next->comm, | ||
| 78 | TASK_COMM_LEN))) | ||
| 79 | TRACE_FIELD(pid_t, next_pid, next->pid) | ||
| 80 | TRACE_FIELD(int, next_prio, next->prio) | ||
| 81 | ), | 85 | ), |
| 82 | TP_RAW_FMT("prev %d:%d ==> next %s:%d:%d") | 86 | |
| 83 | ); | 87 | TP_printk("task %s:%d [%d] ==> %s:%d [%d]", |
| 88 | __entry->prev_comm, __entry->prev_pid, __entry->prev_prio, | ||
| 89 | __entry->next_comm, __entry->next_pid, __entry->next_prio), | ||
| 90 | |||
| 91 | TP_fast_assign( | ||
| 92 | memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN); | ||
| 93 | __entry->prev_pid = prev->pid; | ||
| 94 | __entry->prev_prio = prev->prio; | ||
| 95 | memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN); | ||
| 96 | __entry->next_pid = next->pid; | ||
| 97 | __entry->next_prio = next->prio; | ||
| 98 | ) | ||
| 99 | ); | ||
| 84 | 100 | ||
| 85 | TRACE_EVENT_FORMAT(sched_migrate_task, | 101 | TRACE_EVENT_FORMAT(sched_migrate_task, |
| 86 | TP_PROTO(struct task_struct *p, int orig_cpu, int dest_cpu), | 102 | TP_PROTO(struct task_struct *p, int orig_cpu, int dest_cpu), |
