First page
Back
Continue
Last page
Overview
Graphics
Dynamic tracing of the X server
Simple count of number of times each request is called:
- #!/usr/sbin/dtrace -s
- Xserver*:::request-start
- {
- @counts[Xrequest[copyinstr(arg0)]] = count();
- }
Notes:
This can be rewrittenslightly to cache the string containing the name of the request since it will be reused many times, and copying it over and over from the kernel:
#!/usr/sbin/dtrace -s
string Xrequest[uintptr_t];
Xserver*:::request-start
/Xrequest[arg0] == ""/
{
Xrequest[arg0] = copyinstr(arg0);
}
Xserver*:::request-start
{
@counts[Xrequest[arg0]] = count();
}