NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/59934: dtrace_sdt: caller is off by a frame



>Number:         59934
>Category:       kern
>Synopsis:       dtrace_sdt: caller is off by a frame
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 22 04:10:00 +0000 2026
>Originator:     Taylor R Campbell
>Release:        current, 11, 10, 9, ...
>Organization:
The NetSDT Caller
>Environment:
>Description:
When christos adapted dtrace sdt to NetBSD kernel modules, he changed the number of stack frames to be ignored in sdt probes from zero to one, so we lose the caller's address, i.e., the address of the SDT_PROBE*(...) call:

+       (void)dtrace_probe_create(prov->id, mod, func, name, 1, probe);
...
-                       res = dtrace_probe_create(sprov->id,
-                               sprov->probes[ind]->module,
-                               sprov->probes[ind]->function,
-                               sprov->probes[ind]->name,
-                               0, sprov->probes[ind]);

>How-To-Repeat:
dtrace -n 'sdt:::set-error { @[caller] = count } tick-10s, END { printa("\n%@u %a", @) }'

This should print the return addresses of various SDT_PROBE*(...) calls, but instead it prints the return addresses of the function calls that do SDT_PROBE*(...) in their bodies.
>Fix:
change the aframes argument of dtrace_probe_create from 1 to 0



Home | Main Index | Thread Index | Old Index