On Fri, Nov 13, 2009 at 03:37:28PM +0000, Joel Reymont wrote:
> Jonathan,
> 
> On Nov 13, 2009, at 3:22 PM, Jonathan Adams wrote:
> 
> > pid$target:library::entry
> > {
> >        @a[usym(ucaller),probefunc] = count();
> >        @b[usym(ucaller),probefunc] = min(timestamp);
> > }
> 
> I recall you can sort associative arrays by key 
> but can you actually sort them by value?

These are not associative arrays;  they're aggregations.  They sort by value
by default.

> What exactly keeps @b ordered by call time?

@b is an aggregation on minimum timestamp, grouped by (calling function
(caller), called function (callee)).  This means that for each (caller,
callee) pair, the aggregation reports the minimum timestamp seen.  Since
timestamp is monotonically increasing, the min value of timestamp for a
given (caller, callee) pair is the time of the first invocation, and the
aggregation sorted by timestamp is the (caller, callee) graph in initial-
function-call order.

> How would I print @b such that the functions 
> appear in the order they were called?

It should just print it that way by default.

Cheers,
- jonathan

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

Reply via email to