⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 count_user_insts.tcl

📁 一个用在mips体系结构中的操作系统
💻 TCL
字号:
## Copyright (C) 1996-1998 by the Board of Trustees#    of Leland Stanford Junior University.# # This file is part of the SimOS distribution. # See LICENSE file for terms of the license. ####### count_user_insts.tcl###### $Author: bosch $### $Date: 1998/02/10 00:26:17 $######### Cool way to count and print out how many user instructions go### to each user process. This prints them periodically and at the### end of the run.###for {set i 0} {$i < 16400} {incr i} {    set countStartInstsPid($i)  0    set countTotalPidInsts($i)  0}annotation set osEvent startUser {    set pid $currentPid($CPU)    if {$pid >= $IDLE_PID} {        console "COUNT: START USER is idle $pid\n"    }    set countStartInstsPid($pid) $INSTS}#    log "COUNT: Starting $pid at $CYCLES and $INSTS insts\n"annotation set osEvent endUser {    set pid $currentPid($CPU)    if {$pid >= $IDLE_PID} {        console "COUNT: END USER is idle $pid\n"    }    set countInstsRun [expr $INSTS - $countStartInstsPid($pid)]    set countTotalPidInsts($pid) [expr $countTotalPidInsts($pid) + $countInstsRun]}#    log "COUNT: Ending $pid at $CYCLES and $INSTS => $countInstsRun\n"annotation set simos exit {    for {set i 0} {$i < $IDLE_PID} {incr i} {        if {$countTotalPidInsts($i) != 0} {            log "COUNT: Pid $i => $countTotalPidInsts($i)\n"        }    }}annotation set simos periodic {    for {set i 0} {$i < $IDLE_PID} {incr i} {        if {$countTotalPidInsts($i) != 0} {            log "COUNT: Pid $i => $countTotalPidInsts($i)\n"        }    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -