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: Dealing with empty aggregates?


On 05/19/2011 03:36 PM, Frank Ch. Eigler wrote:
> The canonical construct doesn't require a hand-maintained flag:
> 
> probe timer.ms(1000) {
>     if (@count(stuff))
>        printf("Sum of stuff: %d\n", @sum(stuff))
>     else
>        printf("No stuff.")
> }

Exactly what I was looking for, thanks! A count is not especially useful for the
stuff I'm looking at (nfsd operations fwiw) and it didn't occur to me to gate on
count (obvious really since it's the only one defined on an empty aggregate.. duh!).

Cheers,
Bryn.


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