cyclictest 交叉编译与使用

news2025/2/27 13:03:25

目录

  • 使用版本
  • 问题
  • 编译 numactl
  • 编译 cyclictest
  • 使用
  • 参考

cyclictest 主要是用于测试系统延时,进而判断系统的实时性

使用版本

rt-tests-2.6.tar.gz
numactl v2.0.16

问题

编译时,需要先编译 numactl ,不然会有以下报错:

arm-linux-gnueabihf-gcc -D VERSION=2.6 -c src/cyclictest/cyclictest.c -Wall -Wno-nonnull -Wextra -O2 -g -D_GNU_SOURCE -Isrc/include   -o bld/cyclictest.o
In file included from src/cyclictest/cyclictest.c:33:
src/cyclictest/rt_numa.h:18:10: fatal error: numa.h: 没有那个文件或目录
 #include <numa.h>
          ^~~~~~~~
compilation terminated.
Makefile:106: recipe for target 'bld/cyclictest.o' failed
make: *** [bld/cyclictest.o] Error 1

在这里插入图片描述

编译 numactl

文件下载 https://github.com/numactl/numactl/tree/v2.0.16

编译命令:

./autogen.sh
./configure CC=arm-linux-gnueabihf-gcc --host=arm  prefix=~/git/numactl-2.0.16/build
make install

这是主要用到编译生成的 libinclude 里的文件

编译 cyclictest

下载文件 :

https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/

打开 Makefile 文件:

RTTESTLIB 后面加上 -L/home/XXX/git/numactl-2.0.16/build/lib
CPPFLAGS 后面加上 -I/home/XXX/git/numactl-2.0.16/build/include

RTTESTLIB = -lrttest -L$(OBJDIR) -L/home/XXX/git/numactl-2.0.16/build/lib
CPPFLAGS += -D_GNU_SOURCE -Isrc/include  -I/home/XXX/git/numactl-2.0.16/build/include

然后使用编译命令

make CROSS_COMPILE=arm-linux-gnueabihf- LDFLAGS=-static

即可在目录中看到 cyclictest

使用

cyclictest V 2.60
Usage:
cyclictest <options>

-a [CPUSET] --affinity     Run thread #N on processor #N, if possible, or if CPUSET
                           given, pin threads to that set of processors in round-
                           robin order.  E.g. -a 2 pins all threads to CPU 2,
                           but -a 3-5,0 -t 5 will run the first and fifth
                           threads on CPU (0),thread #2 on CPU 3, thread #3
                           on CPU 4, and thread #5 on CPU 5.
-A USEC  --aligned=USEC    align thread wakeups to a specific offset
-b USEC  --breaktrace=USEC send break trace command when latency > USEC
-c CLOCK --clock=CLOCK     select clock
                           0 = CLOCK_MONOTONIC (default)
                           1 = CLOCK_REALTIME
         --default-system  Don't attempt to tune the system from cyclictest.
                           Power management is not suppressed.
                           This might give poorer results, but will allow you
                           to discover if you need to tune the system
-d DIST  --distance=DIST   distance of thread intervals in us, default=500
-D       --duration=TIME   specify a length for the test run.
                           Append 'm', 'h', or 'd' to specify minutes, hours or days.
-F       --fifo=<path>     create a named pipe at path and write stats to it
-h       --histogram=US    dump a latency histogram to stdout after the run
                           US is the max latency time to be tracked in microseconds
                           This option runs all threads at the same priority.
-H       --histofall=US    same as -h except with an additional summary column
         --histfile=<path> dump the latency histogram to <path> instead of stdout
-i INTV  --interval=INTV   base interval of thread in us default=1000
         --json=FILENAME   write final results into FILENAME, JSON formatted
         --laptop          Save battery when running cyclictest
                           This will give you poorer realtime results
                           but will not drain your battery so quickly
         --latency=PM_QOS  power management latency target value
                           This value is written to /dev/cpu_dma_latency
                           and affects c-states. The default is 0
-l LOOPS --loops=LOOPS     number of loops: default=0(endless)
         --mainaffinity=CPUSET
                           Run the main thread on CPU #N. This only affects
                           the main thread and not the measurement threads
-m       --mlockall        lock current and future memory allocations
-M       --refresh_on_max  delay updating the screen until a new max
                           latency is hit. Useful for low bandwidth.
-N       --nsecs           print results in ns instead of us (default us)
-o RED   --oscope=RED      oscilloscope mode, reduce verbose output by RED
-p PRIO  --priority=PRIO   priority of highest prio thread
         --policy=NAME     policy of measurement thread, where NAME may be one
                           of: other, normal, batch, idle, fifo or rr.
         --priospread      spread priority levels starting at specified value
