Pierre-Olivier Gaillard
2008-Oct-30 14:54 UTC
[dtrace-discuss] truncated output with copyinstr
Hi, It looks like the output of copyinstr is truncated with the following code: pid$$1:*:SQLPrepareAndExecute:entry /strstr(this->str = copyinstr(arg1), $2)!= NULL/ { printf("%d : query : %s)\n", timestamp, this->str); printf("{"); ustack(50); printf("}\n"); } I can see the ending parenthesis after %s so it seems that my string got truncated during copyinstr. Can I adjust the corresponding buffer? Or maybe know its size so that I can play with copyin and pointer arithmetics to see more? Thanks a lot, PS: I case my uname -a can help. bash$ uname -a SunOS koala 5.10 Generic_120011-14 sun4u sparc SUNW,Sun-Fire-V490 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20081030/85b68c69/attachment.html>
By default the string size in DTrace is 256 bytes. You can change the default by setting the strsize parameter. **#pragma D option strsize=1024** Hope this helps. -Angelo Pierre-Olivier Gaillard wrote:> Hi, > > It looks like the output of copyinstr is truncated with the following > code: > > pid$$1:*:SQLPrepareAndExecute:entry > /strstr(this->str = copyinstr(arg1), $2)!= NULL/ > { > printf("%d : query : %s)\n", timestamp, this->str); > printf("{"); > ustack(50); > printf("}\n"); > } > > I can see the ending parenthesis after %s so it seems that my string > got truncated during copyinstr. > > Can I adjust the corresponding buffer? Or maybe know its size so that > I can play with copyin and pointer arithmetics to see more? > > Thanks a lot, > > PS: > I case my uname -a can help. > bash$ uname -a > SunOS koala 5.10 Generic_120011-14 sun4u sparc SUNW,Sun-Fire-V490 > > > ------------------------------------------------------------------------ > > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org >
Pierre-Olivier Gaillard
2008-Oct-30 20:45 UTC
[dtrace-discuss] truncated output with copyinstr
Indeed. Thanks a lot, On Thu, Oct 30, 2008 at 11:01 AM, Angelo Rajadurai <Angelo.Rajadurai at sun.com> wrote:> By default the string size in DTrace is 256 bytes. You can change the > default by setting the strsize parameter. > > **#pragma D option strsize=1024** > > Hope this helps. > > -Angelo > > Pierre-Olivier Gaillard wrote: > >> Hi, >> >> It looks like the output of copyinstr is truncated with the following >> code: >> >> pid$$1:*:SQLPrepareAndExecute:entry >> /strstr(this->str = copyinstr(arg1), $2)!= NULL/ >> { >> printf("%d : query : %s)\n", timestamp, this->str); >> printf("{"); >> ustack(50); >> printf("}\n"); >> } >> >> I can see the ending parenthesis after %s so it seems that my string got >> truncated during copyinstr. >> >> Can I adjust the corresponding buffer? Or maybe know its size so that I >> can play with copyin and pointer arithmetics to see more? >> >> Thanks a lot, >> >> PS: >> I case my uname -a can help. >> bash$ uname -a >> SunOS koala 5.10 Generic_120011-14 sun4u sparc SUNW,Sun-Fire-V490 >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> dtrace-discuss mailing list >> dtrace-discuss at opensolaris.org >> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20081030/70fb3018/attachment.html>