On 1/30/06, Jonathan Adams <jonathan.adams at sun.com>
wrote:> On Mon, Jan 30, 2006 at 05:42:08PM +0530, Gracy F wrote:
> > Hi All,
> > I couldn''t understand the source flow after the compilation
of the
> > probe. How does the provide module get invoked ?
> > Can anybody bried on that please ?
>
> Could you please describe exactly what you are trying to do?
Upon re-reading, I think I misread your question. Compilation of the
D script (in libdtrace) yields a "DOF" (D Object Format) object. DOF
is described in /usr/include/sys/dtrace.h:
http://cvs.opensolaris.org/source/xref/on/usr/src/uts/common/sys/dtrace.h
This DOF is loaded into the kernel, either by a DTRACEIOC_ENABLE ioctl
on /dev/dtrace:
http://cvs.opensolaris.org/source/xref/on/usr/src/uts/common/dtrace/dtrace.c#13510
or, for anonymous enablings, by putting the DOF in the
''dtrace.conf''
driver configuration file, where it will be read and processed in
dtrace_anon_property():
http://cvs.opensolaris.org/source/xref/on/usr/src/uts/common/dtrace/dtrace.c#dtrace_anon_property
dtrace.c then processes the DOF, creating it''s own data structures
around it. Each "Enabling" (probespec + optional predicate + action)
is matched against the probes in the system. For each probe the
probespec matches, an "ECB" (enabling control block) is created, which
links the probe to the enabling. See dtrace_ecb_enable():
http://cvs.opensolaris.org/source/xref/on/usr/src/uts/common/dtrace/dtrace.c#dtrace_ecb_enable
and /usr/include/sys/dtrace_impl.h for more details.
> > I couldn''t find the source code for these
Framework-to-Provider API
> > and Provider-to-Framework API in opensolaris-src-20051207[1].tar.bz2.
> > Could anybody please help ?
These are defined in uts/common/sys/dtrace.h. The framework side of
both APIs is implemented in uts/common/dtrace/dtrace.c, which I linked
to above.
Cheers,
- jonathan