-q       --quiet           print a summary only on exit
-r       --relative        use relative timer instead of absolute
-R       --resolution      check clock resolution, calling clock_gettime() many
                           times.  List of clock_gettime() values will be
                           reported with -X
         --secaligned [USEC] align thread wakeups to the next full second
                           and apply the optional offset
-s       --system          use sys_nanosleep and sys_setitimer
-S       --smp             Standard SMP testing: options -a -t and same priority
                           of all threads
        --spike=<trigger>  record all spikes > trigger
        --spike-nodes=[num of nodes]
                           These are the maximum number of spikes we can record.
                           The default is 1024 if not specified
-t       --threads         one thread per available processor
-t [NUM] --threads=NUM     number of threads:
                           without NUM, threads = max_cpus
                           without -t default = 1
         --tracemark       write a trace mark when -b latency is exceeded
-u       --unbuffered      force unbuffered output for live processing
-v       --verbose         output values on stdout for statistics
                           format: n:c:v n=tasknum c=count v=value in us
         --dbg_cyclictest  print info useful for debugging cyclictest
-x       --posix_timers    use POSIX timers instead of clock_nanosleep.

使用命令

./cyclictest  -S -p 95  -D 1m -m -i 1000 -d 0

-S 为每个核一个线程,-D 执行一分钟

在这里插入图片描述


./cyclictest   -p 95  -D 1m -m -i 1000 -d 0 -t 10 -a 5-7

-t 设置 10 个线程, -a 设置在核 5-7上跑

在这里插入图片描述

T:   线程序号
P:   线程优先级
C:   线程执行次数
I:   线程运行间隔(us)
Min: 最小延时(us)
Act: 最近一次的延时(us)
Avg:平均延时(us)
Max:最大延时(us)

参考

https://github.com/CJTSAJ/jailhouse-learning/blob/master/%E4%BA%A4%E5%8F%89%E7%BC%96%E8%AF%91cyclictest.md
https://zhuanlan.zhihu.com/p/336381111

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1278413.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Linux:优化原则

web系统的优化原则&#xff1a; 从单机到集群 对Linux系统自身的优化原则&#xff1a;

TCP报文解析

1.端口号 标记同一台计算机上的不同进程 源端口&#xff1a;占2个字节&#xff0c;源端口和IP的作用是标记报文的返回地址。 目的端口&#xff1a;占2个字节&#xff0c;指明接收方计算机上的应用程序接口。 TCP报头中的源端口号和目的端口号同IP报头中的源IP和目的IP唯一确定一…

【QT】Windows环境下,cmake引入QML

这里使用的QT库为5.7版本。 1、添加环境变量 QT库根目录环境变量 QTDIR QT库平台插件环境变量 QT_PLUGIN_PATH QML支持环境变量 QML2_IMPORT_PATH &#xff08;该环境变量仅在需要使用QML时添加&#xff09; QT库动态库环境变量&#xff0c;bin目录下包含了QT程序运行所需的dl…

电子学会C/C++编程等级考试2022年03月(四级)真题解析

C/C++等级考试(1~8级)全部真题・点这里 第1题:拦截导弹 某国为了防御敌国的导弹袭击, 发展出一种导弹拦截系统。 但是这种导弹拦截系统有一个缺陷: 虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能高于前一发的高度。 某天, 雷达捕捉到敌国的导弹来袭。…

第十一届蓝桥杯青少组省赛Python中高级组真题及赏析

练习最好的办法就是实战。拿真题来做&#xff0c;不是解析是赏析。带着欣赏的眼光看&#xff0c;题目不但不难&#xff0c;反倒增加不少乐趣。接下来揭开第十一届蓝桥杯青少组省赛python编程题的神秘面纱&#xff0c;我们来一一赏析&#xff0c;看难不难。 选择题 选择题都比较…

C++核心编程——类与对象基础

C核心编程——类与对象基础 类与对象封装构造函数普通构造拷贝构造初始化成员列表&#xff08;补充&#xff09; 析构函数对象数组对象指针指向对象的指针指向对象成员的指针this指针 静态成员静态数据成员静态成员函数 友元普通函数做友元函数友元成员函数友元类 类与对象 C面…

深度学习常见回归分支算法逐步分析,各种回归之间的优缺点,适用场景,举例演示

文章目录 1、线性回归&#xff08;Linear Regression&#xff09;1.1 优点1.2 缺点1.3 适用场景1.4 图例说明 2、多项式回归&#xff08;Polynomial Regression&#xff09;2.1 优点2.2 缺点2.3 适用场景2.4 图例说明 3、决策树回归&#xff08;Decision Tree Regression&#…

Linux基础命令(超全面,建议收藏!)

