Something to remember when using DTrace on userland programsAs mentioned before, Solaris's DTrace
is fundamentally a kernel debugger; in order to extract information
from userland programs, you need to copy it to kernel space (generally
using DTrace's Keeping them straight is vital, because you have to do different things
in order to use them; you dereference pointers but give locations to
uintptr_t LOC; TYPE var; var = * ((TYPE *) copyin(LOC, sizeof(TYPE))); (Unfortunately DTrace doesn't have If this seems confusing, well, it is. The DTrace language is very C-like and it lets you define structures
just like C, enough so that you can generally just copy the structure
definitions from your C header files into your DTrace program. However,
watch out; all of the pointers in your program's structures are userland
pointers, ie locations, not kernel pointers (real pointers). You will
avoid a lot of confusion if you take all of those structure definitions
and change the type of every pointer field to be (The DTrace language helps you out by not having a As a suggestion: if you do this, leave yourself a comment about what
type the pointers actually point to, so you can remember what you get
when you dereference them via |
These are my WanderingThoughts GettingAround This is part of CSpace, and is written by ChrisSiebenmann. * * * Atom feeds are available; see the bottom of most pages. Categories: links, linux, programming, python, snark, solaris, spam, sysadmin, tech, unix, web |