Sébastien Bouchex Bellomié
2007-Feb-21 14:53 UTC
[dtrace-discuss] dtrace, uint64 wrapping and the Java dtrace API
Hi, I''m trying to understand the behaviour of dtrace regarding uint64 values... I have this stupid script : profile:::profile-1sec { @rest=sum(walltimestamp); printa(@rest); }>From the shell, If a execute this script and wait, I have :[...] 0 49239 :profile-1sec 7032413737193061074 0 49239 :profile-1sec 8204482696890657210 0 49239 :profile-1sec -9070192416120335650 0 49239 :profile-1sec -7898123454421689444 [...] How come that the uint64 value can be negative ? Might be a bug in the printa function ? If so, I''ll enter a bug. Now, if I use the Java dtrace API to execute this script (without the printa), the AggregationValue contains a negative value and I have to "cast" my value (with BigInteger and some magic) to have a correct value. Since AggregationValue.getValue return a Number object, I''ll assume that returning a uint64 is not possible with the API without some work... Seb S?bastien BOUCHEX BELLOMI? - Senior Software Engineer INFOVISTA SA 6, rue de la Terre De Feu F-91952 Courtaboeuf Cedex Tel : +33 (0)1 64 86 79 72 Fax : +33 (0)1 64 86 79 79 sbouchex at infovista.com <mailto:sbouchex at infovista.com> http://www.infovista.com <http://www.infovista.com> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20070221/f02fd80a/attachment.html>
Adam Leventhal
2007-Feb-21 17:28 UTC
[dtrace-discuss] dtrace, uint64 wrapping and the Java dtrace API
As with the trace() action, aggregation printing defaults to a signed interpretation. If you want an unsigned value, you can include a format for printa(). Tom, can probably address your questions about the Java API. Adam On Wed, Feb 21, 2007 at 03:53:04PM +0100, Sbastien Bouchex Bellomi wrote:> Hi, > > > > I''m trying to understand the behaviour of dtrace regarding uint64 values... > > I have this stupid script : > > profile:::profile-1sec > > { > > @rest=sum(walltimestamp); > > printa(@rest); > > } > > >From the shell, If a execute this script and wait, I have : > > [...] > > 0 49239 :profile-1sec > > 7032413737193061074 > > > > 0 49239 :profile-1sec > > 8204482696890657210 > > > > 0 49239 :profile-1sec > > -9070192416120335650 > > > > 0 49239 :profile-1sec > > -7898123454421689444 > > [...] > > > > How come that the uint64 value can be negative ? Might be a bug in the printa function ? If so, I''ll enter a bug. > > > > Now, if I use the Java dtrace API to execute this script (without the printa), the AggregationValue contains a negative value and I have to "cast" my value (with BigInteger and some magic) to have a correct value. > > Since AggregationValue.getValue return a Number object, I''ll assume that returning a uint64 is not possible with the API without some work... > > > > Seb > > > > S?bastien BOUCHEX BELLOMI? - Senior Software Engineer > INFOVISTA SA > 6, rue de la Terre De Feu > F-91952 Courtaboeuf Cedex > Tel : +33 (0)1 64 86 79 72 Fax : +33 (0)1 64 86 79 79 > sbouchex at infovista.com <mailto:sbouchex at infovista.com> http://www.infovista.com <http://www.infovista.com> > > >> _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl