Re: [PATCH] trace: reset sleep/block start time on task switch
From: Arun Sharma
Date: Wed Jan 25 2012 - 17:30:52 EST
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/