> > There's actually no real difference performance-wise > between the above > and the following: > > this->foo = (char *)copyin(arg1, arg2); > this->foo[arg2 + 1] = '\0'; > printf("%s\n", stringof(this->foo)); > e copyin() and the alloca() allocate space out of > scratch > space, and in fact, they share the same code path to > do so. The only > performance penalty being paid here is in doing this > as two separate > subroutine calls rather than a single one. The > alloca() is safer, > though, because it covers that edge case where the > copyin() would use > the remaining scratch space, making this->foo[arg2 + > 1] an illegal > address.
Makes sense... > Also, the space allocated by alloca() is only valid > within that > clause, so it has to be clause-local. Ooops. I should have caught then when I read up on alloca(). Thanks. Since I have all of your help here (and thanks much!).... what is your thought on changing the provider to give DTrace a string to work with? That would move the overhead for that processing to be in the code path for the process when the probe is enabled I gather, and the payoff is easier to use/read DTrace providers. Is this a recommended thing to do? - Matt -- This message posted from opensolaris.org _______________________________________________ dtrace-discuss mailing list dtrace-discuss@opensolaris.org