mirror of
https://github.com/ebrandi/FDD-book.git
synced 2026-12-06 00:23:30 +00:00
Organize companion code and materials by book part: part-01/ Foundations part-02/ Kernel & driver fundamentals part-03/ Character & block devices part-04/ Networking & storage part-05/ Buses & advanced topics part-06/ Debugging & performance part-07/ Real-world drivers appendices/ Supplementary material README.md Overview and build instructions
27 lines
582 B
D
27 lines
582 B
D
#!/usr/sbin/dtrace -s
|
|
/*
|
|
* profile-sample.d - kernel-wide profile sample at 997 Hz.
|
|
*
|
|
* Usage: sudo dtrace -s profile-sample.d
|
|
*
|
|
* Run a workload in another terminal. Let this script run for
|
|
* 30 to 60 seconds, then Ctrl-C. The output is a list of stack
|
|
* traces ordered by sample count.
|
|
*
|
|
* 997 Hz is deliberately not 1000 Hz. Using a prime number avoids
|
|
* interference with any 1 Hz, 10 Hz, 100 Hz, or 1000 Hz periodic
|
|
* activity that might create systematic bias.
|
|
*/
|
|
|
|
#pragma D option quiet
|
|
|
|
profile-997
|
|
{
|
|
@[stack()] = count();
|
|
}
|
|
|
|
END
|
|
{
|
|
trunc(@, 20);
|
|
printa(@);
|
|
}
|