• linux /proc/stat 文件说明


    /proc/stat 文件内容

    # cat /proc/stat 
    cpu  1411 1322 3070 1193539 2790 0 268 0 0 0
    cpu0 472 658 787 297933 695 0 19 0 0 0
    cpu1 314 157 728 299238 170 0 1 0 0 0
    cpu2 322 441 1069 296914 1727 0 246 0 0 0
    cpu3 302 66 485 299452 197 0 1 0 0 0
    intr 299813 52 967 0 0 0 0 3 0 1 0 0 0 17600 0 32507 3000 0 21 3016 4453 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 414 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    ctxt 501394
    btime 1436591724
    processes 3538
    procs_running 1
    procs_blocked 0
    softirq 179345 0 45443 1877 2019 34083 0 979 20793 80 74071
    root@gino-virtual-machine:/home/gino# cat /proc/stat 
    cpu  1587 1322 3203 1270155 2790 0 269 0 0 0
    cpu0 558 658 838 317027 695 0 19 0 0 0
    cpu1 360 157 776 318377 170 0 1 0 0 0
    cpu2 344 441 1091 316110 1727 0 246 0 0 0
    cpu3 324 66 496 318641 197 0 1 0 0 0
    intr 318396 52 1009 0 0 0 0 3 0 1 0 0 0 21956 0 32538 3188 0 21 3026 4453 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 443 0 0 0 0 0 0 0 0 0 0 0 0 0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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    ctxt 534481
    btime 1436591724
    processes 3540
    procs_running 1
    procs_blocked 0
    softirq 185287 0 47431 1917 2028 34208 0 1020 21961 87 76635
    

    说明:

    有以上信息能够得出 cpu是4核的,cpu这项相应信息例如以下
    cpu     user    nice    system  idle    iowait  irq softirq steal   guest   guest_nice
    user:用户态的CPU时间
    nice:低优先级程序所占用的用户态的cpu时间。
    system:系统态的CPU时间
    idle:CPU空暇的时间(不包括IO等待)
    iowait:等待IO响应的时间
    irq:处理硬件中断的时间
    softirq:处理软中断的时间
    steal:其它系统所花的时间(个人理解是针对虚拟机)
    guest:执行时间为客户操作系统下的虚拟CPU控制(个人理解是訪客控制CPU的时间)
    guest_nice:低优先级程序所占用的用户态的cpu时间。(訪客的)
    
    intr 这行展示系统中断的信息,第一个为自系统启动依赖。发生的全部中断的次数;然后每一个数相应一个特定的中断自系统启动以来所发生的次数。
    ctxt 这行展示自系统启动以来CPU发生的上下文交互的次数
    btime 这行展示从系统启动到如今为止的时间(以UTC时间開始计算,单位为秒)
    processes 这行展示自系统启动以来所创建的任务的个数
    procs_runnig 这行显示当前执行队列的任务数目
    procs_blocked 这行显示当前被堵塞的任务数目
    spftirq 这行显示软中断的情况

    更具体的内容參考 man proc 或 http://man7.org/linux/man-pages/man5/proc.5.html

  • 相关阅读:
    【博弈论】K倍动态减法游戏
    【博弈论】翻硬币游戏8种模型
    P4124 [CQOI2016]手机号码(数位DP,前导0)
    AtCoder Beginner Contest 146
    Sumitomo Mitsui Trust Bank Programming Contest 2019
    ICPC 2018 Nanjing Regional
    模拟退火基础学习&模板
    AtCoder Beginner Contest 117
    AtCoder Beginner Contest 118
    AtCoder Beginner Contest 119
  • 原文地址:https://www.cnblogs.com/yangykaifa/p/7133496.html
Copyright © 2020-2023  润新知