global flag probe begin { printf("BEGIN\n") } probe kernel.trace("sched:sched_switch") { // look for the process with pid 0 and name that begins with "swap" if ($next_comm[0] == 115 && $next_comm[1] == 119 && $next_comm[2] == 97 && $next_comm[3] == 112 && $next_pid == 0) flag = 1 } probe timer.s(5) { exit() } probe end { if (flag) printf("END PASS\n") else printf("END FAIL\n") }