#! stap -p2

global foo
probe kernel.function(
%( kernel_v < "2.6.19" %? "pipe_writev" %: "pipe_write" %) )
{
   a = $nr_segs
   foo [a] = 1
   # $nr_segs is not an lvalue here (foo is), so this should compile
   # even in non-guru mode
   foo [$nr_segs] ++
}
