On Wed, May 05, 2010 at 09:11:27AM -0700, Yossi Lev wrote:
> I just found a function that (sort of) does what I need: it is called
> lltostr and it takes a long long integer, and returns a string that
> represents it.  (Unfortunately I didn't find an option to do the
> translation in hexadecimal, but I can live with that...)
> 
>  As for your question, I need to use the numbers as a key to an
>  aggregation, but I need to concatenate a few of those.  In
>  particular, I have a sequence of N numbers where N < 9, and I need to
>  count how many times I'm getting each sequence.  The value of N may
>  be different in separate invocations of the probe function, so I
>  would like to use an unrolled loop to concatenate the N numbers to
>  single string representing the sequence, and then use the string as
>  the key to my aggregation.  
> 
> Do you see any other option but to use the lltostr function to and
> concatenate the resulted strings?

Yes: aggregations take multiple keys, not just one, so rather than
format a string with all the key content that you need: use a comma-
separated list of expressions of various types as the key.  See:

http://docs.sun.com/app/docs/doc/819-5488/gcggh?a=view

Nico
-- 
_______________________________________________
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org

Reply via email to