Skip to content

Commit

Permalink
sched: fix profile=sleep
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ingo Molnar committed Oct 2, 2007
1 parent 3146b39 commit 30084fb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions kernel/sched_fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 30084fb

Please sign in to comment.