summaryrefslogtreecommitdiff
path: root/include/trace
diff options
context:
space:
mode:
authorArun Bharadwaj <abharadw@codeaurora.org>2013-06-19 16:55:29 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 19:58:34 -0700
commit9f6eb26ae8f49eba60d5aaf10affdc28fd42608c (patch)
treebb83d53a3750a9ee50b940410e7f26d85604194b /include/trace
parent0ec4cf2484ad5860d84dda1aef44dc35e7c2a81d (diff)
tracing/sched: Track per-cpu rt and non-rt cpu_load.
Add a new tracepoint trace_sched_enq_deq_task to track per-cpu rt and non-rt cpu_load during task enqueue and dequeue. This is useful to visualize and compare the load on different cpus and also to understand how balanced the load is at any point of time. Note: We only print cpu_load[0] because we only care about the most recent load history for tracking load balancer effectiveness. Change-Id: I46f0bb84e81652099ed5edf8c2686c70c8b8330c Signed-off-by: Arun Bharadwaj <abharadw@codeaurora.org>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/sched.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index d34eba74af27..f6ce9e64c46c 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -51,6 +51,44 @@ TRACE_EVENT(sched_kthread_stop_ret,
);
/*
+ * Tracepoint for task enqueue/dequeue:
+ */
+TRACE_EVENT(sched_enq_deq_task,
+
+ TP_PROTO(struct task_struct *p, int enqueue),
+
+ TP_ARGS(p, enqueue),
+
+ TP_STRUCT__entry(
+ __array( char, comm, TASK_COMM_LEN )
+ __field( pid_t, pid )
+ __field( int, prio )
+ __field( int, cpu )
+ __field( int, enqueue )
+ __field(unsigned int, nr_running )
+ __field(unsigned long, cpu_load )
+ __field(unsigned int, rt_nr_running )
+ ),
+
+ TP_fast_assign(
+ memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
+ __entry->pid = p->pid;
+ __entry->prio = p->prio;
+ __entry->cpu = task_cpu(p);
+ __entry->enqueue = enqueue;
+ __entry->nr_running = task_rq(p)->nr_running;
+ __entry->cpu_load = task_rq(p)->cpu_load[0];
+ __entry->rt_nr_running = task_rq(p)->rt.rt_nr_running;
+ ),
+
+ TP_printk("cpu=%d %s comm=%s pid=%d prio=%d nr_running=%u cpu_load=%lu rt_nr_running=%u",
+ __entry->cpu, __entry->enqueue ? "enqueue" : "dequeue",
+ __entry->comm, __entry->pid,
+ __entry->prio, __entry->nr_running,
+ __entry->cpu_load, __entry->rt_nr_running)
+);
+
+/*
* Tracepoint for waking up a task:
*/
DECLARE_EVENT_CLASS(sched_wakeup_template,