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
30 lines
589 B
D
30 lines
589 B
D
#!/usr/sbin/dtrace -s
|
|
/*
|
|
* read-latency.d - histogram the latency of perfdemo_read in nanoseconds.
|
|
*
|
|
* Usage: sudo dtrace -s read-latency.d
|
|
*
|
|
* Run a workload against /dev/perfdemo in another terminal. Let this
|
|
* script run for 30 seconds, then Ctrl-C. The output is a quantize()
|
|
* histogram of latencies in ns, bucketed by power of two.
|
|
*/
|
|
|
|
#pragma D option quiet
|
|
#pragma D option dynvarsize=16m
|
|
|
|
fbt:perfdemo:perfdemo_read:entry
|
|
{
|
|
self->ts = timestamp;
|
|
}
|
|
|
|
fbt:perfdemo:perfdemo_read:return
|
|
/self->ts/
|
|
{
|
|
@ = quantize(timestamp - self->ts);
|
|
self->ts = 0;
|
|
}
|
|
|
|
END
|
|
{
|
|
printa(@);
|
|
}
|