Messages in this thread |  | | Date | Wed, 25 Jan 2012 14:29:14 -0800 | From | Arun Sharma <> | Subject | Re: [PATCH] trace: reset sleep/block start time on task switch |
| |
On 1/25/12 12:15 PM, Steven Rostedt wrote:
> trace-cmd record -e sched_switch -f 'prev_state == 1 || prev_state == 2' -e sched_stat_sleep sleep 3 > > I'm not sure the filter is even needed, and it should still keep up > fine.
Better - I didn't see any overruns with trace-cmd.
Even if we resolve the sampling rate related problems, there is the issue of: can we trust that a sampled sched_switch event and a sampled sched_stat_sleep event actually match each other?
There is consensus here that touching an extra cacheline in the context switch path is a good trade-off given the usefulness of sleep profiling in troubleshooting latency problems.
Since it may not be a good trade-off for everyone, we just need to figure out where to store some per-task state. To recap two potential paths to investigate:
* store sleep_start someplace else that no one other than sched_stat_sleeptime() knows about.
* store state in task struct that remembers whether the last context switch was a preemption or not.
-Arun
|  |