cyclictest 交叉编译与使用

目录

  • 使用版本
  • 问题
  • 编译 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.mfbz.cn/a/211369.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

Android 中的权限

关于作者&#xff1a;CSDN内容合伙人、技术专家&#xff0c; 从零开始做日活千万级APP。 专注于分享各领域原创系列文章 &#xff0c;擅长java后端、移动开发、商业变现、人工智能等&#xff0c;希望大家多多支持。 目录 一、导读二、概览三、权限分类3.1 安装时权限3.2 运行时…

Java面试题(每天10题)-------连载(41)

目录 Spring篇 1、什么是Spring框架&#xff1f;Spring框架主要有哪些模块&#xff1f; 2、使用Spring框架能带来哪些好处&#xff1f; 3、什么是控制反转&#xff08;IOC&#xff09;&#xff1f;什么是依赖注入&#xff1f; 4、解释下Spring中的IoC? 5、BeanFactory和…

docker-compose Foxmic dt版

Foxmic dt 版前言 实现企业对资产的基本管理,包含对资产的登记、维修、调拨、转移等基本功能的支持,并提供对资产的耗材、库存进行管理,有完善的组织架构,非常适合中小企业的需求系统整体覆盖了基本的资产管理、合同管理、运维服务、运维服务、数据中心设备管理等多个模块。…

深入理解原码、反码、补码(结合C语言)

一、引出问题 在学习C语言单目操作符中~按位取反的过程中&#xff0c;对这样一段代码的结果产生了疑惑&#xff1a; #define _CRT_SECURE_NO_WARNINGS 1 #include <stdio.h>int main() {int a 0;int b ~a;//按位取反printf("%d\n", b);return 0; }输出结果…

使用trigger-forward跨流水线传递参数

参考文档&#xff1a;https://docs.gitlab.com/ee/ci/yaml/#triggerforward 今天给大家介绍一个gitlab CI/CD的关键字 - forward&#xff0c;该关键字是一个比较偏的功能&#xff0c;但同时也是一个很实用的功能&#xff0c;我们通过在gitlab的ci文件中使用forward关键字&#…

二叉树遍历及应用

文章目录 前言构建二叉树前序遍历中序遍历后序遍历二叉树的结点个数二叉树的叶节点个数二叉树的高度二叉树第K层结点个数 前言 二叉树的遍历及应用主要是运用了递归、分治的思想。在这一篇文章&#xff0c;小编将介绍二叉树的前序遍历、中序遍历、后序遍历&#xff0c;求二叉树…

renpy-renpy对话内容汉化

文章目录 前言思路实现1,提取对话内容2,汉化对话内容文件3,修改gui文件,使得renpy游戏支持中文显示 前言 最近下载了一些renpy视觉小说内容,发现对话都为英文,因此我在想能否提取出这些对话然后汉化后再封装回原文件,将其汉化 当然汉化过程是机器翻译,汉化其他语言同理,大概5分…

根文件系统构建-对busybox进行配置

一. 简介 本文来学习 根文件系统的制作中&#xff0c;关于 busybox的配置。 本文继上一篇 busybox中文支持的设置&#xff0c;地址如下&#xff1a; 根文件系统构建-busybox中文支持-CSDN博客 二. 根文件系统构建-busybox配置 1. 配置 busybox 与我们编译 Uboot 、 Lin…

阵列信号处理---频率-波数响应和波束方向图

波束延迟求和器 阵列是由一组全向阵元组成&#xff0c;阵元的位置为 p n p_n pn​&#xff0c;如下图所示&#xff1a; 阵元分别在对应的位置对信号进行空域采样&#xff0c;这样就产生了一组信号信号为 f ( t , p ) f(t,p) f(t,p),具体表示如下&#xff1a; f ( t , p ) [ f…

详解递归锁,以及递归锁与其他同步机制的区别

什么是递归锁 递归锁是一种多线程同步机制&#xff0c;用于解决线程在多次获取同一个锁时产生死锁的问题。在递归锁中&#xff0c;同一个线程可以多次获取同一个锁&#xff0c;而不会造成死锁。 递归锁具有两个主要操作&#xff1a;上锁&#xff08;lock&#xff09;和解锁&a…

