-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
rcitach
committed
Nov 5, 2024
1 parent
d65c5c1
commit 0f51c89
Showing
7 changed files
with
310 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
diff --git a/Makefile b/Makefile | ||
index 5110357..569adc1 100644 | ||
--- a/Makefile | ||
+++ b/Makefile | ||
@@ -172,6 +172,7 @@ install: all install_hwlatdetect | ||
gzip -c src/cyclictest/cyclictest.8 >"$(DESTDIR)$(mandir)/man8/cyclictest.8.gz" | ||
gzip -c src/pi_tests/pi_stress.8 >"$(DESTDIR)$(mandir)/man8/pi_stress.8.gz" | ||
gzip -c src/ptsematest/ptsematest.8 >"$(DESTDIR)$(mandir)/man8/ptsematest.8.gz" | ||
+ gzip -c src/rt-migrate-test/rt-migrate-test.8 >"$(DESTDIR)$(mandir)/man8/rt-migrate-test.8.gz" | ||
gzip -c src/sigwaittest/sigwaittest.8 >"$(DESTDIR)$(mandir)/man8/sigwaittest.8.gz" | ||
gzip -c src/svsematest/svsematest.8 >"$(DESTDIR)$(mandir)/man8/svsematest.8.gz" | ||
gzip -c src/pmqtest/pmqtest.8 >"$(DESTDIR)$(mandir)/man8/pmqtest.8.gz" | ||
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c | ||
index 00e5f3d..3f1bef1 100644 | ||
--- a/src/cyclictest/cyclictest.c | ||
+++ b/src/cyclictest/cyclictest.c | ||
@@ -927,10 +927,14 @@ static int has_smi_counter(void) | ||
case 0x56: /* BDX-DE */ | ||
case 0x4E: /* SKL */ | ||
case 0x5E: /* SKL */ | ||
+ case 0x8E: /* KBL */ | ||
+ case 0x9E: /* KBL */ | ||
+ case 0x55: /* SKX */ | ||
case 0x37: /* BYT */ | ||
case 0x4D: /* AVN */ | ||
case 0x4C: /* AMT */ | ||
case 0x57: /* PHI */ | ||
+ case 0x5C: /* BXT */ | ||
break; | ||
default: | ||
return 0; | ||
@@ -1684,7 +1688,6 @@ static void process_options (int argc, char *argv[], int max_cpus) | ||
case 'R': | ||
case OPT_RESOLUTION: | ||
check_clock_resolution = 1; break; | ||
- case 's': | ||
case OPT_SECALIGNED: | ||
secaligned = 1; | ||
if (optarg != NULL) | ||
@@ -1694,6 +1697,7 @@ static void process_options (int argc, char *argv[], int max_cpus) | ||
else | ||
offset = 0; | ||
break; | ||
+ case 's': | ||
case OPT_SYSTEM: | ||
use_system = MODE_SYS_OFFSET; break; | ||
case 'S': | ||
diff --git a/src/rt-migrate-test/rt-migrate-test.c b/src/rt-migrate-test/rt-migrate-test.c | ||
index d7b68dd..0a0bb77 100644 | ||
--- a/src/rt-migrate-test/rt-migrate-test.c | ||
+++ b/src/rt-migrate-test/rt-migrate-test.c | ||
@@ -20,9 +20,6 @@ | ||
* | ||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
*/ | ||
-#ifndef _GNU_SOURCE | ||
-#define _GNU_SOURCE | ||
-#endif | ||
#include <stdio.h> | ||
#ifndef __USE_XOPEN2K | ||
# define __USE_XOPEN2K |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c | ||
index 3f1bef1..dc33eca 100644 | ||
--- a/src/cyclictest/cyclictest.c | ||
+++ b/src/cyclictest/cyclictest.c | ||
@@ -25,7 +25,6 @@ | ||
#include <time.h> | ||
#include <errno.h> | ||
#include <limits.h> | ||
-#include <linux/unistd.h> | ||
|
||
#include <sys/prctl.h> | ||
#include <sys/stat.h> | ||
@@ -56,7 +55,7 @@ | ||
|
||
/* Ugly, but .... */ | ||
#define gettid() syscall(__NR_gettid) | ||
-#define sigev_notify_thread_id _sigev_un._tid | ||
+#define sigev_notify_thread_id __sev_fields.sigev_notify_thread_id | ||
|
||
#ifdef __UCLIBC__ | ||
#define MAKE_PROCESS_CPUCLOCK(pid, clock) \ | ||
@@ -1009,18 +1008,18 @@ static void *timerthread(void *param) | ||
sigprocmask(SIG_BLOCK, &sigset, NULL); | ||
|
||
if (par->mode == MODE_CYCLIC) { | ||
- sigev.sigev_notify = SIGEV_THREAD_ID | SIGEV_SIGNAL; | ||
+ sigev.sigev_notify = 4 | SIGEV_SIGNAL; | ||
sigev.sigev_signo = par->signal; | ||
- sigev.sigev_notify_thread_id = stat->tid; | ||
+ // sigev.sigev_notify_thread_id = stat->tid; | ||
timer_create(par->clock, &sigev, &timer); | ||
tspec.it_interval = interval; | ||
} | ||
|
||
memset(&schedp, 0, sizeof(schedp)); | ||
schedp.sched_priority = par->prio; | ||
- if (setscheduler(0, par->policy, &schedp)) | ||
- fatal("timerthread%d: failed to set priority to %d\n", | ||
- par->cpu, par->prio); | ||
+ if (setscheduler(0, par->policy, &schedp)) | ||
+ fatal("timerthread%d: failed to set priority to %d\n", | ||
+ par->cpu, par->prio); | ||
|
||
if(smi) { | ||
par->msr_fd = open_msr_file(par->cpu); | ||
@@ -1257,7 +1256,7 @@ out: | ||
close(par->msr_fd); | ||
/* switch to normal */ | ||
schedp.sched_priority = 0; | ||
- sched_setscheduler(0, SCHED_OTHER, &schedp); | ||
+ // sched_setscheduler(0, SCHED_OTHER, &schedp); | ||
stat->threadstarted = -1; | ||
|
||
return NULL; | ||
@@ -2195,8 +2194,8 @@ int main(int argc, char **argv) | ||
|
||
process_options(argc, argv, max_cpus); | ||
|
||
- if (check_privs()) | ||
- exit(EXIT_FAILURE); | ||
+ // if (check_privs()) | ||
+ // exit(EXIT_FAILURE); | ||
|
||
if (verbose) | ||
printf("Max CPUs = %d\n", max_cpus); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
diff --git a/Makefile b/Makefile | ||
index 569adc1..3fae87e 100644 | ||
--- a/Makefile | ||
+++ b/Makefile | ||
@@ -98,7 +98,7 @@ $(OBJDIR): | ||
mkdir $(OBJDIR) | ||
|
||
# Include dependency files, automatically generate them if needed. | ||
--include $(addprefix $(OBJDIR)/,$(sources:.c=.d)) | ||
+# -include $(addprefix $(OBJDIR)/,$(sources:.c=.d)) | ||
|
||
cyclictest: $(OBJDIR)/cyclictest.o $(OBJDIR)/librttest.a | ||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB) $(NUMA_LIBS) | ||
@@ -162,7 +162,7 @@ rebuild: | ||
$(MAKE) all | ||
|
||
.PHONY: install | ||
-install: all install_hwlatdetect | ||
+install: install_hwlatdetect | ||
mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(mandir)/man4" | ||
mkdir -p "$(DESTDIR)$(srcdir)" "$(DESTDIR)$(mandir)/man8" | ||
cp $(TARGETS) "$(DESTDIR)$(bindir)" |
33 changes: 33 additions & 0 deletions
33
repo/packages/r/rt-tests/patches/1.0/04_cyclictest_signed.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c | ||
index dc33eca..1129c87 100644 | ||
--- a/src/cyclictest/cyclictest.c | ||
+++ b/src/cyclictest/cyclictest.c | ||
@@ -154,8 +154,8 @@ struct thread_param { | ||
|
||
/* Struct for statistics */ | ||
struct thread_stat { | ||
- unsigned long cycles; | ||
- unsigned long cyclesread; | ||
+ long cycles; | ||
+ long cyclesread; | ||
long min; | ||
long max; | ||
long act; | ||
@@ -172,7 +172,7 @@ struct thread_stat { | ||
long cycleofmax; | ||
long hist_overflow; | ||
long num_outliers; | ||
- unsigned long smi_count; | ||
+ long smi_count; | ||
}; | ||
|
||
static pthread_mutex_t trigger_lock = PTHREAD_MUTEX_INITIALIZER; | ||
@@ -1088,7 +1088,7 @@ static void *timerthread(void *param) | ||
|
||
while (!shutdown) { | ||
|
||
- uint64_t diff; | ||
+ int64_t diff; | ||
unsigned long diff_smi = 0; | ||
int sigs, ret; | ||
|
13 changes: 13 additions & 0 deletions
13
repo/packages/r/rt-tests/patches/1.0/05_fix_high_resolution_timers_check.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c | ||
index 1129c87..a648246 100644 | ||
--- a/src/cyclictest/cyclictest.c | ||
+++ b/src/cyclictest/cyclictest.c | ||
@@ -1917,7 +1917,7 @@ static int check_timer(void) | ||
if (clock_getres(CLOCK_MONOTONIC, &ts)) | ||
return 1; | ||
|
||
- return (ts.tv_sec != 0 || ts.tv_nsec != 1); | ||
+ return (ts.tv_sec != 0 || ts.tv_nsec == 0); | ||
} | ||
|
||
static void sighand(int sig) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
-- Licensed under the Apache License, Version 2.0 (the "License"); | ||
-- You may not use this file except in compliance with the License. | ||
-- You may obtain a copy of the License at | ||
-- | ||
-- http://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, software | ||
-- distributed under the License is distributed on an "AS IS" BASIS, | ||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
-- See the License for the specific language governing permissions and | ||
-- limitations under the License. | ||
-- | ||
-- Copyright (C) 2023-2023 RT-Thread Development Team | ||
-- | ||
-- @author xqyjlj | ||
-- @file deploy.lua | ||
-- | ||
-- Change Logs: | ||
-- Date Author Notes | ||
-- ------------ ---------- ----------------------------------------------- | ||
-- 2023-05-11 xqyjlj initial version | ||
-- | ||
import("rt.rt_utils") | ||
|
||
function main(rootfs, installdir) | ||
for _, filepath in ipairs(os.files(path.join(installdir, "bin") .. "/*")) do | ||
local filename = path.filename(filepath) | ||
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "bin", filename)) | ||
end | ||
|
||
for _, filepath in ipairs(os.files(path.join(installdir, "sbin") .. "/*")) do | ||
local filename = path.filename(filepath) | ||
rt_utils.cp_with_symlink(filepath, path.join(rootfs, "sbin", filename)) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
-- Licensed under the Apache License, Version 2.0 (the "License"); | ||
-- You may not use this file except in compliance with the License. | ||
-- You may obtain a copy of the License at | ||
-- | ||
-- http://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, software | ||
-- distributed under the License is distributed on an "AS IS" BASIS, | ||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
-- See the License for the specific language governing permissions and | ||
-- limitations under the License. | ||
-- | ||
-- Copyright (C) 2023-2023 RT-Thread Development Team | ||
-- | ||
-- @author xqyjlj | ||
-- @file xmake.lua | ||
-- | ||
-- Change Logs: | ||
-- Date Author Notes | ||
-- ------------ ---------- ----------------------------------------------- | ||
-- 2023-04-17 xqyjlj initial version | ||
-- | ||
package("rt-tests") | ||
do | ||
set_homepage("https://wiki.linuxfoundation.org/realtime/documentation/howto/tools/rt-tests") | ||
set_description("suite of real-time tests") | ||
|
||
add_urls("https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/snapshot/rt-tests-$(version).tar.gz") | ||
|
||
add_versions("1.0", "c543672cdeeb9033284b55ea64a7c7c7c385949646332dfbdd295cbedbf610b8") | ||
|
||
add_patches("1.0", path.join(os.scriptdir(), "patches", "1.0", "01_stable_v1.0.diff"), | ||
"45068026d52fb21a3ed205255f3da563e64a4ebacca8cb692612b3769bfafc0c") | ||
add_patches("1.0", path.join(os.scriptdir(), "patches", "1.0", "02_cyclictest_c.diff"), | ||
"5bac2ea74f34bd986ab69a1ef8c4a0f3df99c166369bcb919e98b8a830742b59") | ||
add_patches("1.0", path.join(os.scriptdir(), "patches", "1.0", "03_Makefile.diff"), | ||
"1ecdb0083170492118da7d98fb2cbebde80d3e1f9f92f0fcb5e577cdf1f03c47") | ||
add_patches("1.0", path.join(os.scriptdir(), "patches", "1.0", "04_cyclictest_signed.diff"), | ||
"70c5730323fe17219b5953e0c7fb6ed6de0c306fd4e1efabc39ca3dd6ed01780") | ||
add_patches("1.0", path.join(os.scriptdir(), "patches", "1.0", "05_fix_high_resolution_timers_check.diff"), | ||
"deae130cd138ce85f3554821754c36bc624105224045e6c85231cde92163a026") | ||
|
||
add_configs("shared", { | ||
description = "Build shared library.", | ||
default = os.getenv("RT_XMAKE_LINK_TYPE") ~= "static", | ||
type = "boolean" | ||
}) | ||
add_configs("cyclictest", {description = "high resolution test program", default = true, type = "boolean"}) | ||
|
||
on_install("cross@linux", function(package) | ||
import("rt.private.build.rtflags") | ||
local info = rtflags.get_package_info(package) | ||
local host = info.host | ||
local cc = info.cc | ||
local ldflags = {} | ||
local configs = {} | ||
os.setenv("PATH", path.directory(cc) .. ":" .. os.getenv("PATH")) | ||
|
||
local buildenvs = import("package.tools.autoconf").buildenvs(package, {ldflags = ldflags}) | ||
buildenvs["prefix"] = package:installdir() | ||
if package:config("cyclictest") then | ||
table.insert(configs, "cyclictest") | ||
end | ||
if package:config("debug") then | ||
table.insert(configs, "DEBUG=1") | ||
end | ||
|
||
import("package.tools.make").build(package, configs, {envs = buildenvs}) | ||
|
||
if package:config("cyclictest") then | ||
os.vcp("cyclictest", package:installdir("bin")) | ||
os.vcp("src/cyclictest/cyclictest.8", package:installdir("share/man")) | ||
end | ||
end) | ||
|
||
on_test(function(package) | ||
if package:config("cyclictest") then | ||
assert(os.isfile(path.join(package:installdir("bin"), "cyclictest"))) | ||
end | ||
end) | ||
end |