#!/usr/sbin/dtrace -Cs #pragma D option quiet int exp_running_total; int exp_per_sec; ts_preempt:entry / ((tsproc_t *)args[0]->t_cldata)->ts_timeleft == 0 / { exp_cnt++; @x[execname, tid] = count(); } tick-1sec { printf("Exp count: %d\n",exp_cnt); exp_running_total += exp_cnt; exp_cnt=0; } END { printf("TS time quantum expired...\n"); printf("%-16s %-8s %-8s\n","NAME","TID","CNT"); printa("%-16s %-8d %-8@d\n",@x); }