Sample Header Ad - 728x90

DTrace cannot reference the external kernel variable `ticks` on FreeBSD

2 votes
1 answer
29 views
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->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->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).
Asked by Mateusz Piotrowski (4983 rep)
Jun 23, 2025, 01:09 PM
Last activity: Jun 24, 2025, 08:53 AM