Bug 256928 - dtrace: stack() cannot resolve kernel module symbols
Summary: dtrace: stack() cannot resolve kernel module symbols
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 12.2-RELEASE
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-01 20:01 UTC by Brian Mueller
Modified: 2021-07-14 21:20 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Mueller 2021-07-01 20:01:32 UTC
dtrace stack() is not resolving kernel module symbols for either FreeBSD 12.1 or 12.2.  The example below exercises autofs.ko.  autofs_readdir is displayed as linux.ko`0xffffffff82a3b314

dtrace -n 'fbt:autofs::entry { @[stack(), ustack()] = count(); }' -c 'ls -l /net'
...
              linux.ko`0xffffffff82a3b314
              kernel`VOP_READDIR_APV+0x7b
              kernel`kern_getdirentries+0x201
              kernel`sys_getdirentries+0x29
              kernel`amd64_syscall+0x387
              kernel`0xffffffff8106785e

              libc.so.7`__sys_getdirentries+0xa
              libc.so.7`readdir+0x30
              libc.so.7`0x800389677
              libc.so.7`fts_children+0x14b
              ls`traverse+0x1a7
              ls`main+0x945
              ls`_start+0x100
              `0x800235000
                1
...
# kgdb /boot/kernel/kernel /dev/mem
...
(kgdb) l* 0xffffffff82a3b314
Reading in symbols for /usr/src/sys/fs/autofs/autofs_vnops.c...done.
0xffffffff82a3b314 is in autofs_readdir (/usr/src/sys/fs/autofs/autofs_vnops.c:411).
406             uio = ap->a_uio;
407             initial_resid = ap->a_uio->uio_resid;
408
409             KASSERT(vp->v_type == VDIR, ("!VDIR"));
410
411             if (autofs_cached(anp, NULL, 0) == false &&
412                 autofs_ignore_thread(curthread) == false) {
413                     error = autofs_trigger_vn(vp, "", 0, &newvp);
414                     if (error != 0)
415                             return (error);