Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Nov 2014 16:18:40 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 195222] New: dtrace kernel sdt probes must always be anchored
Message-ID:  <bug-195222-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195222

            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@FreeBSD.org
          Reporter: avg@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-195222-8>