From: Ingo Molnar Date: Tue, 2 Oct 2007 12:13:08 +0000 (+0200) Subject: sched: fix profile=sleep X-Git-Tag: v2.6.23~40^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=30084fbd1caa4b2e1a336fcdef60b68129d1d8f8;p=platform%2Fkernel%2Flinux-3.10.git sched: fix profile=sleep fix sleep profiling - we lost this chunk in the CFS merge. Found-by: Mel Gorman Signed-off-by: Ingo Molnar --- diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index c9fbe8e..67c67a87 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c @@ -639,6 +639,16 @@ static void enqueue_sleeper(struct cfs_rq *cfs_rq, struct sched_entity *se) se->block_start = 0; se->sum_sleep_runtime += delta; + + /* + * Blocking time is in units of nanosecs, so shift by 20 to + * get a milliseconds-range estimation of the amount of + * time that the task spent sleeping: + */ + if (unlikely(prof_on == SLEEP_PROFILING)) { + profile_hits(SLEEP_PROFILING, (void *)get_wchan(tsk), + delta >> 20); + } } #endif }