在CentOS7 上编译运行 RT-test工具cyclictest 及patch kernel
来源:互联网 发布:windows安装bugfree 编辑:程序博客网 时间:2024/06/07 13:31
realtime 工具使用cyclictest ,我的linux环境是CentOS7
分为两部分:安装RT-test cyclictest ; 给kernel 打patch
第一部分,下载安装Cyclictest , 我下载的是rt-test-1.0
# wget https:://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git
#cd rt-tests
[root@localhost RT_test]# cd rt-tests-1.0/
[root@localhost rt-tests-1.0]# ls
[root@localhost RT_test]# make all
此时编译报错:compile failure because numa.h can't be found
需要执行以下步骤
[root@localhost rt-tests-1.0]# yum install numactl-devel
再次make就compile成功
[root@localhost rt-tests-1.0]# cyclictest --help
cyclictest V 1.00
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
-B --preemptirqs both preempt and irqsoff tracing (used with -b)
-c CLOCK --clock=CLOCK select clock
0 = CLOCK_MONOTONIC (default)
...
可以查看到各项命令,安装成功
开始使用工具:
[root@localhost rt-tests-1.0]# cyclictest -c CLOCK
报错:
Unable to changescheduling policy!
Probably missingcapabilities, either run as root or increase RLIMIT_RTPRIO limits.
这时需要给kernel 打 patch
部分二,下载相应kernel 版本及patch,kernel 和 patch 的版本应尽量相同,不然后续会出现其他问题
首先查看我的kernel版本
[root@localhost rt-tests-1.0]# uname -r
3.10.0-327.36.3.el7.x86_64
查看原先版本
[root@localhost rt-tests-1.0]# ls /boot/config-*
然后我选择下载3.12.66 版本,patch为patch-3.12.66-rt88.patch.gz
[root@localhost rt-tests-1.0]# wget https://www.kernel.org/pub/linux/kernel/projects/rt/3.12/patch-3.12.66-rt88.patch.gz
[root@localhost rt-tests-1.0]# wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.12.66.tar.gz
[root@localhost rt-tests-1.0]# tar -xvzf linux-3.12.66.tar.gz
[root@localhost rt-tests-1.0]# ls
bld linux-3.12.66.tar.gz pmqtest signaltest
COPYING MAINTAINERS ptsematest sigwaittest
cyclictest Makefile README.markdown src
hackbench patch-3.12.66-rt88.patch.gz rt-migrate-test svsematest
hwlatdetect pip_stress RT_test
linux-3.12.66 pi_stress sendme
[root@localhost rt-tests-1.0]# cd linux-3.12.66/
开始patch
[root@localhost linux-3.12.66]# zcat ../patch-3.10.75-rt80.patch.gz | patch -p1
将原先存在的.config 文件写到kernel source
[root@localhost linux-3.12.66]# cp /boot/config-3.10.0-327.36.3.el7.x86_64 .config
compile 原始kernel,更改一些参数
[root@localhost linux-3.12.66]# make oldconfig
得到 .config 文件编译kernel
[root@localhost linux-3.12.66]# make
compile the modules which were marked in .config and install them in the required locations:
[root@localhost linux-3.12.66]# make modules_install install
Update the boot configuration for Grub
[root@localhost linux-3.12.66]# /usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfgreboot 查看kernel version
[root@localhost linux-3.12.66]# uname -r
3.12.66-rt88
然后开始使用 cyclictest RT- test 工具
如果reboot 后还是启动原先版本,需要更改 /boot/grub2/grub.cfg 里面的参数,见上篇blog
- 在CentOS7 上编译运行 RT-test工具cyclictest 及patch kernel
- Linux RT(1)-硬实时Linux(RT-Preempt Patch)在PC上的编译、使用和测试
- Linux RT(1)-硬实时Linux(RT-Preempt Patch)在PC上的编译、使用和测试
- 硬实时Linux(RT-Preempt Patch)在PC上的编译、使用和测试
- 在Ubuntu上下载、编译、运行Android内核Linux Kernel
- Ubuntu16.04交叉编译树莓派Linux-Kernel并打RT-Patch
- kernel build & preempt-rt patch & xenomai
- 在centos7 上编译trackRT
- 使用自己编译的在Android上运行的内核(Linux Kernel)
- 使用自己编译的在Android上运行的内核(Linux Kernel)
- 在Mac上编译uboot,linux kernel
- ffmpeg在centos7上的编译
- 树梅派kernel的编译与patch
- RT test
- ucos在s3c2410上运行过程整体剖析-- 整体运行环境及工具说明
- ucos在s3c2410上运行过程整体剖析(8)-- 整体运行环境及工具说明 .
- RT—thread 上的1588协议在stm32上实现代码及说明
- RT-patch阅读记录
- NSURLSession下载与缓存
- super(Dict) / zip(names, values) python
- 很认真的聊一聊程序员的自我修养(转自博客园)
- SVN简介
- JNI完全指南(七)——多线程
- 在CentOS7 上编译运行 RT-test工具cyclictest 及patch kernel
- Java基础方面:
- map.Entry初学
- 用Hexo + github搭建自己的博客 --- 再也不用羡慕别人了!
- 51nod 1337 翻转游戏
- linearlayout1
- JAVA代码覆盖率工具JaCoCo-踩坑篇
- Android下分析内存泄露
- EJB方面