【问题标题】:Why does the CPU utilization analyzed by pref is larger than 1?为什么pref分析的CPU利用率大于1?
【发布时间】:2020-12-22 14:27:22
【问题描述】:
q@centos:~/QQMail/platform/task/task2>perf stat bazel-bin/test

 Performance counter stats for 'bazel-bin/test':

      16380.991838      task-clock (msec)         #    3.430 CPUs utilized          
           583,363      context-switches          #    0.036 M/sec                  
               227      cpu-migrations            #    0.014 K/sec                  
            37,899      page-faults               #    0.002 M/sec                  
                 0      cycles                    #    0.000 GHz                    
                 0      stalled-cycles-frontend   #    0.00% frontend cycles idle   
                 0      stalled-cycles-backend    #    0.00% backend  cycles idle   
                 0      instructions              #    0.00  insns per cycle        
                 0      branches                  #    0.000 K/sec                  
                 0      branch-misses             #    0.000 K/sec                  

       4.775427302 seconds time elapsed

输出如上所示。 我想知道 perf 的任务时钟输出是什么意思?为什么它比过去的时间长? 还有一些数据是0,可能是什么问题?

【问题讨论】:

  • 不长了,经过的时间是4.7秒,task-clock是16380毫秒(msec),即1.6秒。
  • @Robert:毫秒是 1/1000 秒。在多核机器上,在 4.77 秒的挂钟时间内确实是 16.38 CPU 秒。

标签: linux perf


【解决方案1】:

这是因为时间是按 CPU 计算的,如 3.430 CPUs utilized 所示。在此期间,它平均占用了 3.43 个 CPU。您可以检查除以 16380/3.43 后得出的已用时间。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-24
    • 1970-01-01
    • 2013-03-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多