[Bug 195222] New: dtrace kernel sdt probes must always be anchored

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Nov 20 16:18:40 UTC 2014


            Bug ID: 195222
           Summary: dtrace kernel sdt probes must always be anchored
           Product: Base System
           Version: 11.0-CURRENT
          Hardware: Any
                OS: Any
            Status: Needs Triage
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: avg at FreeBSD.org

DTrace has two broad categories of probes, anchored and unanchored.  An
anchored probes is associated with a certain place in code (point of execution)
while an unanchored probe does not have such an association.  For example,
probes provided by profile provider are unanchored.  On the other hand fbt
probes are always anchored to function entry and exit points.

Given this definition, all sdt probes must be anchored because each probe is
placed at a particular point of execution.

Some things are done differently by the DTrace code depending on whether a
probe is anchored or not.  The code test if the probe is anchored based on
whether it is tied to a function (see DTRACE_ANCHORED() macro).  But the
current FreeBSD sdt implementation allows the function name to be left unset
(empty).  Thus a fundamentally anchored sdt probe would appear as an unanchored
probe to the DTrace code.

The above may lead to incorrect behavior.
For example try the following:
1. load dtrace_test.ko module
2. run this command: dtrace -n 'test:dtrace_test::sdttest { stack(); exit(0);
3. trigger the probe: sysctl debug.dtracetest.sdttest=1

Observe an incorrect stack trace as a result.

If definition of the probe is changed to include a function name, then stack()
would provide an expected result.

Thus, FreeBSD sdt implementation needs to be change to always define function
name for a probe.  Preferably, the function name should be set automatically. 
For example, module name is automatically determined if left empty.

Ideally, FreeBSD sdt interface should not ask for module and function names to
be provided at all.

You are receiving this mail because:
You are the assignee for the bug.

More information about the freebsd-bugs mailing list