<<< value.
global reads
probe vfs.read
{
reads[execname()] <<< count
}
<<< 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.
count returns the amount of data written by the returned execname() to the virtual file system.
@extractor(variable/array index expression). extractor can be any of the following integer extractors:
@count(writes[execname()]) will return how many values are stored in each unique key in array writes.
@sum(writes[execname()]) will return the total of all values stored in each unique key in array writes.
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 (i.e. var1 and var2) contained in the first instance of the array reads from the first probe.