On Mon, Dec 29, 2008 at 2:04 PM, Vladimir Kvashin
<vladimir.kvas...@sun.com> wrote:
> Thanks a lot for you prompt reply.
>
> I guess the exename can be used as a filter.
>
> But even if I have a trigger that says me that the program gas started - how 
> can I trace malloc/free? I can't use pid provider since it needs a hardcoded 
> (from after-preprocessor point of view) pid value; and I don't know other way 
> to trace malloc/free...

How intrusive do you want to be?  If you don't mind stopping the
process briefly just after it gets exec'd, use two scripts.  The first
script uses the exec-success probe to catch a specified execname just
before it starts to run.  You can stop() the process, and 'pid' will
contain what you want.  Then just use system() to run the second
script with the supplied pid.  The second script needs a BEGIN clause
that uses system() to prun the target process but you're all set
otherwise.

Chad
_______________________________________________
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org

Reply via email to