一、Linux的目录结构 /&#xff0c;根目录是最顶级的目录了 Linux只有一个顶级目录&#xff1a;/ 路径描述的层次关系同样使用/来表示 /home/itheima/a.txt&#xff0c;表示根目录下的home文件夹内有itheima文件夹&#xff0c;内有a.txt 二、Linux命令基础格式 无论是什么…

孩子都能学会的FPGA:第十八课——用FPGA实现定点数的除法

&#xff08;原创声明&#xff1a;该文是作者的原创&#xff0c;面向对象是FPGA入门者&#xff0c;后续会有进阶的高级教程。宗旨是让每个想做FPGA的人轻松入门&#xff0c;作者不光让大家知其然&#xff0c;还要让大家知其所以然&#xff01;每个工程作者都搭建了全自动化的仿…

vivado实现分析与收敛技巧6-策略建议

典型时序收敛策略需运行大量实现策略并选取其中最佳的策略以供在实验室内应用。 ML 策略同样可选 &#xff0c; 且只需您运行3 项策略即可达成类似的 QoR 收益。这些策略使用机器学习来检验布线后设计的各项功能特性 &#xff0c; 以便预测相同设计上不同策略的性能。在 repo…

树莓派4b安装ubuntu22和向日葵设置开机启动

树莓派4b安装ubuntu22和向日葵设置开机启动 使用树莓派烧录系统工具烧录ubuntu 在树莓派官网下载官方软件&#xff0c;安装完后运行 在软件上选择 选择ubuntu桌面或者server 根据自己需求选择&#xff0c;这里我选择22.04的系统 烧录好以后进入系统 安装向日葵 下载树莓…

Android实验:启动式service

目录 实验目的实验内容实验要求项目结构代码实现结果展示 实验目的 充分理解Service的作用&#xff0c;与Activity之间的区别&#xff0c;掌握Service的生命周期以及对应函数&#xff0c;了解Service的主线程性质&#xff1b;掌握主线程的界面刷新的设计原则&#xff0c;掌握启…

如何在WordPress中批量替换图片路径?

很多站长在使用WordPress博客或者搬家时&#xff0c;需要把WordPress文章中的图片路径进行替换来解决图片不显示的问题。总结一下WordPress图片路径批量替换的过程&#xff0c;方便有此类需求的站长们学习。 什么情况下批量替换图片路径 1、更换了网站域名 有许多网站建设初期…

一文了解工业互联网是什么,和传统互联网的区别有哪些

几个问题 工业互联网和传统互联网有什么区别 1 业务方面&#xff0c;传统的互联网企业更多是toC的业务&#xff0c;直接面对的是一个个的个体&#xff0c;而工业互联网离消费者更远一点&#xff0c;往往是toB或者toG的&#xff1b; 个人认为这也是最根本的区别&#xff0c;由…

什么是Daily Scrum?

Daily Scrum&#xff08;每日站会&#xff09;&#xff0c;Scrum Master要确保这个会在每天都会开。这个会的目的就是检查正在做的东西和方式是否有利于完成Sprint目的&#xff0c;并及时做出必要的调整。 每日站会一般只开15分钟&#xff0c;为了让事情更简单些&#xff0c;这…

网上选课系统源码(Java)

JavaWebjsp网上选课系统源码 运行示意图&#xff1a;

spring boot定时器实现定时同步数据

文章目录 目录 文章目录 前言 一、依赖和目录结构 二、使用步骤 2.1 两个数据源的不同引用配置 2.2 对应的mapper 2.3 定时任务处理 总结 前言 一、依赖和目录结构 <dependencies><dependency><groupId>org.springframework.boot</groupId><artifa…

每日一练:阿姆斯特朗数

1. 概述 阿姆斯特朗数&#xff08;Armstrong number&#xff09;&#xff0c;也称为自恋数、自幂数&#xff08;narcissistic number&#xff09;、水仙花数&#xff0c;是指一个n位数&#xff08;n≥3&#xff09;&#xff0c;它的每个位上的数字的n次幂之和等于它本身。换句话…

模拟退火算法 Simulated Annealing

模拟退火算法 Simulated Annealing 1. 介绍 模拟退火算法&#xff08;Simulated Annealing, SA&#xff09;是一种启发式的优化算法。它适用于在大型离散或连续复杂问题中寻找全局最优解&#xff0c;例如组合优化&#xff0c;约束优化&#xff0c;图问题等。模拟退火是一种随…

Java多线程技术二:线程间通信——wait/notify机制

1 概述 线程时操作系统中独立的个体&#xff0c;但这些个体如果不经过特殊的处理是不能成为一个整体的。线程间的通信就是使线程成为整体的比用方案之一&#xff0c;可以说&#xff0c;是线程间进行通信后系统之间的交互性会更强大&#xff0c;CPU利用率会得以大幅提高&#xf…