Dear Tracy,
here''s another "aggregation" that seems to be
missing...?...
aggr[ indecies ] = rank ( Dexpr ); // or "sort()"
I''ld then like to be able use this to control the order in which
aggregate indecies are iterated through to print the values/tables/etc.
for example, aggregating on PID/TID, I''m not as interrested in this
output for pid-0, threadid-47:
[0,47]
value ------------- Distribution ------------- count
4096 | 0
8192 | 11
16384 |@@ 111
32768 |@@@@@@@@@@@@@@ 722
65536 |@@@@@@@@@@@@@@@@@@ 913
131072 |@@ 82
262144 |@ 41
524288 |@ 31
1048576 | 11
2097152 | 16
4194304 | 4
8388608 | 1
as for pid-0, threadid-79 which consumes orders of magnitude more
time, so I''ld like this table to be closer to the top of my output:
[0,79]
value ------------- Distribution ------------- count
16777216 | 0
33554432 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 8
67108864 | 0
because, once again, the alternative seems to be writing a really
really messy perl program to post-process...
-Pete Lawrence.
Hey Pete, By default the aggregation sort order is by value from smallest to largest. It sounds like you''d like to reverse that order. To do so, you can specify ''aggsortrev'' either by using the -x option to dtrace(1M) or with a ''#pragma D option'' in your D script. If you actually want to control the sort order, you can use predicates and add another aggregation key. Adam On Mon, Mar 26, 2007 at 03:19:06PM -0700, Peter Lawrence wrote:> Dear Tracy, > here''s another "aggregation" that seems to be missing...?... > > > aggr[ indecies ] = rank ( Dexpr ); // or "sort()" > > > I''ld then like to be able use this to control the order in which > aggregate indecies are iterated through to print the values/tables/etc. > > > > for example, aggregating on PID/TID, I''m not as interrested in this > output for pid-0, threadid-47: > > [0,47] > value ------------- Distribution ------------- count > 4096 | 0 > 8192 | 11 > 16384 |@@ 111 > 32768 |@@@@@@@@@@@@@@ 722 > 65536 |@@@@@@@@@@@@@@@@@@ 913 > 131072 |@@ 82 > 262144 |@ 41 > 524288 |@ 31 > 1048576 | 11 > 2097152 | 16 > 4194304 | 4 > 8388608 | 1 > > > as for pid-0, threadid-79 which consumes orders of magnitude more > time, so I''ld like this table to be closer to the top of my output: > > [0,79] > value ------------- Distribution ------------- count > 16777216 | 0 > 33554432 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 8 > 67108864 | 0 > > > because, once again, the alternative seems to be writing a really > really messy perl program to post-process... > > > -Pete Lawrence. > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl
Adam,
Ahha!, since I was just printing out a quantized value, it wasn''t
obvious that it was already being printed in a sorted order. Now that
I look at it, it appears to be sorted by the total sum of the values
that were quantized. Just what I wanted!
Many Thanks,
-Pete.
Leventhal wrote On 03/26/07 15:34,:> Hey Pete,
>
> By default the aggregation sort order is by value from smallest to largest.
> It sounds like you''d like to reverse that order. To do so, you can
specify
> ''aggsortrev'' either by using the -x option to dtrace(1M)
or with a ''#pragma
> D option'' in your D script. If you actually want to control the
sort order,
> you can use predicates and add another aggregation key.
>
> Adam
>
> On Mon, Mar 26, 2007 at 03:19:06PM -0700, Peter Lawrence wrote:
>
>>Dear Tracy,
>> here''s another "aggregation" that seems to
be missing...?...
>>
>>
>> aggr[ indecies ] = rank ( Dexpr ); // or "sort()"
>>
>>
>>I''ld then like to be able use this to control the order in
which
>>aggregate indecies are iterated through to print the values/tables/etc.
>>
>>
>>
>>for example, aggregating on PID/TID, I''m not as interrested in
this
>>output for pid-0, threadid-47:
>>
>> [0,47]
>> value ------------- Distribution ------------- count
>> 4096 | 0
>> 8192 | 11
>> 16384 |@@ 111
>> 32768 |@@@@@@@@@@@@@@ 722
>> 65536 |@@@@@@@@@@@@@@@@@@ 913
>> 131072 |@@ 82
>> 262144 |@ 41
>> 524288 |@ 31
>> 1048576 | 11
>> 2097152 | 16
>> 4194304 | 4
>> 8388608 | 1
>>
>>
>>as for pid-0, threadid-79 which consumes orders of magnitude more
>>time, so I''ld like this table to be closer to the top of my
output:
>>
>> [0,79]
>> value ------------- Distribution ------------- count
>> 16777216 | 0
>> 33554432 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 8
>> 67108864 | 0
>>
>>
>>because, once again, the alternative seems to be writing a really
>>really messy perl program to post-process...
>>
>>
>>-Pete Lawrence.
>>_______________________________________________
>>dtrace-discuss mailing list
>>dtrace-discuss at opensolaris.org
>
>