global calls probe $1 { calls[$$name] += 1 } %( @2 == "return" %? probe $1.return { calls[$$name] -= 1 } %) probe end { foreach (x+ in calls) printf ("%s %d\n", x, calls[x]) }