ANDROID: sched: move blocked reason trace point to cover all class

Now, we only export CFS taks' blocked reasons but it's
important and useful to know other class' blocked
reasons such as RT tasks.

Move the blocked reason trace point to where the scheduler
core layer and before the task's state moves to the waking
state. Thus, we could cover all the sched classes.

Bug: 203080186
Test: check traces
Signed-off-by: Martin Liu <liumartin@google.com>
Change-Id: Ic61865642d852d0127cdcf474adf8c06e4c2d570
(cherry picked from commit 44447dec6e)
This commit is contained in:
Martin Liu
2021-10-14 14:49:19 +00:00
parent d5f836726a
commit 6a878921fc
2 changed files with 3 additions and 1 deletions

View File

@@ -4055,6 +4055,9 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
if (READ_ONCE(p->on_rq) && ttwu_runnable(p, wake_flags))
goto unlock;
if (READ_ONCE(p->__state) & TASK_UNINTERRUPTIBLE)
trace_sched_blocked_reason(p);
#ifdef CONFIG_SMP
/*
* Ensure we load p->on_cpu _after_ p->on_rq, otherwise it would be

View File

@@ -978,7 +978,6 @@ update_stats_enqueue_sleeper(struct cfs_rq *cfs_rq, struct sched_entity *se)
}
trace_sched_stat_blocked(tsk, delta);
trace_sched_blocked_reason(tsk);
/*
* Blocking time is in units of nanosecs, so shift by