On Thu, Feb 28, 2008 at 11:15:30AM -0800, Dan Mick wrote:
> Adam Leventhal wrote:
> > What you can do is create a buffer to hold your real data, prepend it with
> > a non-printable character, and trace the whole thing (remembering to
> > mentally
> > discard the first byte). For example:
> >
> > syscall::write:entry
> > /execname == "cat"/
> > {
> > this->a = copyin(arg1, 80);
> > this->p = (char *)alloca(81);
> > *this->p = '\0';
> > bcopy(this->a, this->p + 1, 80);
> > tracemem(this->p, 81);
> > }
> >
> > Despite this glorious work-around,
>
> chuckle.
>
> > please file a bug; if someone is interested
> > in getting involved with DTrace development, this would be a good fix to try
> > out.
>
> Spouting off ideas: perhaps tracerawmem()?
You don't actually even need to do that -- this can be done purely in
terms of implementation changes. (We just need to break out tracemem()
as its own action type -- DTRACEACT_TRACEMEM -- and then act on that
accordingly at user-land. As Adam said, it's a good project for someone
to pick up who is interested in getting their feet wet with DTrace.)
- Bryan
--------------------------------------------------------------------------
Bryan Cantrill, Sun Microsystems Fishworks. http://blogs.sun.com/bmc
_______________________________________________
dtrace-discuss mailing list
[email protected]