I've come across the following DTrace one-liner on https://wiki.freebsd.org/DTrace/One-Liners:
# Summarize TCP life span in seconds:
dtrace -n 'fbt::tcp_close:entry {
@["TCP life span (seconds):"] = quantize((uint32_t)(`ticks - args[0]->t_starttime) / `hz);
}'
It does not work on latest FreeBSD 15.0-CURRENT anymore. It errors out with:
dtrace: invalid probe specifier fbt::tcp_close:entry {
@["TCP life span (seconds):"] =
quantize((uint32_t)(`ticks - args[0]->t_starttime) / `hz);
}:
in action list: no symbolic type information is available for kernel`ticks:
No type information available for symbol
error text above manually wrapped/indented
Any ideas why DTrace cannot find `ticks? It finds `hz just fine.
According to the wiki page, all the one liners were tested in the past so that is not a typo. Also, I tried including sys/kernel.h as it seems to be where ticks is declared, but that did not help (it ends up needing sys/queue.h as well and even then it does not work).