It would be handy if an aggregate (statistics) could be passed as a function argument. $ cat agerr.stp global a function printag(ag) { if (@count(ag) > 0) printf("%d\n", @sum(ag)) } probe begin { a <<< 13 a <<< 42 printag(a) exit() } $ stap agerr.stp semantic error: probe_1712 with invalid type stats: identifier 'printag' at agerr.stp:9:2 semantic error: probe_1712 with invalid type stats: identifier 'ag' at :2:18 Pass 2: analysis failed. Try again with more '-v' (verbose) options. $