In a C program, if I have several calls to printf (say):
printf("This is not a test");
printf("How do you like them %s","apples");
printf("%d is a magic %s",3,"number");
and I then want to use Dtrace to fetch the args from all 3 printfs
(This will pull out the basic string)
pid$1::printf:entry
{
print_template = stringof(copyinstr(arg0));
printf("%s",print_template);
}
Is it possible to fetch (or how can I?) the additional args to printf if you
don't know how many args will be used and of what type they are?
E.G
the first printf above doesn't have an arg1,
the second printf has arg1 of type string,
the third printf has arg1 of type int (and an arg2 !)
How can I write a probe or probes to handle these variable cases?
Cheers!
--
This message posted from opensolaris.org
_______________________________________________
dtrace-discuss mailing list
[email protected]