#!/bin/probevue /* Prints the numbers of execs & forks each second (on the same line) - This is NOT a scrolling display, but only uses three lines, the last line it just continually "refreshes" with new data. - This is just a demonstration of an alternate method to display data (using the same counter(s) as other display examples). - Should print fine on a 80 char wide display. For really large numbers printf() will expand and break the "refresh effect". */ int extotal; /* Total execs since start */ int exlstsc; /* Execs in the last second */ int fktotal; /* Total forks since start */ int fklstsc; /* Forks in the last second */ int intrvls; /* Intervals that we have run */ @@BEGIN { extotal = 0; exlstsc = 0; fktotal = 0; fklstsc = 0; intrvls = 0; printf("Execs Forks\n"); printf("Total_________Last_second__Average/sec__Total_________Last_second__Average/sec__\n"); } @@syscall:*:execve:entry { extotal++; exlstsc++; } @@syscall:*:fork:entry { fktotal++; fklstsc++; } @@interval:*:clock:1000 { intrvls++; printf("\r%-13d %-12d %-12d %-13d %-12d %-12d ", extotal, exlstsc, extotal / intrvls, fktotal, fklstsc, fktotal / intrvls); exlstsc = 0; fklstsc = 0; } @@END { printf("\n"); }