AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 936149
Accepted
ycomp
ycomp
Asked: 2017-07-15 07:58:26 +0800 CST2017-07-15 07:58:26 +0800 CST 2017-07-15 07:58:26 +0800 CST

对单个内核进行基准测试?[复制]

  • 772
这个问题在这里已经有了答案:
Linux 的 CPU 基准测试实用程序 4 个答案
5年前关闭。

如何对单个内核进行基准测试?我想看看它们是否都以相同的速度运行。如果我的 Cortex A53 设备有big.LITTLE与否,我有点困惑,我在互联网上阅读相互矛盾的信息,所以我想自己测试一下。

cpu
  • 2 2 个回答
  • 4618 Views

2 个回答

  • Voted
  1. urben
    2017-07-15T09:01:26+08:002017-07-15T09:01:26+08:00

    (我假设您有一个具有多个内核的 CPU,每个内核都有多个线程)

    您可以使用名为 sysbench 的工具。

    安装它sudo apt-get install sysbench

    默认情况下,这是测试单个线程。

    sysbench --test=cpu run
    

    或者

    sysbench --test=threads --num-threads=1 --thread-locks=1 run
    

    但我似乎无法弄清楚如何将其锁定到特定线程。有人吗?

    您可以通过阅读手册页自己尝试:

    man sysbench
    
    • 1
  2. Best Answer
    ycomp
    2017-07-15T21:01:32+08:002017-07-15T21:01:32+08:00

    我认为@doug-smythies 的评论回答了这个问题。

    但是,我意识到只是看看所有 CPU 是否都在同一级别上执行 - 我可以这样做:

    1 个 CPU

    root@amlogic:~# stress-ng --cpu 1 --cpu-method matrixprod  --metrics-brief --perf -t 10
    stress-ng: info:  [5921] dispatching hogs: 1 cpu
    stress-ng: info:  [5921] cache allocate: using built-in defaults as unable to determine cache details
    stress-ng: info:  [5921] cache allocate: default cache size: 2048K
    stress-ng: info:  [5921] successful run completed in 10.94s
    stress-ng: info:  [5921] stressor      bogo ops real time  usr time  sys time   bogo ops/s   bogo ops/s
    stress-ng: info:  [5921]                          (secs)    (secs)    (secs)   (real time) (usr+sys time)
    stress-ng: info:  [5921] cpu                 21     10.93     10.02      0.02         1.92         2.09
    stress-ng: info:  [5921] cpu:
    stress-ng: info:  [5921]             14,108,856,703 CPU Cycles                     1.29 B/sec
    stress-ng: info:  [5921]             13,710,373,770 Instructions                   1.25 B/sec (0.972 instr. per cycle)
    stress-ng: info:  [5921]                927,478,656 Cache References              84.76 M/sec
    stress-ng: info:  [5921]                 43,400,148 Cache Misses                   3.97 M/sec ( 4.68%)
    stress-ng: info:  [5921]                 36,225,340 Branch Misses                  3.31 M/sec ( 0.00%)
    

    4 CPU

    root@amlogic:~# stress-ng --cpu 4 --cpu-method matrixprod  --metrics-brief --perf -t 10
    stress-ng: info:  [5867] dispatching hogs: 4 cpu
    stress-ng: info:  [5867] cache allocate: using built-in defaults as unable to determine cache details
    stress-ng: info:  [5867] cache allocate: default cache size: 2048K
    stress-ng: info:  [5867] successful run completed in 11.56s
    stress-ng: info:  [5867] stressor      bogo ops real time  usr time  sys time   bogo ops/s   bogo ops/s
    stress-ng: info:  [5867]                          (secs)    (secs)    (secs)   (real time) (usr+sys time)
    stress-ng: info:  [5867] cpu                 51     10.80     41.05      0.47         4.72         1.23
    stress-ng: info:  [5867] cpu:
    stress-ng: info:  [5867]             59,953,532,588 CPU Cycles                     5.19 B/sec
    stress-ng: info:  [5867]             31,357,210,848 Instructions                   2.71 B/sec (0.523 instr. per cycle)
    stress-ng: info:  [5867]              2,127,678,244 Cache References               0.18 B/sec
    stress-ng: info:  [5867]                101,073,952 Cache Misses                   8.75 M/sec ( 4.75%)
    stress-ng: info:  [5867]                 82,805,524 Branch Misses                  7.17 M/sec ( 0.00%)
    

    8个中央处理器

    root@amlogic:~# stress-ng --cpu 8 --cpu-method matrixprod  --metrics-brief --perf -t 10
    stress-ng: info:  [5892] dispatching hogs: 8 cpu
    stress-ng: info:  [5892] cache allocate: using built-in defaults as unable to determine cache details
    stress-ng: info:  [5892] cache allocate: default cache size: 2048K
    stress-ng: info:  [5892] successful run completed in 11.53s
    stress-ng: info:  [5892] stressor      bogo ops real time  usr time  sys time   bogo ops/s   bogo ops/s
    stress-ng: info:  [5892]                          (secs)    (secs)    (secs)   (real time) (usr+sys time)
    stress-ng: info:  [5892] cpu                126     10.50     81.49      0.58        12.00         1.54
    stress-ng: info:  [5892] cpu:
    stress-ng: info:  [5892]            118,145,351,216 CPU Cycles                    10.24 B/sec
    stress-ng: info:  [5892]             94,066,812,704 Instructions                   8.16 B/sec (0.796 instr. per cycle)
    stress-ng: info:  [5892]              6,383,299,240 Cache References               0.55 B/sec
    stress-ng: info:  [5892]                304,757,784 Cache Misses                  26.43 M/sec ( 4.77%)
    stress-ng: info:  [5892]                248,569,352 Branch Misses                 21.55 M/sec ( 0.00%)
    
    • 0

相关问题

  • 如何让“R”使用所有 CPU

  • 华硕上网本:应启用 CPUID 速度限制

  • 我可以更改/调查安装未完成的地方?

  • 如何获得 CPU 温度?

  • 禁用“按需”CPU 缩放守护程序

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve