<<< value
.<<< $count
stores the amount returned by $count
to the associated value of the corresponding execname()
in the reads
array. Remember, these values are stored; they are not added to the associated values of each unique key, nor are they used to replace the current associated values. In a manner of speaking, think of it as having each unique key (execname()
) having multiple associated values, accumulating with each probe handler run.Note
count
returns the amount of data read by the returned execname()
to the virtual file system.@extractor(variable/array index expression)
. extractor
can be any of the following integer extractors:@count(reads[execname()])
will return how many values are stored in each unique key in array reads
.
@sum(reads[execname()])
will return the total of all values stored in each unique key in array reads
.
Example 3.22. Multiple Array Indexes
global reads probe vfs.read { reads[execname(),pid()] <<< 1 } probe timer.s(3) { foreach([var1,var2] in reads) printf("%s (%d) : %d \n", var1, var2, @count(reads[var1,var2])) }
reads
. Note how the
foreach
statement uses the same number of variables (that is,
var1
and var2
) contained in the first instance of the array
reads
from the first probe.