• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

rt-tests: This repository contains some programs that test various rt-linux feat ...

原作者: [db:作者] 来自: 网络 收藏 邀请

RT-Tests

This repository contains some programs that test various rt-linux features.

Usage

Compile

sudo apt-get install build-essential libnuma-devmake

Run tests

To run one test thread per CPU or per CPU core, each thread on a separateprocessor, type

sudo ./cyclictest -a -t -n -p99

On a non-realtime system, you may see something like

T: 0 ( 3431) P:99 I:1000 C: 100000 Min:      5 Act:   10 Avg:   14 Max:   39242T: 1 ( 3432) P:98 I:1500 C:  66934 Min:      4 Act:   10 Avg:   17 Max:   39661

The rightmost column contains the most important result, i.e. the worst-caselatency of 39.242 milliseconds. On a realtime-enabled system, the result maylook like

T: 0 ( 3407) P:99 I:1000 C: 100000 Min:      7 Act:   10 Avg:   10 Max:      18T: 1 ( 3408) P:98 I:1500 C:  67043 Min:      7 Act:    8 Avg:   10 Max:      22

and, thus, indicate an apparent short-term worst-case latency of 18microseconds.

Running cyclictest only over a short period of time and without creatingappropriate real-time stress conditions is rather meaningless, since theexecution of an asynchronous event from idle state is normally always quitefast, and every - even non-RT system - can do that. The challenge is to minimizethe latency when reacting to an asynchronuous event, irrespective of what codepath is executed at the time when the external event arrives.Therefore, specific stress conditions must be present while cyclictest isrunning to reliably determine the worst-case latency of a given system.

Latency fighting

If - as in the above example - a low worst-case latency is measured, and this isthe case even under a system load that is equivalent to the load expected underproduction conditions, everything is alright.Of course, the measurement must last suffciently long, preferably 24 hours ormore to run several hundred million test threads. If possible, the -i commandline option (thread interval) should be used to increase the number of testthreads over time.As a role of thumb, the thread interval should be set to a value twice as longas the expected worst-case latency. If at the end of such a test period theworst-cae latency still did not exceed the value that is assumed critical for agiven system, the particular kernel in combination with the hardware in use canthen probably be regarded as real-time capable.

What, however, if the latency is higher than acceptable? Then, the famous"latency fighting" begins. For this purpose, the cyclictest tool provides the-b option that causes a function tracing to be written to/sys/kernel/debug/tracing/trace, if a specified latency threshold wasexceeded, for example:

./cyclictest -a -t -n -p99 -f -b100

This causes the program to abort execution, if the latency value exceeds 100microseconds; the culprit can then be found in the trace output at/sys/kernel/debug/tracing/trace.The kernel function that was executed just before a latency of more than 100microseconds was detected is marked with an exclamation mark such as

qemu-30047 2D.h3 742805us : __activate_task+0x42/0x68 <cyclicte-426> (199 1)qemu-30047 2D.h3 742806us : __trace_start_sched_wakeup+0x40/0x161 <cyclicte-426> (0 -1)qemu-30047 2DNh3 742806us!: try_to_wake_up+0x422/0x460 <cyclicte-426> (199 -5)qemu-30047 2DN.1 742939us : __sched_text_start+0xf3/0xdcd (c064e442 0)

The first column indicates the calling process responsible for triggering thelatency.

If the trace output is not obvious, it can be submitted to the OSADL LatencyFight Support Service at[email protected].In addition to the output of cat /sys/kernel/debug/tracing/trace, the outputof lspci and the .config file that was used to build the kernel in questionmust be submitted. We are sure you understand that OSADL members will be servedfirst, but we promise to do our best to help everybody to successfully fightagainst kernel and driver latencies.


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
hamcrest-php: PHP Hamcrest implementation发布时间:2022-02-13
下一篇:
PatatiumWebUi: 基于selenium webdriver 自动化测试框架发布时间:2022-02-13
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap