This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: sort a foreach on a stat value?


Bump.

Nobody has an opinion about this?


Stone, Joshua I wrote:
> Do we have a syntax to sort a foreach based on a stat value? 
> Obviously this doesn't make sense for a histogram, but for the
> others, like @count, it seems that this would very often be what a
> user would want to do.
> 
> For example - here's an unscalable way to do simple thread profiling:
> 
> global stat
> probe my.event { ++stat[tid()] }
> probe end {
>   foreach(tid in stat-) // sort by value -> most active
>     printf("%d: %d\n", tid, stat[tid])
> }
> 
> The scalable, per-cpu way to do this is:
> 
> global stat
> probe my.event { stat[tid()]<<<1 }
> probe end {
>   foreach(tid in stat-) // sort by value -> ???
>     printf("%d: %d\n", tid, @count(stat[tid]))
> }
> 
> But there doesn't seem to be a way to achieve the same sorting.
> 
> Along the same lines, it would be extremely useful to be able to do
> "cascading" sort - i.e. sort by more than one field.
> 
> 
> Josh


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]