testsuite/systemtap.examples/virtualization/qemu_count.stp
raw| 1 | #!/usr/bin/env stap |
| 2 | # |
| 3 | # Copyright (C) 2011 Red Hat, Inc. |
| 4 | # Written by William Cohen <[email protected]> |
| 5 | # |
| 6 | # The qemu_count.stp script tallies the number of times each of the |
| 7 | # user-space qemu probepoints is encountered. When the script exits, |
| 8 | # it prints a list of the number of times each user-space qemu |
| 9 | # probepoint is encountered. |
| 10 | |
| 11 | global counts |
| 12 | probe qemu.*.*.*?, qemu.kvm.*? {counts[pn()]++} |
| 13 | probe end { foreach(n+ in counts) printf ("%s = %d\n", n, counts[n]) } |