mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-26 06:33:19 -04:00
sched: Add sched_enq_deq_task trace point
To debug issues related to task scheduling sched_enq_deq_task trace point is very useful. Change-Id: I668702701d5443a4f5b0356634622f071297eb28 Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
This commit is contained in:
parent
64b577b9cc
commit
8573d7bfaa
2 changed files with 48 additions and 0 deletions
|
|
@ -51,6 +51,52 @@ TRACE_EVENT(sched_kthread_stop_ret,
|
|||
TP_printk("ret=%d", __entry->ret)
|
||||
);
|
||||
|
||||
/*
|
||||
* Tracepoint for task enqueue/dequeue:
|
||||
*/
|
||||
TRACE_EVENT(sched_enq_deq_task,
|
||||
|
||||
TP_PROTO(struct task_struct *p, bool enqueue,
|
||||
unsigned int cpus_allowed),
|
||||
|
||||
TP_ARGS(p, enqueue, cpus_allowed),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__array(char, comm, TASK_COMM_LEN)
|
||||
__field(pid_t, pid)
|
||||
__field(int, prio)
|
||||
__field(int, cpu)
|
||||
__field(bool, enqueue)
|
||||
__field(unsigned int, nr_running)
|
||||
__field(unsigned int, rt_nr_running)
|
||||
__field(unsigned int, cpus_allowed)
|
||||
__field(unsigned int, demand)
|
||||
__field(unsigned int, pred_demand)
|
||||
),
|
||||
|
||||
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->rt_nr_running = task_rq(p)->rt.rt_nr_running;
|
||||
__entry->cpus_allowed = cpus_allowed;
|
||||
__entry->demand = task_load(p);
|
||||
__entry->pred_demand = task_pl(p);
|
||||
),
|
||||
|
||||
TP_printk("cpu=%d %s comm=%s pid=%d prio=%d nr_running=%u rt_nr_running=%u affine=%x demand=%u pred_demand=%u",
|
||||
__entry->cpu,
|
||||
__entry->enqueue ? "enqueue" : "dequeue",
|
||||
__entry->comm, __entry->pid,
|
||||
__entry->prio, __entry->nr_running,
|
||||
__entry->rt_nr_running,
|
||||
__entry->cpus_allowed, __entry->demand,
|
||||
__entry->pred_demand)
|
||||
);
|
||||
|
||||
/*
|
||||
* Tracepoint for waking up a task:
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1300,6 +1300,7 @@ static inline void enqueue_task(struct rq *rq, struct task_struct *p, int flags)
|
|||
uclamp_rq_inc(rq, p);
|
||||
p->sched_class->enqueue_task(rq, p, flags);
|
||||
walt_update_last_enqueue(p);
|
||||
trace_sched_enq_deq_task(p, 1, cpumask_bits(&p->cpus_mask)[0]);
|
||||
}
|
||||
|
||||
static inline void dequeue_task(struct rq *rq, struct task_struct *p, int flags)
|
||||
|
|
@ -1318,6 +1319,7 @@ static inline void dequeue_task(struct rq *rq, struct task_struct *p, int flags)
|
|||
if (p == rq->ed_task)
|
||||
early_detection_notify(rq, sched_ktime_clock());
|
||||
#endif
|
||||
trace_sched_enq_deq_task(p, 0, cpumask_bits(&p->cpus_mask)[0]);
|
||||
}
|
||||
|
||||
void activate_task(struct rq *rq, struct task_struct *p, int flags)
|
||||
|
|
|
|||
Loading…
Reference in a new issue