Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/sbin/dtrace -s
- #pragma D option quiet
- /* #pragma D option flowindent*/
- /* #pragma D option destructive */
- /* int cnt=0;*/
- dtrace:::BEGIN {
- trace("tracing start\n");
- }
- /*
- Usage of profile provider
- profile:::tick-2s {
- trace("tracing is running\n");
- }
- */
- /*
- Usage of sched provider
- sched:::on-cpu {
- printf("-> Process scheduled child = %d -- cpu = %d -- pid = %d ( execname=%s )\n", chip, cpu, pid, execname);
- cnt++;
- }
- sched:::off-cpu
- / cnt > 1000 /
- {
- printf("<- Process descheduled \n");
- }
- */
- /*
- sched:::on-cpu {
- print count of processes scheduled on cpu
- @aggr[execname] = count();
- @aggr[execname] = lquantize(curthread->t_pri, 0, 159, 1);
- printf("-> Process scheduled child = %d -- cpu = %d -- pid = %d ( execname=%s )\n", chip, cpu, pid, execname);
- }
- */
- /* syscall:::entry {
- this->time = timestamp;
- }
- syscall:::return
- / this->time !=0 /
- {
- @aggr[probefunc] = sum((timestamp - this->time) / 1000);
- printf("syscall %s => %d\n", probefunc, (timestamp - this->time) / 1000);
- }
- */
- /* fbt:zfs:txg_*: {
- }
- */
- /* fbt::fork*: {
- }*/
- syscall::open:entry {
- printf("opening file %s from %d\n", copyinstr(arg0), pid);
- }
- dtrace:::END {
- trace("tracing end\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement