[illumos-Developer] dtrace signed sum

Richard Elling richard.elling at richardelling.com
Tue Jun 21 20:52:57 PDT 2011


On Jun 21, 2011, at 6:28 PM, Adam Leventhal <ahl at delphix.com> wrote:

> Hey Richard,
> 
> I'm not sure I understand what you mean. The sum() aggregating action is signed:
> 
> # dtrace -n BEGIN'{ @ = sum(-45); @ = sum(5); exit(0); }'
> dtrace: description 'BEGIN' matched 1 probe
> CPU     ID                    FUNCTION:NAME
>  2      1                           :BEGIN
> 
>              -40
> 

Yes, until you need to printa(), where it is treated as unsigned.
Casts don't work there, so how do we get it out?
 -- richard

> Adam
> 
> On Tue, Jun 21, 2011 at 4:07 PM, Richard Elling
> <richard.elling at gmail.com> wrote:
>> I have  a desire for a the sum() aggregation to be signed. The reason is to count up and down.
>> Perhaps a signed count() would also be better? Increment/decrement?
>> Thoughts?
>>  -- richard
>> 
>> 
>> _______________________________________________
>> Developer mailing list
>> Developer at lists.illumos.org
>> http://lists.illumos.org/m/listinfo/developer
>> 
> 
> 
> 
> -- 
> Adam Leventhal, Delphix
> http://dtrace.org/blogs/ahl
> 
> 275 Middlefield Road, Suite 50
> Menlo Park, CA 94025
> http://www.delphix.com
> 
> _______________________________________________
> Developer mailing list
> Developer at lists.illumos.org
> http://lists.illumos.org/m/listinfo/developer



More information about the Developer mailing list