[dtrace-discuss] Re: dtrace in my kernel module, what''s the problem?

Matthias Pfützner - Data Center Ambassador - Strategy and Technology
2006-01-12T09:25:31Z

It can''t be that chapter...

Because it starts:

The Statically Defined Tracing (SDT) provider creates probes at sites that a
software programmer has formally designated. The SDT mechanism allows
programmers to consciously choose locations of interest to users of DTrace and
to convey some semantic knowledge about each location through the probe name.
The Solaris kernel has defined a handful of SDT probes, and will likely add more
over time. DTrace also provides a mechanism for user application developers to
define static probes, described in Chapter 34, Statically Defined Tracing for
User Applications.

Still curious (and now, for the first time to the dtrace-alias),
        Matthias

I (Matthias Pf?tzner - Data Center Ambassador - Strategy and Technology)
wrote:
> Adam,
>
> the problem is clear to me, but i didn''t find the kernel
chapter... ;-)
>
> Here''s the TOC:
>
>     * Index
>     * Book Information
>     * Preface
>     * 1.  Introduction
>     * 2.  Types, Operators, and Expressions
>     * 3.  Variables
>     * 4.  D Program Structure
>     * 5.  Pointers and Arrays
>     * 6.  Strings
>     * 7.  Structs and Unions
>     * 8.  Type and Constant Definitions
>     * 9.  Aggregations
>     * 10.  Actions and Subroutines
>     * 11.  Buffers and Buffering
>     * 12.  Output Formatting
>     * 13.  Speculative Tracing
>     * 14.  dtrace(1M) Utility
>     * 15.  Scripting
>     * 16.  Options and Tunables
>     * 17.  dtrace Provider
>     * 18.  lockstat Provider
>     * 19.  profile Provider
>     * 20.  fbt Provider
>     * 21.  syscall Provider
>     * 22.  sdt Provider
>     * 23.  sysinfo Provider
>     * 24.  vminfo Provider
>     * 25.  proc Provider
>     * 26.  sched Provider
>     * 27.  io Provider
>     * 28.  mib Provider
>     * 29.  fpuinfo Provider
>     * 30.  pid Provider
>     * 31.  plockstat Provider
>     * 32.  fasttrap Provider
>     * 33.  User Process Tracing
>     * 34.  Statically Defined Tracing for User Applications
>     * 35.  Security
>     * 36.  Anonymous Tracing
>     * 37.  Postmortem Tracing
>     * 38.  Performance Considerations
>     * 39.  Stability
>     * 40.  Translators
>     * 41.  Versioning
>     * Glossary
>
> Which chapter is the kernel tracing developing "info-container"?
The "sdt"
> chapter, aka chapter 22?
>
> Still curious...
>
>         Matthias
>
> You (Adam Leventhal) write:
> > Hi Matthias,
> >
> > Please post this question to dtrace-discuss at opensolaris.org, but
the short
> > answer is that USDT is just for _user_ land binaries; for (kernel) SDT
> > check that chapter in the Solaris Dynamic Tracing Guide.
> >
> > Adam
> >
> > On Wed, Jan 11, 2006 at 09:46:45PM +0100, Matthias Pftzner - Data
Center Ambassador - Strategy and Technology wrote:
> > > Folks,
> > >
> > > I try to add dtrace points to "my" kernel module, but
do get errors during
> > > the compile.
> > >
> > >         /usr/sbin/dtrace -G -32 -s saa713xdtrace.d
obj-i386/saa713x-core.o obj-i386/saa713x-video.o obj-i386/saa713x-cards.o
obj-i386/saa713x-tvaudio.o obj-i386/saa713x-i2c.o
> > >         dtrace: failed to link script saa713xdtrace: an error was
encountered while processing obj-i386/saa713x-core.o
> > >
> > > Here''s the code:
> > >
> > > bash-3.00$ cat saa713xdtrace.d
> > > provider saa713xdtrace {
> > >         probe routine__enter(string);
> > >         probe routine__exit(string);
> > > };
> > > bash-3.00$
> > >
> > > And in the file saa713x-core.c I do have:
> > >
> > > #include <sys/sdt.h>
> > >
> > > void saa713x_print_ioctl(char *name, unsigned int cmd)
> > > {
> > >         const char *cmdnm;
> > >         char *dir = "??";
> > >
> > >         DTRACE_PROBE1(saa713xdtrace, routine__enter,
"saa713x_print_ioctl");
> > >         /*
> > >          * IOR/read  == IOC_OUT == kernel->user
> > >          * IOW/write == IOC_IN  == user->kernel
> > >          */
> > >         switch (cmd & IOC_INOUT) {
> > >
> > > et.al...
> > >
> > > So, what''s the problem, the error message isn''t
really helpful... ;-(
> > >
> > > All infos I found on this stuff is in:
> > >
> > >
http://docs.sun.com/app/docs/doc/817-6223/6mlkidlms?a=view
> > >
> > > Is there more? I did not find anything under:
> > >
> > >         http://www.sun.com/bigadmin/content/dtrace/
> > >
> > > Clueless,
> > >         Matthias
> > > --
> > >
***********************************************************************
> > > Matthias Pf?tzner
> > > Data Center Ambassador
> > > Strategy & Technology
> > > Sun Microsystems GmbH                 Tel: +49 6103 752-394
(x65394)
> > > Amp?restra?e 6                        Mobile: +49 172 8428766
> > > 63225 Langen                          Fax: +49 6103 752-167
> > > Germany                               mailto:Matthias.Pfuetzner
at Sun.COM
> > >
***********************************************************************
> >
> > --
> > Adam Leventhal, Solaris Kernel Development