Index: head/cddl/usr.sbin/dwatch/libexec/sched =================================================================== --- head/cddl/usr.sbin/dwatch/libexec/sched (revision 330671) +++ head/cddl/usr.sbin/dwatch/libexec/sched (revision 330672) @@ -1,107 +1,107 @@ # -*- tab-width: 4 -*- ;; Emacs # vi: set filetype=sh tabstop=8 shiftwidth=8 noexpandtab :: Vi/ViM ############################################################ IDENT(1) # # $Title: dwatch(8) module for dtrace_sched(4) $ # $Copyright: 2014-2018 Devin Teske. All rights reserved. $ # $FreeBSD$ # ############################################################ DESCRIPTION # # Display CPU scheduling activity # ############################################################ PROBE case "$PROFILE" in sched) : ${PROBE:=sched:::} ;; sched-cpu) : ${PROBE:=sched:::off-cpu, sched:::on-cpu, sched:::remain-cpu} ;; sched-exec) : ${PROBE:=sched:::sleep, sched:::wakeup} ;; sched-pri) : ${PROBE:=sched:::change-pri, sched:::lend-pri} ;; sched-queue) : ${PROBE:=sched:::dequeue, sched:::enqueue, sched:::load-change} ;; *) : ${PROBE:=sched:::${PROFILE#sched-}} esac ############################################################ ACTIONS exec 9<");} this->args = this->args0; this->details = ""; this->pid = this->pid0; } sched:::change-pri, sched:::dequeue, sched:::enqueue, sched:::lend-pri, sched:::off-cpu, sched:::surrender, sched:::tick, sched:::wakeup /* probe ID $(( $ID + 1 )) */ {${TRACE:+ printf("<$(( $ID + 1 ))>");} this->curprio = (u_char)((struct thread *)args[0])->td_priority; $( pproc -P _sched "(struct proc *)args[1]" ) this->args = this->args_sched; this->pid = this->pid_sched; } sched:::enqueue /* probe ID $(( $ID + 2 )) */ {${TRACE:+ printf("<$(( $ID + 2 ))>");} /* details = "head" or "tail" */ this->details = (int)arg3 == 0 ? "tail" : "head"; } sched:::change-pri, sched:::lend-pri /* probe ID $(( $ID + 3 )) */ {${TRACE:+ printf("<$(( $ID + 3 ))>");} - /* details = " -> arg2" */ + /* details = " -> " */ this->details = strjoin(lltostr(this->curprio), strjoin("->", lltostr((uint8_t)arg2))); } sched:::load-change /* probe ID $(( $ID + 4 )) */ {${TRACE:+ printf("<$(( $ID + 4 ))>");} /* details = "CPU queue " */ this->details = strjoin(strjoin("CPU", lltostr((int)arg0)), strjoin(" queue ", lltostr((int)arg1))); } $PROBE /* probe ID $(( $ID + 5 )) */ {${TRACE:+ printf("<$(( $ID + 5 ))>");} /* details += " pid -- " */ this->details = strjoin(this->details, this->details == "" ? "" : " "); this->details = strjoin(this->details, strjoin( - strjoin("pid ", lltostr(this->pid_sched)), + strjoin("pid ", lltostr(this->pid)), strjoin(" -- ", this->args))); } EOF ACTIONS=$( cat <&9 ) ID=$(( $ID + 6 )) ############################################################ EVENT DETAILS exec 9<details); EOF EVENT_DETAILS=$( cat <&9 ) ################################################################################ # END ################################################################################