Let's say I have a far-fetched program:
#include <Windows.h>
void useless_function()
{
Sleep(5000);
}
void useful_function()
{
useless_function();
}
int main()
{
useful_function();
return 0;
}
Purpose . I want the profiler to tell me what is useful_function()useless causing useless_function(), which does not wait for obvious reasons. In XPerf, this is not displayed on any of the graphs that I have, because the call WaitForMultipleObjects()seems to be taken into account Idle.exeinstead of my own program.
And here is the xperf command line that I am running now:
xperf -on Latency -stackwalk Profile
Any ideas?
(This is not limited to standby functions. The above can be solved by placing breakpoints in NtWaitForMultipleObjects. Ideally, there might be a way to see a stack sample that takes a lot of wall clock time, unlike just CPU time)