DTraceChimeBasicsDemo

compared with
Current by Brian_Leonard
on Oct 19, 2009 12:54.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (2)

View page history
}
{noformat}
Explain the basics of the D language. The first line is a pattern for specifying the probes to match. If someone asks: "Uhm, how in the world are you supposed to know that 'syscall' is the name of a provider?" tell them to hold that thought. :-) The printf is easy - standard formatting from C, along with some pre-defined D variables. In this case, probefunc is the 3rd component of the probe. So for example, if we only wanted to see entries into the {{read}} function, we could modify the script as follows:
{noformat}
syscall::read:entry
{
printf("%s(%d) called %s\n", execname, pid, probefunc);
}
{noformat}
* Run *dtrace \-qs syscall.d* (the *q* option is quite mode, the *s* option is source file). You will see system calls appearing as you use the OS.
* Press Ctrl-C to stop dtrace.

The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact