14 Star 0 Fork 3

src-openEuler/rt-tests

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
rt-tests-cyclictest-Don-t-allow-OPT_SYSTEM-with-OPT_.patch 1.32 KB
一键复制 编辑 原始数据 按行查看 历史
RyanL 提交于 2023-02-23 15:46 +08:00 . Package init
From 0bf35a2fb58177318353c3a2e02df5b20728d5b9 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Mon, 16 Sep 2019 23:43:32 +0200
Subject: [PATCH 4/5] rt-tests: cyclictest: Don't allow OPT_SYSTEM with
OPT_POSIX_TIMERS
OPT_SYSTEM means use sys_nanosleep and sys_setitimer
if you try to combine it with OPT_POSIX_TIMERS, it breaks.
cyclictest becomes unkillable with ctrl-C and only the first thread is
updated.
Fix this by issuing a warning if the user tries to combine the two
options and then use clock_nanosleep.
Reported-by: Tom Rix <trix@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/cyclictest/cyclictest.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 3a78912b34f8..6be0525822ca 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -1353,6 +1353,13 @@ static void process_options (int argc, char *argv[], int max_cpus)
}
}
+ if ((use_system == MODE_SYS_OFFSET) && (use_nanosleep == MODE_CYCLIC)) {
+ warn("The system option requires clock_nanosleep\n");
+ warn("and is not compatible with posix_timers\n");
+ warn("Using clock_nanosleep\n");
+ use_nanosleep = MODE_CLOCK_NANOSLEEP;
+ }
+
/* if smp wasn't requested, test for numa automatically */
if (!smp) {
#ifdef NUMA
--
2.20.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/rt-tests.git
git@gitee.com:src-openeuler/rt-tests.git
src-openeuler
rt-tests
rt-tests
master

搜索帮助