sched: fix profile=sleep
authorIngo Molnar <mingo@elte.hu>
Tue, 2 Oct 2007 12:13:08 +0000 (14:13 +0200)
committerIngo Molnar <mingo@elte.hu>
Tue, 2 Oct 2007 12:13:08 +0000 (14:13 +0200)
fix sleep profiling - we lost this chunk in the CFS merge.

Found-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched_fair.c

index c9fbe8e73a45c66f36bb2ddf8bf5eaf24d93c141..67c67a87146ebaa64514c4bdf8b0ae5de0d4cf47 100644 (file)
@@ -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
 }