]> bbs.cooldavid.org Git - net-next-2.6.git/commit
tracing: Fix sleep time function profiling
authorSteven Rostedt <srostedt@redhat.com>
Wed, 28 Apr 2010 01:04:24 +0000 (21:04 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Wed, 28 Apr 2010 01:04:24 +0000 (21:04 -0400)
commit37e44bc50d91df1fe7edcf6f02fe168c6d802e64
tree40058a2b27e94400dc4345ba13b334fb732ae532
parente330b3bcd83199dd63a819d8d12e40f9edae6c77
tracing: Fix sleep time function profiling

When sleep_time is off the function profiler ignores the time that a task
is scheduled out. When the task is scheduled out a timestamp is taken.
When the task is scheduled back in, the timestamp is compared to the
current time and the saved calltimes are adjusted accordingly.

But when stopping the function profiler, the sched switch hook that
does this adjustment was stopped before shutting down the tracer.
This allowed some tasks to not get their timestamps set when they
scheduled out. When the function profiler started again, this would
skew the times of the scheduler functions.

This patch moves the stopping of the sched switch to after the function
profiler is stopped. It also ignores zero set calltimes, which may
happen on start up.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/ftrace.c