Skip to content

Instantly share code, notes, and snippets.

@brendangregg
Last active December 12, 2015 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brendangregg/4743398 to your computer and use it in GitHub Desktop.
Save brendangregg/4743398 to your computer and use it in GitHub Desktop.
mac_rx to freemsg latency (RX IP stack latency)
[root@headnode /var/tmp/brendan]# cat rxstacklat.d
#!/usr/sbin/dtrace -s
fbt::mac_rx:entry
{
ts[arg2] = timestamp;
}
fbt::freemsg:entry,
fbt::freeb:entry
/this->t = ts[arg0]/
{
@["ns"] = quantize(timestamp - this->t);
ts[arg0] = 0;
}
[root@headnode /var/tmp/brendan]# ./rxstacklat.d
dtrace: script './rxstacklat.d' matched 3 probes
^C
ns
value ------------- Distribution ------------- count
2048 | 0
4096 | 121
8192 |@@@ 1332
16384 |@@@@@@@@@@@@@@@@@@@@@@@@@ 12291
32768 |@@@@@@@@@ 4283
65536 |@@ 1137
131072 | 139
262144 | 37
524288 | 3
1048576 | 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment