/usr/share/doc/bpftrace/examples
NameSizeModeActions
bashreadline_example.txt7220644editdlrm
biolatency_example.txt17900644editdlrm
biosnoop_example.txt20560644editdlrm
biostacks_example.txt19140644editdlrm
bitesize_example.txt30030644editdlrm
capable_example.txt26590644editdlrm
cpuwalk_example.txt49190644editdlrm
dcsnoop_example.txt46120644editdlrm
execsnoop_example.txt15350644editdlrm
gethostlatency_example.txt9230644editdlrm
killsnoop_example.txt8460644editdlrm
loads_example.txt8640644editdlrm
mdflush_example.txt18660644editdlrm
naptime_example.txt8440644editdlrm
oomkill_example.txt16680644editdlrm
opensnoop_example.txt25280644editdlrm
pidpersec_example.txt15040644editdlrm
runqlat_example.txt86320644editdlrm
runqlen_example.txt9800644editdlrm
setuids_example.txt24410644editdlrm
ssllatency_example.txt45100644editdlrm
sslsnoop_example.txt19160644editdlrm
statsnoop_example.txt27380644editdlrm
swapin_example.txt5490644editdlrm
syncsnoop_example.txt5410644editdlrm
syscount_example.txt11440644editdlrm
tcpaccept_example.txt13500644editdlrm
tcpconnect_example.txt10850644editdlrm
tcpdrop_example.txt12560644editdlrm
tcplife_example.txt15970644editdlrm
tcpretrans_example.txt11530644editdlrm
tcpsynbl_example.txt9400644editdlrm
threadsnoop_example.txt11820644editdlrm
undump_example.txt6800644editdlrm
vfscount_example.txt11990644editdlrm
vfsstat_example.txt9290644editdlrm
writeback_example.txt19620644editdlrm
xfsdist_example.txt34190644editdlrm
Edit: /usr/share/doc/bpftrace/examples/gethostlatency_example.txt (923B)
Demonstrations of gethostlatency, the Linux bpftrace/eBPF version. This traces host name lookup calls (getaddrinfo(), gethostbyname(), and gethostbyname2()), and shows the PID and command performing the lookup, the latency (duration) of the call in milliseconds, and the host string: # ./gethostlatency.bt Attaching 7 probes... Tracing getaddr/gethost calls... Hit Ctrl-C to end. TIME PID COMM LATms HOST 02:52:05 19105 curl 81 www.netflix.com 02:52:12 19111 curl 17 www.netflix.com 02:52:19 19116 curl 9 www.facebook.com 02:52:23 19118 curl 3 www.facebook.com In this example, the first call to lookup "www.netflix.com" took 81 ms, and the second took 17 ms (sounds like some caching). There is another version of this tool in bcc: https://github.com/iovisor/bcc The bcc version provides options to customize the output.