2

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).

2
  • 1
    @shellter, including headers is a standard thing in DTrace. I linked to an explanation on how it is usually done. Commented Jun 24 at 8:54
  • Very good. tnx. Will remove this comment later. Commented Jun 27 at 0:17

1 Answer 1

3

It turns out this might be a bug.

All the other symbols I tested resolve just fine.

The reason why ticks (and interestingly enough ticksl as well) are not understood by DTrace could be due to the change in the implementation of ticks earlier this year.

Essentially, on my FreeBSD 15.0-CURRENT ticks is defined in an assembly file sys/kern/subr_ticks.s. As a result, ticks might not have any type info that ctfconvert could consume.

Refer to the PR in FreeBSD Bugzilla for more details: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=287752

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.