cyclictest 交叉编译与使用

2023-12-03 04:36

本文主要是介绍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 CPUSETgiven, 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 fifththreads on CPU (0),thread #2 on CPU 3, thread #3on 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 clock0 = 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 youto 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 runUS is the max latency time to be tracked in microsecondsThis 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 cyclictestThis will give you poorer realtime resultsbut will not drain your battery so quickly--latency=PM_QOS  power management latency target valueThis value is written to /dev/cpu_dma_latencyand affects c-states. The default is 0
-l LOOPS --loops=LOOPS     number of loops: default=0(endless)--mainaffinity=CPUSETRun the main thread on CPU #N. This only affectsthe 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 maxlatency 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 oneof: 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() manytimes.  List of clock_gettime() values will bereported with -X--secaligned [USEC] align thread wakeups to the next full secondand apply the optional offset
-s       --system          use sys_nanosleep and sys_setitimer
-S       --smp             Standard SMP testing: options -a -t and same priorityof 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_cpuswithout -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 statisticsformat: 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

这篇关于cyclictest 交叉编译与使用的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/448087

相关文章

中文分词jieba库的使用与实景应用(一)

知识星球:https://articles.zsxq.com/id_fxvgc803qmr2.html 目录 一.定义: 精确模式(默认模式): 全模式: 搜索引擎模式: paddle 模式(基于深度学习的分词模式): 二 自定义词典 三.文本解析   调整词出现的频率 四. 关键词提取 A. 基于TF-IDF算法的关键词提取 B. 基于TextRank算法的关键词提取

使用SecondaryNameNode恢复NameNode的数据

1)需求: NameNode进程挂了并且存储的数据也丢失了,如何恢复NameNode 此种方式恢复的数据可能存在小部分数据的丢失。 2)故障模拟 (1)kill -9 NameNode进程 [lytfly@hadoop102 current]$ kill -9 19886 (2)删除NameNode存储的数据(/opt/module/hadoop-3.1.4/data/tmp/dfs/na

Hadoop数据压缩使用介绍

一、压缩原则 (1)运算密集型的Job,少用压缩 (2)IO密集型的Job,多用压缩 二、压缩算法比较 三、压缩位置选择 四、压缩参数配置 1)为了支持多种压缩/解压缩算法,Hadoop引入了编码/解码器 2)要在Hadoop中启用压缩,可以配置如下参数

Makefile简明使用教程

文章目录 规则makefile文件的基本语法:加在命令前的特殊符号:.PHONY伪目标: Makefilev1 直观写法v2 加上中间过程v3 伪目标v4 变量 make 选项-f-n-C Make 是一种流行的构建工具,常用于将源代码转换成可执行文件或者其他形式的输出文件(如库文件、文档等)。Make 可以自动化地执行编译、链接等一系列操作。 规则 makefile文件

使用opencv优化图片(画面变清晰)

文章目录 需求影响照片清晰度的因素 实现降噪测试代码 锐化空间锐化Unsharp Masking频率域锐化对比测试 对比度增强常用算法对比测试 需求 对图像进行优化,使其看起来更清晰,同时保持尺寸不变,通常涉及到图像处理技术如锐化、降噪、对比度增强等 影响照片清晰度的因素 影响照片清晰度的因素有很多,主要可以从以下几个方面来分析 1. 拍摄设备 相机传感器:相机传

pdfmake生成pdf的使用

实际项目中有时会有根据填写的表单数据或者其他格式的数据,将数据自动填充到pdf文件中根据固定模板生成pdf文件的需求 文章目录 利用pdfmake生成pdf文件1.下载安装pdfmake第三方包2.封装生成pdf文件的共用配置3.生成pdf文件的文件模板内容4.调用方法生成pdf 利用pdfmake生成pdf文件 1.下载安装pdfmake第三方包 npm i pdfma

零基础学习Redis(10) -- zset类型命令使用

zset是有序集合,内部除了存储元素外,还会存储一个score,存储在zset中的元素会按照score的大小升序排列,不同元素的score可以重复,score相同的元素会按照元素的字典序排列。 1. zset常用命令 1.1 zadd  zadd key [NX | XX] [GT | LT]   [CH] [INCR] score member [score member ...]

git使用的说明总结

Git使用说明 下载安装(下载地址) macOS: Git - Downloading macOS Windows: Git - Downloading Windows Linux/Unix: Git (git-scm.com) 创建新仓库 本地创建新仓库:创建新文件夹,进入文件夹目录,执行指令 git init ,用以创建新的git 克隆仓库 执行指令用以创建一个本地仓库的

【北交大信息所AI-Max2】使用方法

BJTU信息所集群AI_MAX2使用方法 使用的前提是预约到相应的算力卡,拥有登录权限的账号密码,一般为导师组共用一个。 有浏览器、ssh工具就可以。 1.新建集群Terminal 浏览器登陆10.126.62.75 (如果是1集群把75改成66) 交互式开发 执行器选Terminal 密码随便设一个(需记住) 工作空间:私有数据、全部文件 加速器选GeForce_RTX_2080_Ti

【Linux 从基础到进阶】Ansible自动化运维工具使用

Ansible自动化运维工具使用 Ansible 是一款开源的自动化运维工具,采用无代理架构(agentless),基于 SSH 连接进行管理,具有简单易用、灵活强大、可扩展性高等特点。它广泛用于服务器管理、应用部署、配置管理等任务。本文将介绍 Ansible 的安装、基本使用方法及一些实际运维场景中的应用,旨在帮助运维人员快速上手并熟练运用 Ansible。 1. Ansible的核心概念