[dtrace-discuss] Tracing associate kernel module

Adam Leventhal ahl at eng.sun.com
Tue Sep 19 11:15:56 PDT 2006


You're interested in seeing what kernel modules are involved with the
execution of the program? You could do something like this:

fbt:::entry
{
	@[execname, probemod] = count();
}

This is a fairly big hammer since it instruments every function in the kernel;
what problem are you trying to solve exactly?

Adam

On Mon, Sep 18, 2006 at 09:47:19AM -0700, CHIAN-PHON LIN wrote:
> Hi,
> 
> I can use the D-program below to trace all USER
> modules associated with any executable command
> such as "ls":
> 
> #!/usr/sbin/dtrace -s
> #pragma D option quiet
> syscall::resolvepath:entry
> /!progenyof($pid)/
> {
>   self->umod = arg0;
> }
> syscall::resolvepath:return
> /!progenyof($pid) && self->umod && arg1 >= 0/
> {
>   printf("%s: %s\n", execname, copyinstr(self->umod));
>   self->umod = 0;
> }
> 
> My question is:
> 
> How to trace all KERNEL modules associated with
> any executable command?
> 
> Any hint will be greatly appreciated?
> 
> Thanks.
> 
> ************************************************
> * C P Lin, Common Technology Project Lead.     *
> * Sun Microsystems Inc.                        *
> * E-Mail:  c.lin at sun.com                       *
> * Address: 4150 Network Circle, M/S UMPK12-330 *
> * Santa Clara, CA 95054                        *
> * Phone:   650/352-4967	   Fax: 650/786-7816   *
> ************************************************
> _______________________________________________
> dtrace-discuss mailing list
> dtrace-discuss at opensolaris.org

-- 
Adam Leventhal, Solaris Kernel Development       http://blogs.sun.com/ahl


More information about the dtrace-discuss mailing list