OpenCV技术应用(5)— 将一幅图像均分成4幅图像

前言&#xff1a;Hello大家好&#xff0c;我是小哥谈。本节课就手把手教你如何将一幅图像均分成4幅图像&#xff0c;希望大家学习之后能够有所收获~&#xff01;&#x1f308; 目录 &#x1f680;1.技术介绍 &#x1f680;2.实现代码 &#x1f680;1.技术介绍 如果将下图…

【论文阅读】基于隐蔽带宽的汽车控制网络鲁棒认证(三)

文章目录 第六章 通过认证帧定时实现VulCAN的非once同步6.1 问题陈述6.2 方法概述6.3 动机和缺点6.3.1 认证帧定时隐蔽通信6.3.2 VulCAN 的 vatiCAN后端 Nonce同步的应用【这块是一点没看明白】 6.4 设计与实现6.4.1发送方6.4.2 接收方6.4.3 设计参数配置6.4.4 实现 6.5 安全注…

linux复习笔记06(小滴)

演练企业静态ip地址配置过程 我们有时候会发现&#xff0c;在使用虚拟机的时候&#xff0c;如果使用远程连接工具&#xff0c;我们会发现&#xff0c;有时候连接不上去&#xff0c;但是我们去用ifconfig去查看的时候&#xff0c;我们发现是ip地址换了。所以往往我们也需要去固…

SVN下载使用和说明

一、SVN <1>SVN的简介 1、svn是什么&#xff1f; 2、作用 3、基本操作 <2>服务器端的软件下载和安装 1、下载 2、查看环境变量 3、验证安装是否成功 <3>创建项目版本库 1、创建项目版本库&#xff08;svn reponsitory&#xff09; 2、svn版本控制文件说明…

BUUCTF [GXYCTF2019]SXMgdGhpcyBiYXNlPw== 1

BUUCTF:https://buuoj.cn/challenges 题目描述&#xff1a; 得到的 flag 请包上 flag{} 提交。 密文&#xff1a; 下载附件&#xff0c;解压得到flag.txt文件。 解题思路&#xff1a; 1、打开flag.txt文件&#xff0c;内容如下。 Q2V0dGUgbnVpdCwK SW50ZW5hYmxlIGluc29tbm…

7.C转python

1.对字典的各种操作都是对键来进行的 2.关于字典的遍历操作 例: 还可以这样遍历 所以生成了一个固定模版来遍历字典: 例: 那两个名字可以换 例: 3.合法key的类型: 要求可哈希 在python中,专门提供了一个hash()函数来计算哈希值 例: 有的类型是不能计算哈希的,如:列表,字…

Fabric:创建应用通道

搭建自定义网络可以参考文章&#xff1a; https://blog.csdn.net/yeshang_lady/article/details/134113296 1 创建通道 网络搭建完成之后&#xff0c;就可以开始创建通道了。Fabric V2.5.4中可以在不创建系统通道的情况下直接创建应用通道。 1.1 修改配置文件 先创建配置文…

QProcess 启动 进程 传参数 启动控制台进程 传参

目录 QProcess 启动外部程序的两种方式 依赖式 分离式&#xff1a; 启动进程前的预处理 设置启动路径 设置启动命令参数 设置启动工作目录 设置启动所需环境&#xff1a; 启动的状态 code smple: QProcess 控制台进程 QProcess启动控制台不显示窗口 注意&#xff1a;…

一、服务器准备

本案例使用VMware Workstation Pro虚拟机创建虚拟服务器来搭建Linux服务器集群&#xff0c;所用软件及版本如下&#xff1a; Centos7.7-64bit 1、三台虚拟机创建 第一种方式&#xff1a;通过iso镜像文件来进行安装(不推荐) 第二种方式&#xff1a;直接复制安装好的虚拟机文…

Linux多核飞控

Linux多核飞控是一种基于多核处理器构建的飞控系统&#xff0c;用于控制飞行器的飞行。这种飞控系统使用Linux操作系统作为主要的控制平台&#xff0c;可以支持多个处理器核心同时工作&#xff0c;以实现更高的性能和更快的响应速度。 Linux通常用于具有较高计算量和较大内存需…
最新文章