Re: [Question] How does perf still record the stack of a specified pid even when that process is interrupted and CPU is scheduled to other process

From: David Ahern
Date: Tue May 05 2015 - 18:25:02 EST


On 5/5/15 3:53 PM, Rabin Vincent wrote:
The commands above will identify the sys_write which takes time but only
provide the stacktrace at the entry and exit of the syscall, but this do
not show why the process blocked or what it did inside the system call.

So a way to get what is required for the use case would be to make the
following changes to the above sequence:

(1) include the sched:* events when perf trace record is run

(2) around the time of interest, look at the kernel stack st the sched:switch
events between the entry and the exit. This will show what the process was
waiting for when it when it blocked. The stacktraces at the
stat_runtime events in the process may also be useful to understand what
was going on.

agreed.


--
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/