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
33 lines
723 B
D
33 lines
723 B
D
/*
|
|
* dtrace_overhead.d - a probe-only DTrace script used to measure
|
|
* the per-syscall overhead of attaching DTrace.
|
|
*
|
|
* The script fires on every syscall entry and return but does not
|
|
* print anything per probe. At exit it prints the total counts.
|
|
* Attach it while the workload programs run and compare their
|
|
* wall-clock times to the baseline.
|
|
*
|
|
* Usage (as root):
|
|
* dtrace -q -s dtrace_overhead.d
|
|
*
|
|
* Ctrl-C when the workload finishes.
|
|
*
|
|
* Companion to Appendix F of "FreeBSD Device Drivers: From First
|
|
* Steps to Kernel Mastery".
|
|
*/
|
|
|
|
syscall:::entry
|
|
{
|
|
@entries = count();
|
|
}
|
|
|
|
syscall:::return
|
|
{
|
|
@returns = count();
|
|
}
|
|
|
|
END
|
|
{
|
|
printa("entries=%@d\n", @entries);
|
|
printa("returns=%@d\n", @returns);
|
|
}
|