import rt-tests-1.3-21.el8
This commit is contained in:
parent
09923039dd
commit
428277e23a
373
SOURCES/Add-ssdd-test-to-the-rt-tests-suite.patch
Normal file
373
SOURCES/Add-ssdd-test-to-the-rt-tests-suite.patch
Normal file
@ -0,0 +1,373 @@
|
||||
From 88b17cb724c653391a92be00b48378432a1036a5 Mon Sep 17 00:00:00 2001
|
||||
From: Joe Korty <joe.korty@concurrent-rt.com>
|
||||
Date: Mon, 14 Jan 2019 17:29:26 +0100
|
||||
Subject: [PATCH 1/5] Add ssdd test to the rt-tests suite
|
||||
|
||||
The following program might make a good addition to the rt
|
||||
test suite. It tests the reliability of PTRACE_SINGLESTEP.
|
||||
It does by default 10,000 ssteps against a simple,
|
||||
spinner tracee. Also by default, it spins off ten of these
|
||||
tracer/tracee pairs, all of which are to run concurrently.
|
||||
|
||||
Starting with 4.13-rt, this test occasionally encounters a
|
||||
sstep whose waitpid returns a WIFSIGNALED (signal SIGTRAP)
|
||||
rather than a WIFSTOPPED. This usually happens after
|
||||
thousands of ssteps have executed. Having multiple
|
||||
tracer/tracee pairs running dramatically increases the
|
||||
chances of failure.
|
||||
|
||||
The is what the test output looks like for a good run:
|
||||
|
||||
forktest#0/22872: STARTING
|
||||
forktest#7/22879: STARTING
|
||||
forktest#8/22880: STARTING
|
||||
forktest#6/22878: STARTING
|
||||
forktest#5/22877: STARTING
|
||||
forktest#3/22875: STARTING
|
||||
forktest#4/22876: STARTING
|
||||
forktest#9/22882: STARTING
|
||||
forktest#2/22874: STARTING
|
||||
forktest#1/22873: STARTING
|
||||
forktest#0/22872: EXITING, no error
|
||||
forktest#8/22880: EXITING, no error
|
||||
forktest#3/22875: EXITING, no error
|
||||
forktest#7/22879: EXITING, no error
|
||||
forktest#6/22878: EXITING, no error
|
||||
forktest#5/22877: EXITING, no error
|
||||
forktest#2/22874: EXITING, no error
|
||||
forktest#4/22876: EXITING, no error
|
||||
forktest#9/22882: EXITING, no error
|
||||
forktest#1/22873: EXITING, no error
|
||||
All tests PASSED.
|
||||
|
||||
Signed-off-by: Joe Korty <joe.korty@concurrent-rt.com>
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
src/ssdd/ssdd.c | 315 ++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 315 insertions(+)
|
||||
create mode 100644 src/ssdd/ssdd.c
|
||||
|
||||
diff --git a/src/ssdd/ssdd.c b/src/ssdd/ssdd.c
|
||||
new file mode 100644
|
||||
index 000000000000..6d09d54e34e1
|
||||
--- /dev/null
|
||||
+++ b/src/ssdd/ssdd.c
|
||||
@@ -0,0 +1,315 @@
|
||||
+/*
|
||||
+ * Have a tracer do a bunch of PTRACE_SINGLESTEPs against
|
||||
+ * a tracee as fast as possible. Create several of these
|
||||
+ * tracer/tracee pairs and see if they can be made to
|
||||
+ * interfere with each other.
|
||||
+ *
|
||||
+ * Usage:
|
||||
+ * ssdd nforks niters
|
||||
+ * Where:
|
||||
+ * nforks - number of tracer/tracee pairs to fork off.
|
||||
+ * default 10.
|
||||
+ * niters - number of PTRACE_SINGLESTEP iterations to
|
||||
+ * do before declaring success, for each tracer/
|
||||
+ * tracee pair set up. Default 10,000.
|
||||
+ *
|
||||
+ * The tracer waits on each PTRACE_SINGLESTEP with a waitpid(2)
|
||||
+ * and checks that waitpid's return values for correctness.
|
||||
+ */
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <stddef.h>
|
||||
+#include <unistd.h>
|
||||
+#include <string.h>
|
||||
+#include <signal.h>
|
||||
+#include <errno.h>
|
||||
+
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/wait.h>
|
||||
+#include <sys/ptrace.h>
|
||||
+
|
||||
+/* do_wait return values */
|
||||
+#define STATE_EXITED 1
|
||||
+#define STATE_STOPPED 2
|
||||
+#define STATE_SIGNALED 3
|
||||
+#define STATE_UNKNOWN 4
|
||||
+#define STATE_ECHILD 5
|
||||
+#define STATE_EXITED_TSIG 6 /* exited with termination signal */
|
||||
+#define STATE_EXITED_ERRSTAT 7 /* exited with non-zero status */
|
||||
+
|
||||
+char *state_name[] = {
|
||||
+ [STATE_EXITED] = "STATE_EXITED",
|
||||
+ [STATE_STOPPED] = "STATE_STOPPED",
|
||||
+ [STATE_SIGNALED] = "STATE_SIGNALED",
|
||||
+ [STATE_UNKNOWN] = "STATE_UNKNOWN",
|
||||
+ [STATE_ECHILD] = "STATE_ECHILD",
|
||||
+ [STATE_EXITED_TSIG] = "STATE_EXITED_TSIG",
|
||||
+ [STATE_EXITED_ERRSTAT] = "STATE_EXITED_ERRSTAT"
|
||||
+};
|
||||
+
|
||||
+const char *get_state_name(int state)
|
||||
+{
|
||||
+ if (state < STATE_EXITED || state > STATE_EXITED_ERRSTAT)
|
||||
+ return "?";
|
||||
+ return state_name[state];
|
||||
+}
|
||||
+
|
||||
+#define unused __attribute__((unused))
|
||||
+
|
||||
+static int got_sigchld;
|
||||
+
|
||||
+static int do_wait(pid_t *wait_pid, int *ret_sig)
|
||||
+{
|
||||
+ int status, child_status;
|
||||
+
|
||||
+ *ret_sig = -1; /* initially mark 'nothing returned' */
|
||||
+
|
||||
+ while (1) {
|
||||
+ status = waitpid(-1, &child_status, WUNTRACED | __WALL);
|
||||
+ if (status == -1) {
|
||||
+ if (errno == EINTR)
|
||||
+ continue;
|
||||
+ if (errno == ECHILD) {
|
||||
+ *wait_pid = (pid_t)0;
|
||||
+ return STATE_ECHILD;
|
||||
+ }
|
||||
+ printf("do_wait/%d: EXITING, ERROR: "
|
||||
+ "waitpid() returned errno %d\n",
|
||||
+ getpid(), errno);
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
+ *wait_pid = (pid_t)status;
|
||||
+
|
||||
+ if (WIFEXITED(child_status)) {
|
||||
+ if (WIFSIGNALED(child_status))
|
||||
+ return STATE_EXITED_TSIG;
|
||||
+ if (WEXITSTATUS(child_status))
|
||||
+ return STATE_EXITED_ERRSTAT;
|
||||
+ return STATE_EXITED;
|
||||
+ }
|
||||
+ if (WIFSTOPPED(child_status)) {
|
||||
+ *ret_sig = WSTOPSIG(child_status);
|
||||
+ return STATE_STOPPED;
|
||||
+ }
|
||||
+ if (WIFSIGNALED(child_status)) {
|
||||
+ *ret_sig = WTERMSIG(child_status);
|
||||
+ return STATE_SIGNALED;
|
||||
+ }
|
||||
+ return STATE_UNKNOWN;
|
||||
+}
|
||||
+
|
||||
+int check_sigchld(void)
|
||||
+{
|
||||
+ int i;
|
||||
+ /*
|
||||
+ * The signal is asynchronous so give it some
|
||||
+ * time to arrive.
|
||||
+ */
|
||||
+ for (i = 0; i < 10 && !got_sigchld; i++)
|
||||
+ usleep(1000); /* 10 msecs */
|
||||
+ for (i = 0; i < 10 && !got_sigchld; i++)
|
||||
+ usleep(2000); /* 20 + 10 = 30 msecs */
|
||||
+ for (i = 0; i < 10 && !got_sigchld; i++)
|
||||
+ usleep(4000); /* 40 + 30 = 70 msecs */
|
||||
+ for (i = 0; i < 10 && !got_sigchld; i++)
|
||||
+ usleep(8000); /* 80 + 70 = 150 msecs */
|
||||
+ for (i = 0; i < 10 && !got_sigchld; i++)
|
||||
+ usleep(16000); /* 160 + 150 = 310 msecs */
|
||||
+
|
||||
+ return got_sigchld;
|
||||
+}
|
||||
+
|
||||
+pid_t parent;
|
||||
+int nforks = 10;
|
||||
+int nsteps = 10000;
|
||||
+
|
||||
+static void sigchld(int sig, unused siginfo_t * info, unused void *arg)
|
||||
+{
|
||||
+ got_sigchld = 1;
|
||||
+}
|
||||
+
|
||||
+static void child_process(void)
|
||||
+{
|
||||
+ unused volatile int i;
|
||||
+
|
||||
+ /* wait for ptrace attach */
|
||||
+ usleep(100000);
|
||||
+ while (1)
|
||||
+ i = 0;
|
||||
+}
|
||||
+
|
||||
+static int forktests(int testid)
|
||||
+{
|
||||
+ int i, status, ret_sig;
|
||||
+ long pstatus;
|
||||
+ pid_t child, wait_pid;
|
||||
+ struct sigaction act, oact;
|
||||
+
|
||||
+ parent = getpid();
|
||||
+ printf("forktest#%d/%d: STARTING\n", testid, parent);
|
||||
+
|
||||
+ child = fork();
|
||||
+ if (child == -1) {
|
||||
+ printf("forktest#%d/%d: EXITING, ERROR: "
|
||||
+ "fork returned errno %d\n", testid, parent, errno);
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ if (!child)
|
||||
+ child_process();
|
||||
+
|
||||
+ act.sa_sigaction = sigchld;
|
||||
+ sigemptyset(&act.sa_mask);
|
||||
+ act.sa_flags = SA_SIGINFO;
|
||||
+ status = sigaction(SIGCHLD, &act, &oact);
|
||||
+ if (status) {
|
||||
+ printf("forktest#%d/%d: EXITING, ERROR: "
|
||||
+ "sigaction returned %d, errno %d\n",
|
||||
+ testid, parent, status, errno);
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
+ /* give both our child and parent time to set things up */
|
||||
+ usleep(125000);
|
||||
+
|
||||
+ /*
|
||||
+ * Attach to the child.
|
||||
+ */
|
||||
+ pstatus = ptrace(PTRACE_ATTACH, child, NULL, NULL);
|
||||
+ if (pstatus == ~0l) {
|
||||
+ printf("forktest#%d/%d: EXITING, ERROR: "
|
||||
+ "attach failed. errno %d\n",
|
||||
+ testid, getpid(), errno);
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * The attach should cause the child to receive a signal.
|
||||
+ */
|
||||
+ status = do_wait(&wait_pid, &ret_sig);
|
||||
+ if (wait_pid != child) {
|
||||
+ printf("forktest#%d/%d: EXITING, ERROR: "
|
||||
+ "attach: Unexpected wait pid %d\n",
|
||||
+ testid, getpid(), wait_pid);
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ if (status != STATE_STOPPED) {
|
||||
+ printf("forktest#%d/%d: EXITING, ERROR: "
|
||||
+ "attach: wait on PTRACE_ATTACH returned %d "
|
||||
+ "[%s, wanted STATE_STOPPED], signo %d\n",
|
||||
+ testid, getpid(), status, get_state_name(status),
|
||||
+ ret_sig);
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ else if (!check_sigchld()) {
|
||||
+ printf("forktest#%d/%d: EXITING, ERROR: "
|
||||
+ "wait on PTRACE_ATTACH saw a SIGCHLD count of %d, should be 1\n",
|
||||
+ testid, getpid(), got_sigchld);
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ got_sigchld = 0;
|
||||
+
|
||||
+
|
||||
+ /*
|
||||
+ * Generate 'nsteps' PTRACE_SINGLESTEPs, make sure they all actually
|
||||
+ * step the tracee.
|
||||
+ */
|
||||
+ for (i = 0; i < nsteps; i++) {
|
||||
+ pstatus = ptrace(PTRACE_SINGLESTEP, child, NULL, NULL);
|
||||
+
|
||||
+ if (pstatus) {
|
||||
+ printf("forktest#%d/%d: EXITING, ERROR: "
|
||||
+ "PTRACE_SINGLESTEP #%d: returned status %ld, "
|
||||
+ "errno %d, signo %d\n",
|
||||
+ testid, getpid(), i, pstatus, errno, ret_sig);
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
+ status = do_wait(&wait_pid, &ret_sig);
|
||||
+ if (wait_pid != child) {
|
||||
+ printf("forktest#%d/%d: EXITING, ERROR: "
|
||||
+ "wait on PTRACE_SINGLESTEP #%d: returned wrong pid %d, "
|
||||
+ "expected %d\n",
|
||||
+ testid, getpid(), i, wait_pid, child);
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ if (status != STATE_STOPPED) {
|
||||
+ printf("forktest#%d/%d: EXITING, ERROR: "
|
||||
+ "wait on PTRACE_SINGLESTEP #%d: wanted STATE_STOPPED, "
|
||||
+ "saw %s instead (and saw signo %d too)\n",
|
||||
+ testid, getpid(), i,
|
||||
+ get_state_name(status), ret_sig);
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ if (ret_sig != SIGTRAP) {
|
||||
+ printf("forktest#%d/%d: EXITING, ERROR: "
|
||||
+ "wait on PTRACE_SINGLESTEP #%d: returned signal %d, "
|
||||
+ "wanted SIGTRAP\n",
|
||||
+ testid, getpid(), i, ret_sig);
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ if (!check_sigchld()) {
|
||||
+ printf("forktest#%d/%d: EXITING, ERROR: "
|
||||
+ "wait on PTRACE_SINGLESTEP #%d: no SIGCHLD seen "
|
||||
+ "(signal count == 0), signo %d\n",
|
||||
+ testid, getpid(), i, ret_sig);
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ got_sigchld = 0;
|
||||
+ }
|
||||
+
|
||||
+ /* There is no need for the tracer to kill the tracee. It will
|
||||
+ * automatically exit when its owner, ie, us, exits.
|
||||
+ */
|
||||
+
|
||||
+ printf("forktest#%d/%d: EXITING, no error\n", testid, parent);
|
||||
+ exit(0);
|
||||
+}
|
||||
+
|
||||
+int main(int argc, char **argv)
|
||||
+{
|
||||
+ int i, ret_sig, status;
|
||||
+ pid_t child = 0, wait_pid;
|
||||
+ int error = 0;
|
||||
+
|
||||
+ setbuf(stdout, NULL);
|
||||
+
|
||||
+ argc--, argv++;
|
||||
+ if (argc) {
|
||||
+ nforks = atoi(*argv);
|
||||
+ argc--, argv++;
|
||||
+ if (argc)
|
||||
+ nsteps = atoi(*argv);
|
||||
+ }
|
||||
+ printf("#forks: %d\n", nforks);
|
||||
+ printf("#steps: %d\n", nsteps);
|
||||
+ printf("\n");
|
||||
+
|
||||
+ for (i = 0; i < nforks; i++) {
|
||||
+ child = fork();
|
||||
+ if (child == -1) {
|
||||
+ printf("main: fork returned errno %d\n", errno);
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ if (!child)
|
||||
+ forktests(i);
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < nforks; i++) {
|
||||
+ status = do_wait(&wait_pid, &ret_sig);
|
||||
+ if (status != STATE_EXITED) {
|
||||
+ if (0) printf("main/%d: ERROR: "
|
||||
+ "forktest#%d unexpected do_wait status %d "
|
||||
+ "[%s, wanted STATE_EXITED]\n",
|
||||
+ getpid(), wait_pid, status,
|
||||
+ get_state_name(status));
|
||||
+ error = 1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ printf("%s.\n", error ?
|
||||
+ "One or more tests FAILED" :
|
||||
+ "All tests PASSED");
|
||||
+ exit(error);
|
||||
+}
|
||||
--
|
||||
2.20.1
|
||||
|
@ -0,0 +1,41 @@
|
||||
From 2b126beda6e76f89fb95c14bc421bc13a376cf2e Mon Sep 17 00:00:00 2001
|
||||
From: Clark Williams <williams@redhat.com>
|
||||
Date: Tue, 19 Feb 2019 16:10:38 +0100
|
||||
Subject: [PATCH] cyclictest: Fix compiler warning about srncpy output
|
||||
truncated
|
||||
|
||||
Fix compiler warning about strncpy output truncated before terminating
|
||||
nul copying as many bytes from a string as its length
|
||||
|
||||
Signed-off-by: Clark Williams <williams@redhat.com>
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
Extracted from a patch from Clark
|
||||
---
|
||||
src/cyclictest/cyclictest.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
|
||||
index 68b3836405c1..1bd63fd93dce 100644
|
||||
--- a/src/cyclictest/cyclictest.c
|
||||
+++ b/src/cyclictest/cyclictest.c
|
||||
@@ -1257,7 +1257,7 @@ static void process_options (int argc, char *argv[], int max_cpus)
|
||||
case 'F':
|
||||
case OPT_FIFO:
|
||||
use_fifo = 1;
|
||||
- strncpy(fifopath, optarg, strlen(optarg));
|
||||
+ strncpy(fifopath, optarg, strnlen(optarg, MAX_PATH-1));
|
||||
break;
|
||||
case 'H':
|
||||
case OPT_HISTOFALL:
|
||||
@@ -1267,7 +1267,7 @@ static void process_options (int argc, char *argv[], int max_cpus)
|
||||
histogram = atoi(optarg); break;
|
||||
case OPT_HISTFILE:
|
||||
use_histfile = 1;
|
||||
- strncpy(histfile, optarg, strlen(optarg));
|
||||
+ strncpy(histfile, optarg, strnlen(optarg, MAX_PATH-1));
|
||||
break;
|
||||
case 'i':
|
||||
case OPT_INTERVAL:
|
||||
--
|
||||
2.20.1
|
||||
|
@ -0,0 +1,56 @@
|
||||
From 966b4eeda61b4c623a5ef423236dc710b31c1532 Mon Sep 17 00:00:00 2001
|
||||
From: John Kacur <jkacur@redhat.com>
|
||||
Date: Wed, 20 Feb 2019 23:16:34 +0100
|
||||
Subject: [PATCH] cyclictest: Make sure affinity is respected when numa is
|
||||
detected
|
||||
|
||||
Make sure affinity is respected when numa is automatically detected and
|
||||
when smp is not specified. Don't break the way smp currently works.
|
||||
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
src/cyclictest/cyclictest.c | 13 ++++++-------
|
||||
1 file changed, 6 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
|
||||
index 1bd63fd93dce..ed59edefbf97 100644
|
||||
--- a/src/cyclictest/cyclictest.c
|
||||
+++ b/src/cyclictest/cyclictest.c
|
||||
@@ -1218,7 +1218,7 @@ static void process_options (int argc, char *argv[], int max_cpus)
|
||||
case 'a':
|
||||
case OPT_AFFINITY:
|
||||
option_affinity = 1;
|
||||
- if (smp || numa)
|
||||
+ if (smp)
|
||||
break;
|
||||
if (optarg != NULL) {
|
||||
parse_cpumask(optarg, max_cpus);
|
||||
@@ -1384,8 +1384,10 @@ static void process_options (int argc, char *argv[], int max_cpus)
|
||||
#ifdef NUMA
|
||||
if (numa_available() != -1) {
|
||||
numa = 1;
|
||||
- num_threads = max_cpus;
|
||||
- setaffinity = AFFINITY_USEALL;
|
||||
+ if (setaffinity == AFFINITY_UNSPECIFIED) {
|
||||
+ num_threads = max_cpus;
|
||||
+ setaffinity = AFFINITY_USEALL;
|
||||
+ }
|
||||
}
|
||||
#else
|
||||
warn("cyclictest was not built with the numa option\n");
|
||||
@@ -1394,11 +1396,8 @@ static void process_options (int argc, char *argv[], int max_cpus)
|
||||
}
|
||||
|
||||
if (option_affinity) {
|
||||
- if (smp) {
|
||||
+ if (smp)
|
||||
warn("-a ignored due to smp mode\n");
|
||||
- } else if (numa) {
|
||||
- warn("-a ignored due to numa mode\n");
|
||||
- }
|
||||
}
|
||||
|
||||
if (smi) {
|
||||
--
|
||||
2.20.1
|
||||
|
@ -0,0 +1,44 @@
|
||||
From e1fa2cda6a6cc2e5eb916638e0325b3d334adbe4 Mon Sep 17 00:00:00 2001
|
||||
From: Li Xiaoming <lixm.fnst@cn.fujitsu.com>
|
||||
Date: Thu, 10 Jan 2019 10:21:59 +0800
|
||||
Subject: [PATCH] cyclictest: fix_with_expected_identifier_in_latest
|
||||
|
||||
An error occurred during the build process:
|
||||
src/cyclictest/cyclictest.c:1396:2: error: expected identifier or '(' before 'if'
|
||||
if (option_affinity) {
|
||||
|
||||
The expected identifier "}" for "if (option_affinity){" occurs in another place.
|
||||
|
||||
Signed-off-by: Li Xiaoming <lixm.fnst@cn.fujitsu.com>
|
||||
Signed-off-by: Zhong Lu <zhongl.fnst@cn.fujitsu.com>
|
||||
|
||||
- Fixed the indentation of the bracket
|
||||
- Fixed the indentation of the block where NUMA is not defined
|
||||
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
src/cyclictest/cyclictest.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
|
||||
index 188a202c5171..68b3836405c1 100644
|
||||
--- a/src/cyclictest/cyclictest.c
|
||||
+++ b/src/cyclictest/cyclictest.c
|
||||
@@ -1386,11 +1386,11 @@ static void process_options (int argc, char *argv[], int max_cpus)
|
||||
numa = 1;
|
||||
num_threads = max_cpus;
|
||||
setaffinity = AFFINITY_USEALL;
|
||||
+ }
|
||||
#else
|
||||
- warn("cyclictest was not built with the numa option\n");
|
||||
- numa = 0;
|
||||
+ warn("cyclictest was not built with the numa option\n");
|
||||
+ numa = 0;
|
||||
#endif
|
||||
- }
|
||||
}
|
||||
|
||||
if (option_affinity) {
|
||||
--
|
||||
2.20.1
|
||||
|
77
SOURCES/hwlatdetect-disable-enable-c-state-transitions.patch
Normal file
77
SOURCES/hwlatdetect-disable-enable-c-state-transitions.patch
Normal file
@ -0,0 +1,77 @@
|
||||
From ef49ccfab821010319d4ff6b1332fa890889aeac Mon Sep 17 00:00:00 2001
|
||||
From: Clark Williams <williams@redhat.com>
|
||||
Date: Mon, 6 May 2019 14:40:46 -0500
|
||||
Subject: [PATCH 1/2] hwlatdetect: disable/enable c-state transitions during
|
||||
detection
|
||||
|
||||
Recent performance tuning problems led me to realize that just running
|
||||
at fifo:99 and turning off interrupts isn't enough while looking for
|
||||
BIOS induced latencies. Power savings logic is built into most modern
|
||||
cpus and so must be disabled while looking for BIOS induced (SMI/NMI)
|
||||
latencies.
|
||||
|
||||
Use the /dev/cpu_dma_latency mechanism to disable c-state transitions
|
||||
while running the hardware latency detector. Open the file
|
||||
/dev/cpu_dma_latency and write a 32-bit zero to it, which will prevent
|
||||
c-state transitions while the file is open.
|
||||
|
||||
Signed-off-by: Clark Williams <williams@redhat.com>
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
src/hwlatdetect/hwlatdetect.py | 20 +++++++++++++++++++-
|
||||
1 file changed, 19 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/hwlatdetect/hwlatdetect.py b/src/hwlatdetect/hwlatdetect.py
|
||||
index 2c8f9f160419..368079a158b1 100755
|
||||
--- a/src/hwlatdetect/hwlatdetect.py
|
||||
+++ b/src/hwlatdetect/hwlatdetect.py
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
-# (C) 2018 Clark Williams <williams@redhat.com>
|
||||
+# (C) 2018,2019 Clark Williams <williams@redhat.com>
|
||||
# (C) 2015,2016 Clark Williams <williams@redhat.com>
|
||||
# (C) 2009 Clark Williams <williams@redhat.com>
|
||||
#
|
||||
@@ -213,6 +213,22 @@ class Detector(object):
|
||||
counts = [ int(x.strip()) for x in p.stdout.readlines()]
|
||||
return counts
|
||||
|
||||
+ # methods for preventing/enabling c-state transitions
|
||||
+ # openinging /dev/cpu_dma_latency and writeing a 32-bit zero to that file will prevent
|
||||
+ # c-state transitions while the file descriptor is open.
|
||||
+ # use c_states_off() to disable c-state transitions
|
||||
+ # use c_states_on() to close the file descriptor and re-enable c-states
|
||||
+ #
|
||||
+ def c_states_off(self):
|
||||
+ self.dma_latency_handle = os.open("/dev/cpu_dma_latency", os.O_WRONLY)
|
||||
+ os.write(self.dma_latency_handle, b'\x00\x00\x00\x00')
|
||||
+ debug("c-states disabled")
|
||||
+
|
||||
+ def c_states_on(self):
|
||||
+ if self.dma_latency_handle:
|
||||
+ os.close(self.dma_latency_handle)
|
||||
+ debug("c-states enabled")
|
||||
+
|
||||
def cleanup(self):
|
||||
raise RuntimeError("must override base method 'cleanup'!")
|
||||
|
||||
@@ -235,6 +251,7 @@ class Detector(object):
|
||||
def start(self):
|
||||
count = 0
|
||||
threshold = int(self.get("threshold"))
|
||||
+ self.c_states_off()
|
||||
debug("enabling detector module (threshold: %d)" % threshold)
|
||||
self.set("enable", 1)
|
||||
while self.get("enable") == 0:
|
||||
@@ -258,6 +275,7 @@ class Detector(object):
|
||||
time.sleep(0.1)
|
||||
debug("retrying disable of detector module(%d)" % count)
|
||||
self.set("enable", 0)
|
||||
+ self.c_states_on()
|
||||
debug("detector module disabled")
|
||||
|
||||
def detect(self):
|
||||
--
|
||||
2.20.1
|
||||
|
@ -0,0 +1,77 @@
|
||||
From 40eb214cc9b43f99df3d20b3303b7df1d149b5e2 Mon Sep 17 00:00:00 2001
|
||||
From: Qiao Zhao <qzhao@redhat.com>
|
||||
Date: Thu, 25 Jul 2019 10:49:15 +0800
|
||||
Subject: [PATCH] ptsematest, sigwaittest, pmqtest, svsematest reprot error
|
||||
"Could not access /sys/kernel/debug/tracing/tracing_enabled"
|
||||
|
||||
tracing_enabled was deprecated a long time ago and is no longer
|
||||
available, use tracing_on instead
|
||||
|
||||
To reproduce
|
||||
|
||||
This patches fixes that
|
||||
|
||||
Signed-off-by: Qiao Zhao <qzhao@redhat.com>
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
src/pmqtest/pmqtest.c | 2 +-
|
||||
src/ptsematest/ptsematest.c | 2 +-
|
||||
src/sigwaittest/sigwaittest.c | 2 +-
|
||||
src/svsematest/svsematest.c | 2 +-
|
||||
4 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/pmqtest/pmqtest.c b/src/pmqtest/pmqtest.c
|
||||
index 2191710961fe..a04fc49872bf 100644
|
||||
--- a/src/pmqtest/pmqtest.c
|
||||
+++ b/src/pmqtest/pmqtest.c
|
||||
@@ -204,7 +204,7 @@ void *pmqthread(void *param)
|
||||
char tracing_enabled_file[MAX_PATH];
|
||||
|
||||
strcpy(tracing_enabled_file, get_debugfileprefix());
|
||||
- strcat(tracing_enabled_file, "tracing_enabled");
|
||||
+ strcat(tracing_enabled_file, "tracing_on");
|
||||
int tracing_enabled =
|
||||
open(tracing_enabled_file, O_WRONLY);
|
||||
if (tracing_enabled >= 0) {
|
||||
diff --git a/src/ptsematest/ptsematest.c b/src/ptsematest/ptsematest.c
|
||||
index e8a3177b63dd..553759212ac9 100644
|
||||
--- a/src/ptsematest/ptsematest.c
|
||||
+++ b/src/ptsematest/ptsematest.c
|
||||
@@ -131,7 +131,7 @@ void *semathread(void *param)
|
||||
char tracing_enabled_file[MAX_PATH];
|
||||
|
||||
strcpy(tracing_enabled_file, get_debugfileprefix());
|
||||
- strcat(tracing_enabled_file, "tracing_enabled");
|
||||
+ strcat(tracing_enabled_file, "tracing_on");
|
||||
int tracing_enabled =
|
||||
open(tracing_enabled_file, O_WRONLY);
|
||||
if (tracing_enabled >= 0) {
|
||||
diff --git a/src/sigwaittest/sigwaittest.c b/src/sigwaittest/sigwaittest.c
|
||||
index 4579f903c909..59f28a5babcb 100644
|
||||
--- a/src/sigwaittest/sigwaittest.c
|
||||
+++ b/src/sigwaittest/sigwaittest.c
|
||||
@@ -179,7 +179,7 @@ void *semathread(void *param)
|
||||
char tracing_enabled_file[MAX_PATH];
|
||||
|
||||
strcpy(tracing_enabled_file, get_debugfileprefix());
|
||||
- strcat(tracing_enabled_file, "tracing_enabled");
|
||||
+ strcat(tracing_enabled_file, "tracing_on");
|
||||
int tracing_enabled =
|
||||
open(tracing_enabled_file, O_WRONLY);
|
||||
if (tracing_enabled >= 0) {
|
||||
diff --git a/src/svsematest/svsematest.c b/src/svsematest/svsematest.c
|
||||
index 01083d13dde6..8f880786ec0f 100644
|
||||
--- a/src/svsematest/svsematest.c
|
||||
+++ b/src/svsematest/svsematest.c
|
||||
@@ -185,7 +185,7 @@ void *semathread(void *param)
|
||||
char tracing_enabled_file[MAX_PATH];
|
||||
|
||||
strcpy(tracing_enabled_file, get_debugfileprefix());
|
||||
- strcat(tracing_enabled_file, "tracing_enabled");
|
||||
+ strcat(tracing_enabled_file, "tracing_on");
|
||||
int tracing_enabled =
|
||||
open(tracing_enabled_file, O_WRONLY);
|
||||
if (tracing_enabled >= 0) {
|
||||
--
|
||||
2.20.1
|
||||
|
@ -0,0 +1,115 @@
|
||||
From 59c7b5e334940fff29ea49aa722d1c43c88a436b Mon Sep 17 00:00:00 2001
|
||||
From: John Kacur <jkacur@redhat.com>
|
||||
Date: Tue, 7 May 2019 15:26:38 +0200
|
||||
Subject: [PATCH 1/2] queuelat: Assume queuelat and queuelat scripts are in the
|
||||
path
|
||||
|
||||
Assume queuelat and queuelat scripts are in the path. Don't hardcode
|
||||
their location.
|
||||
|
||||
Write the temporary data to /usr/tmp/outfile
|
||||
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
src/queuelat/determine_maximum_mpps.sh | 35 +++++++++++++-------------
|
||||
1 file changed, 17 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/src/queuelat/determine_maximum_mpps.sh b/src/queuelat/determine_maximum_mpps.sh
|
||||
index cf7a8cab9cc4..cd45454720f7 100755
|
||||
--- a/src/queuelat/determine_maximum_mpps.sh
|
||||
+++ b/src/queuelat/determine_maximum_mpps.sh
|
||||
@@ -8,6 +8,7 @@
|
||||
PREAMBLE="taskset -c 2 chrt -f 1"
|
||||
MAXLAT="20000"
|
||||
CYCLES_PER_PACKET="300"
|
||||
+OUTFILE=/usr/tmp/outfile
|
||||
|
||||
echo "Determining maximum mpps the machine can handle"
|
||||
echo "Will take a few minutes to determine mpps value"
|
||||
@@ -16,10 +17,10 @@ echo "And 10 minutes run to confirm the final mpps value is stable"
|
||||
for mpps in `seq 3 3 50`; do
|
||||
echo testing $mpps Mpps
|
||||
|
||||
- outfile=`mktemp`
|
||||
- $PREAMBLE ./queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `sh ./get_cpuinfo_mhz.sh` -p $mpps -t 30 > $outfile
|
||||
+ OUTFILE=`mktemp`
|
||||
+ $PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `sh get_cpuinfo_mhz.sh` -p $mpps -t 30 > $OUTFILE
|
||||
|
||||
- exceeded=`grep exceeded $outfile`
|
||||
+ exceeded=`grep exceeded $OUTFILE`
|
||||
if [ ! -z "$exceeded" ]; then
|
||||
echo mpps failed: $mpps
|
||||
break;
|
||||
@@ -32,10 +33,10 @@ first_mpps=$(($mpps - 1))
|
||||
for mpps in `seq $first_mpps -1 3`; do
|
||||
echo testing $mpps Mpps
|
||||
|
||||
- outfile=`mktemp`
|
||||
- $PREAMBLE ./queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `sh ./get_cpuinfo_mhz.sh` -p $mpps -t 30 > $outfile
|
||||
+ OUTFILE=`mktemp`
|
||||
+ $PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `sh get_cpuinfo_mhz.sh` -p $mpps -t 30 > $OUTFILE
|
||||
|
||||
- exceeded=`grep exceeded $outfile`
|
||||
+ exceeded=`grep exceeded $OUTFILE`
|
||||
if [ -z "$exceeded" ]; then
|
||||
echo mpps success $mpps
|
||||
break;
|
||||
@@ -49,10 +50,10 @@ echo second loop mpps: $mpps
|
||||
for mpps in `seq $second_mpps 0.3 $first_mpps`; do
|
||||
echo testing $mpps Mpps
|
||||
|
||||
- outfile=`mktemp`
|
||||
- $PREAMBLE ./queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `sh ./get_cpuinfo_mhz.sh` -p $mpps -t 30 > $outfile
|
||||
+ OUTFILE=`mktemp`
|
||||
+ $PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `sh get_cpuinfo_mhz.sh` -p $mpps -t 30 > $OUTFILE
|
||||
|
||||
- exceeded=`grep exceeded $outfile`
|
||||
+ exceeded=`grep exceeded $OUTFILE`
|
||||
if [ ! -z "$exceeded" ]; then
|
||||
echo mpps failure $mpps
|
||||
break;
|
||||
@@ -66,10 +67,10 @@ third_mpps=`echo "$mpps -0.1" | bc`
|
||||
for mpps in `seq $third_mpps -0.1 3`; do
|
||||
echo testing $mpps Mpps
|
||||
|
||||
- outfile=`mktemp`
|
||||
- $PREAMBLE ./queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `sh ./get_cpuinfo_mhz.sh` -p $mpps -t 30 > $outfile
|
||||
+ OUTFILE=`mktemp`
|
||||
+ $PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `sh get_cpuinfo_mhz.sh` -p $mpps -t 30 > $OUTFILE
|
||||
|
||||
- exceeded=`grep exceeded $outfile`
|
||||
+ exceeded=`grep exceeded $OUTFILE`
|
||||
if [ -z "$exceeded" ]; then
|
||||
echo mpps success $mpps
|
||||
break;
|
||||
@@ -86,8 +87,8 @@ while [ $queuelat_failure == 1 ]; do
|
||||
echo "$mpps Mpps"
|
||||
|
||||
for i in `seq 1 10`; do
|
||||
- $PREAMBLE ./queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `./get_cpuinfo_mhz.sh` -p $mpps -t 30 > $outfile
|
||||
- exceeded=`grep exceeded $outfile`
|
||||
+ $PREAMBLE ./queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `get_cpuinfo_mhz.sh` -p $mpps -t 30 > $OUTFILE
|
||||
+ exceeded=`grep exceeded $OUTFILE`
|
||||
|
||||
if [ ! -z "$exceeded" ]; then
|
||||
echo "mpps failure (run $i) $mpps"
|
||||
@@ -108,8 +109,8 @@ while [ $queuelat_failure == 1 ]; do
|
||||
echo -n "Starting 10 minutes run with "
|
||||
echo "$mpps Mpps"
|
||||
|
||||
- $PREAMBLE ./queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `./get_cpuinfo_mhz.sh` -p $mpps -t 600 > $outfile
|
||||
- exceeded=`grep exceeded $outfile`
|
||||
+ $PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `get_cpuinfo_mhz.sh` -p $mpps -t 600 > $OUTFILE
|
||||
+ exceeded=`grep exceeded $OUTFILE`
|
||||
|
||||
if [ ! -z "$exceeded" ]; then
|
||||
echo "mpps failure (run $i) $mpps"
|
||||
@@ -124,5 +125,3 @@ echo Final mpps is: $mpps
|
||||
|
||||
unset queuelat_failure
|
||||
unset mpps
|
||||
-
|
||||
-
|
||||
--
|
||||
2.20.1
|
||||
|
@ -0,0 +1,29 @@
|
||||
From 38e7eb899ffbf23773f8c396c7195e6af0dad099 Mon Sep 17 00:00:00 2001
|
||||
From: John Kacur <jkacur@redhat.com>
|
||||
Date: Tue, 7 May 2019 15:47:55 +0200
|
||||
Subject: [PATCH 2/2] queuelat: Install queuelat helper scripts from the
|
||||
rt-tests Makefile
|
||||
|
||||
Install queuelat helper scripts from the rt-tests Makefile
|
||||
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
Makefile | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 16cd2f9bdd03..ea80923918f7 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -180,6 +180,8 @@ install: all install_hwlatdetect
|
||||
mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(mandir)/man4"
|
||||
mkdir -p "$(DESTDIR)$(srcdir)" "$(DESTDIR)$(mandir)/man8"
|
||||
cp $(TARGETS) "$(DESTDIR)$(bindir)"
|
||||
+ install src/queuelat/get_cpuinfo_mhz.sh "$(DESTDIR)$(bindir)"
|
||||
+ install src/queuelat/determine_maximum_mpps.sh "${DESTDIR}${bindir}"
|
||||
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"
|
||||
--
|
||||
2.20.1
|
||||
|
@ -0,0 +1,48 @@
|
||||
From 524aebc39039e0035a768b423ad66c4d03098a35 Mon Sep 17 00:00:00 2001
|
||||
From: John Kacur <jkacur@redhat.com>
|
||||
Date: Mon, 14 Jan 2019 21:39:47 +0100
|
||||
Subject: [PATCH 2/5] rt-tests: Makefile: ssdd: Incoroporate ssdd into the
|
||||
rt-tests Makefile
|
||||
|
||||
Incoroporate ssdd into the rt-tests build
|
||||
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
Makefile | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 06f399cc629d..16cd2f9bdd03 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -16,7 +16,8 @@ sources = cyclictest.c \
|
||||
svsematest.c \
|
||||
cyclicdeadline.c \
|
||||
deadline_test.c \
|
||||
- queuelat.c
|
||||
+ queuelat.c \
|
||||
+ ssdd.c
|
||||
|
||||
TARGETS = $(sources:.c=)
|
||||
LIBS = -lrt -lpthread
|
||||
@@ -86,6 +87,7 @@ VPATH += src/lib:
|
||||
VPATH += src/hackbench:
|
||||
VPATH += src/sched_deadline:
|
||||
VPATH += src/queuelat:
|
||||
+VPATH += src/ssdd:
|
||||
|
||||
$(OBJDIR)/%.o: %.c | $(OBJDIR)
|
||||
$(CC) -D VERSION=$(VERSION) -c $< $(CFLAGS) $(CPPFLAGS) -o $@
|
||||
@@ -146,6 +148,9 @@ hackbench: $(OBJDIR)/hackbench.o
|
||||
queuelat: $(OBJDIR)/queuelat.o $(OBJDIR)/librttest.a
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB)
|
||||
|
||||
+ssdd: $(OBJDIR)/ssdd.o $(OBJDIR)/librttest.a
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(RTTESTLIB)
|
||||
+
|
||||
LIBOBJS =$(addprefix $(OBJDIR)/,error.o rt-get_cpu.o rt-sched.o rt-utils.o)
|
||||
$(OBJDIR)/librttest.a: $(LIBOBJS)
|
||||
$(AR) rcs $@ $^
|
||||
--
|
||||
2.20.1
|
||||
|
97
SOURCES/rt-tests-hwlatdetect-Code-clean-up.patch
Normal file
97
SOURCES/rt-tests-hwlatdetect-Code-clean-up.patch
Normal file
@ -0,0 +1,97 @@
|
||||
From bbf4d5adf23fa2b81a1cdb92c40c3451376ac672 Mon Sep 17 00:00:00 2001
|
||||
From: John Kacur <jkacur@redhat.com>
|
||||
Date: Fri, 10 May 2019 15:58:39 +0200
|
||||
Subject: [PATCH 2/2] rt-tests: hwlatdetect.py: Code clean-up
|
||||
|
||||
- Remove obsolete from __future__
|
||||
- Fix spacing around calls to print, open and brackets
|
||||
- Fix spacing around assignments
|
||||
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
src/hwlatdetect/hwlatdetect.py | 18 +++++++++---------
|
||||
1 file changed, 9 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/src/hwlatdetect/hwlatdetect.py b/src/hwlatdetect/hwlatdetect.py
|
||||
index 368079a158b1..b72bdc3aa930 100755
|
||||
--- a/src/hwlatdetect/hwlatdetect.py
|
||||
+++ b/src/hwlatdetect/hwlatdetect.py
|
||||
@@ -8,7 +8,7 @@
|
||||
# modify it under the terms of the GNU General Public License Version 2
|
||||
# as published by the Free Software Foundation.
|
||||
|
||||
-from __future__ import print_function
|
||||
+
|
||||
|
||||
import sys
|
||||
import os
|
||||
@@ -84,7 +84,7 @@ class DebugFS(object):
|
||||
try:
|
||||
val = f.readline()
|
||||
except OSError as e:
|
||||
- print ("errno: %s" % e)
|
||||
+ print("errno: %s" % e)
|
||||
if e.errno == errno.EAGAIN:
|
||||
val = None
|
||||
else:
|
||||
@@ -159,7 +159,7 @@ class Kmod(object):
|
||||
return
|
||||
|
||||
# now look for already loaded module
|
||||
- for l in open ('/proc/modules'):
|
||||
+ for l in open('/proc/modules'):
|
||||
field = l.split()
|
||||
if self.name in field[0]:
|
||||
self.preloaded = True
|
||||
@@ -210,7 +210,7 @@ class Detector(object):
|
||||
if self.have_msr:
|
||||
p = subprocess.Popen(['/usr/sbin/rdmsr', '-a', '-d', '0x34'], stdout=subprocess.PIPE)
|
||||
p.wait()
|
||||
- counts = [ int(x.strip()) for x in p.stdout.readlines()]
|
||||
+ counts = [int(x.strip()) for x in p.stdout.readlines()]
|
||||
return counts
|
||||
|
||||
# methods for preventing/enabling c-state transitions
|
||||
@@ -295,11 +295,11 @@ class Tracer(Detector):
|
||||
|
||||
class Sample(object):
|
||||
'private class for tracer sample data'
|
||||
- __slots__= 'timestamp', 'inner', 'outer',
|
||||
+ __slots__ = 'timestamp', 'inner', 'outer',
|
||||
def __init__(self, line):
|
||||
fields = line.split()
|
||||
i,o = fields[6].split('/')
|
||||
- ts=fields[7][3:]
|
||||
+ ts = fields[7][3:]
|
||||
self.timestamp = str(ts)
|
||||
self.inner = int(i)
|
||||
self.outer = int(o)
|
||||
@@ -332,14 +332,14 @@ class Tracer(Detector):
|
||||
self.set('current_tracer', 'hwlat')
|
||||
|
||||
def set(self, field, val):
|
||||
- path=self.translate(field)
|
||||
+ path = self.translate(field)
|
||||
self.debugfs.putval(path, str(val))
|
||||
|
||||
def get(self, field):
|
||||
if field == "count":
|
||||
return len(self.samples)
|
||||
elif field == "max":
|
||||
- max=0
|
||||
+ max = 0
|
||||
for values in self.samples:
|
||||
s = int(values.largest())
|
||||
if s > max:
|
||||
@@ -435,7 +435,7 @@ class Hwlat(Detector):
|
||||
|
||||
def display(self):
|
||||
for s in self.samples:
|
||||
- print (s)
|
||||
+ print(s)
|
||||
|
||||
def save(self, output=None):
|
||||
if output:
|
||||
--
|
||||
2.20.1
|
||||
|
65
SOURCES/rt-tests-ssdd-Add-a-simple-manpage-for-ssdd.patch
Normal file
65
SOURCES/rt-tests-ssdd-Add-a-simple-manpage-for-ssdd.patch
Normal file
@ -0,0 +1,65 @@
|
||||
From e86709cd38349514dddbef0bf2b43c1d459797d3 Mon Sep 17 00:00:00 2001
|
||||
From: John Kacur <jkacur@redhat.com>
|
||||
Date: Fri, 14 Jun 2019 15:03:26 +0200
|
||||
Subject: [PATCH] rt-tests: ssdd: Add a simple manpage for ssdd
|
||||
|
||||
Add a simple manpage to rt-tests for ssdd, and modify the manpage to
|
||||
install it
|
||||
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
Makefile | 1 +
|
||||
src/ssdd/ssdd.8 | 29 +++++++++++++++++++++++++++++
|
||||
2 files changed, 30 insertions(+)
|
||||
create mode 100644 src/ssdd/ssdd.8
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index ea80923918f7..0258fe9b6dfd 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -194,6 +194,7 @@ install: all install_hwlatdetect
|
||||
gzip -c src/pi_tests/pip_stress.8 >"$(DESTDIR)$(mandir)/man8/pip_stress.8.gz"
|
||||
gzip -c src/queuelat/queuelat.8 >"$(DESTDIR)$(mandir)/man8/queuelat.8.gz"
|
||||
gzip -c src/sched_deadline/deadline_test.8 >"$(DESTDIR)$(mandir)/man8/deadline_test.8.gz"
|
||||
+ gzip -c src/ssdd/ssdd.8 >"$(DESTDIR)$(mandir)/man8/ssdd.8.gz"
|
||||
|
||||
.PHONY: install_hwlatdetect
|
||||
install_hwlatdetect: hwlatdetect
|
||||
diff --git a/src/ssdd/ssdd.8 b/src/ssdd/ssdd.8
|
||||
new file mode 100644
|
||||
index 000000000000..44638489f0d1
|
||||
--- /dev/null
|
||||
+++ b/src/ssdd/ssdd.8
|
||||
@@ -0,0 +1,29 @@
|
||||
+.TH SSDD 8 "June 13, 2019"
|
||||
+.SH NAME
|
||||
+ssdd \- have a tracer do a bunch of PTRACE_SINGLESTEPs
|
||||
+.SH SYNOPSIS
|
||||
+.B ssdd
|
||||
+.RI "[nforks] [niters]"
|
||||
+.SH DESCRIPTION
|
||||
+Have a tracer do a bunch of PTRACE_SINGLESTEPs against
|
||||
+a tracee as fast as possible. Create several of these
|
||||
+tracer/tracee pairs and see if they can be made to
|
||||
+interfere with each other.
|
||||
+The tracer waits on each PTRACE_SINGLESTEP with a waitpid(2)
|
||||
+and checks that waitpid's return values for correctness.
|
||||
+.SH OPTIONS
|
||||
+.B nforks
|
||||
+number of tracer/tracee pairs to fork off.
|
||||
+Default is 10.
|
||||
+.br
|
||||
+.TP
|
||||
+.B niters
|
||||
+number of PTRACE_SINGLESTEP iterations to
|
||||
+do before declaring success, for each tracer/
|
||||
+tracee pair set up. Default is 10,000.
|
||||
+
|
||||
+.SH AUTHOR
|
||||
+ssdd was written by Joe Korty <joe.korty@concurrent-rt.com>
|
||||
+.PP
|
||||
+This manual page was written by John Kacur <jkacur@redhat.com>
|
||||
+
|
||||
--
|
||||
2.20.1
|
||||
|
48
SOURCES/ssdd-change-the-written-pid.patch
Normal file
48
SOURCES/ssdd-change-the-written-pid.patch
Normal file
@ -0,0 +1,48 @@
|
||||
From 153c8171e07d88260b4d40fc7894eca220bbee5b Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
Date: Tue, 15 Jan 2019 11:32:26 +0100
|
||||
Subject: [PATCH 5/5] ssdd: change the written pid
|
||||
|
||||
During debugging it turned out to be helpful to see the parent pid
|
||||
and mostly the two tasks interact with each other: the tracer and
|
||||
tracee.
|
||||
Add this information it can searched for it.
|
||||
|
||||
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
src/ssdd/ssdd.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/ssdd/ssdd.c b/src/ssdd/ssdd.c
|
||||
index 68a426266dd9..4e293586526e 100644
|
||||
--- a/src/ssdd/ssdd.c
|
||||
+++ b/src/ssdd/ssdd.c
|
||||
@@ -144,7 +144,6 @@ static int forktests(int testid)
|
||||
struct sigaction act, oact;
|
||||
|
||||
parent = getpid();
|
||||
- printf("forktest#%d/%d: STARTING\n", testid, parent);
|
||||
|
||||
child = fork();
|
||||
if (child == -1) {
|
||||
@@ -155,6 +154,8 @@ static int forktests(int testid)
|
||||
if (!child)
|
||||
child_process();
|
||||
|
||||
+ printf("forktest#%d/%d/%d: STARTING\n", testid, parent, child);
|
||||
+
|
||||
act.sa_sigaction = sigchld;
|
||||
sigemptyset(&act.sa_mask);
|
||||
act.sa_flags = SA_SIGINFO;
|
||||
@@ -275,6 +276,7 @@ int main(int argc, char **argv)
|
||||
if (argc)
|
||||
nsteps = atoi(*argv);
|
||||
}
|
||||
+ printf("#main : %d\n", getpid());
|
||||
printf("#forks: %d\n", nforks);
|
||||
printf("#steps: %d\n", nsteps);
|
||||
printf("\n");
|
||||
--
|
||||
2.20.1
|
||||
|
61
SOURCES/ssdd-make-every-function-static.patch
Normal file
61
SOURCES/ssdd-make-every-function-static.patch
Normal file
@ -0,0 +1,61 @@
|
||||
From c3521e2c81e99078e7d32c43ddbd2287c67ff859 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
Date: Tue, 15 Jan 2019 11:32:24 +0100
|
||||
Subject: [PATCH 3/5] ssdd: make every function static
|
||||
|
||||
Those functions and variables are not used outside of main so they can
|
||||
be static.
|
||||
|
||||
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
src/ssdd/ssdd.c | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/ssdd/ssdd.c b/src/ssdd/ssdd.c
|
||||
index 6d09d54e34e1..9b85dfa9d223 100644
|
||||
--- a/src/ssdd/ssdd.c
|
||||
+++ b/src/ssdd/ssdd.c
|
||||
@@ -37,7 +37,7 @@
|
||||
#define STATE_EXITED_TSIG 6 /* exited with termination signal */
|
||||
#define STATE_EXITED_ERRSTAT 7 /* exited with non-zero status */
|
||||
|
||||
-char *state_name[] = {
|
||||
+static char *state_name[] = {
|
||||
[STATE_EXITED] = "STATE_EXITED",
|
||||
[STATE_STOPPED] = "STATE_STOPPED",
|
||||
[STATE_SIGNALED] = "STATE_SIGNALED",
|
||||
@@ -47,7 +47,7 @@ char *state_name[] = {
|
||||
[STATE_EXITED_ERRSTAT] = "STATE_EXITED_ERRSTAT"
|
||||
};
|
||||
|
||||
-const char *get_state_name(int state)
|
||||
+static const char *get_state_name(int state)
|
||||
{
|
||||
if (state < STATE_EXITED || state > STATE_EXITED_ERRSTAT)
|
||||
return "?";
|
||||
@@ -100,7 +100,7 @@ static int do_wait(pid_t *wait_pid, int *ret_sig)
|
||||
return STATE_UNKNOWN;
|
||||
}
|
||||
|
||||
-int check_sigchld(void)
|
||||
+static int check_sigchld(void)
|
||||
{
|
||||
int i;
|
||||
/*
|
||||
@@ -121,9 +121,9 @@ int check_sigchld(void)
|
||||
return got_sigchld;
|
||||
}
|
||||
|
||||
-pid_t parent;
|
||||
-int nforks = 10;
|
||||
-int nsteps = 10000;
|
||||
+static pid_t parent;
|
||||
+static int nforks = 10;
|
||||
+static int nsteps = 10000;
|
||||
|
||||
static void sigchld(int sig, unused siginfo_t * info, unused void *arg)
|
||||
{
|
||||
--
|
||||
2.20.1
|
||||
|
53
SOURCES/ssdd-remove-sleeps.patch
Normal file
53
SOURCES/ssdd-remove-sleeps.patch
Normal file
@ -0,0 +1,53 @@
|
||||
From b9f812a0c49584d82c37582c7523a5808628b985 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
Date: Tue, 15 Jan 2019 11:32:25 +0100
|
||||
Subject: [PATCH 4/5] ssdd: remove sleeps
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
There two sleep functions which ensure that the forked function sleeps
|
||||
and does not spin until everything is setup. There is no need for that,
|
||||
the scheduler will take care of that anyway. Also that sleep may
|
||||
complete before or after the testcase starts. If it completes afterwards
|
||||
then the testcase waits to start so…
|
||||
|
||||
Remove the sleep, it does change the outcome of the testcase.
|
||||
|
||||
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
Signed-off-by: John Kacur <jkacur@redhat.com>
|
||||
---
|
||||
src/ssdd/ssdd.c | 9 +--------
|
||||
1 file changed, 1 insertion(+), 8 deletions(-)
|
||||
|
||||
diff --git a/src/ssdd/ssdd.c b/src/ssdd/ssdd.c
|
||||
index 9b85dfa9d223..68a426266dd9 100644
|
||||
--- a/src/ssdd/ssdd.c
|
||||
+++ b/src/ssdd/ssdd.c
|
||||
@@ -132,12 +132,8 @@ static void sigchld(int sig, unused siginfo_t * info, unused void *arg)
|
||||
|
||||
static void child_process(void)
|
||||
{
|
||||
- unused volatile int i;
|
||||
-
|
||||
- /* wait for ptrace attach */
|
||||
- usleep(100000);
|
||||
while (1)
|
||||
- i = 0;
|
||||
+ ;
|
||||
}
|
||||
|
||||
static int forktests(int testid)
|
||||
@@ -170,9 +166,6 @@ static int forktests(int testid)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
- /* give both our child and parent time to set things up */
|
||||
- usleep(125000);
|
||||
-
|
||||
/*
|
||||
* Attach to the child.
|
||||
*/
|
||||
--
|
||||
2.20.1
|
||||
|
@ -6,7 +6,7 @@ Name: rt-tests
|
||||
# Numa argument to make: NUMA=1
|
||||
#
|
||||
Version: 1.3
|
||||
Release: 13%{?dist}
|
||||
Release: 21%{?dist}
|
||||
License: GPLv2
|
||||
Group: Development/Tools
|
||||
URL: git://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git
|
||||
@ -25,6 +25,20 @@ Patch10: rt-tests-deadline_test-Add-a-manpage.patch
|
||||
Patch11: rt-tests-cyclictest-Remove-numa-from-help.patch
|
||||
Patch12: rt-tests-deadline_test-Add-NULL-check-before-freeing.patch
|
||||
Patch13: queuelat-use-mfence-for-rdtsc-ordering.patch
|
||||
Patch14: cyclictest-fix_with_expected_identifier_in_latest.patch
|
||||
Patch15: cyclictest-Fix-compiler-warning-about-srncpy-output.patch
|
||||
Patch16: cyclictest-Make-sure-affinity-is-respected-when-numa.patch
|
||||
Patch17: Add-ssdd-test-to-the-rt-tests-suite.patch
|
||||
Patch18: rt-tests-Makefile-ssdd-Incoroporate-ssdd-into-the-rt.patch
|
||||
Patch19: ssdd-make-every-function-static.patch
|
||||
Patch20: ssdd-remove-sleeps.patch
|
||||
Patch21: ssdd-change-the-written-pid.patch
|
||||
Patch22: queuelat-Assume-queuelat-and-queuelat-scripts-in-path.patch
|
||||
Patch23: queuelat-Install-queuelat-helper-scripts-from-make.patch
|
||||
Patch24: hwlatdetect-disable-enable-c-state-transitions.patch
|
||||
Patch25: rt-tests-hwlatdetect-Code-clean-up.patch
|
||||
Patch26: rt-tests-ssdd-Add-a-simple-manpage-for-ssdd.patch
|
||||
Patch27: ptsematest-sigwaittest-pmqtest-svsematest-reprot-err.patch
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
||||
Obsoletes: cyclictest signaltest pi_tests
|
||||
@ -52,6 +66,20 @@ latency. It also tests the functioning of priority-inheritance mutexes.
|
||||
%patch11 -p1
|
||||
%patch12 -p1
|
||||
%patch13 -p1
|
||||
%patch14 -p1
|
||||
%patch15 -p1
|
||||
%patch16 -p1
|
||||
%patch17 -p1
|
||||
%patch18 -p1
|
||||
%patch19 -p1
|
||||
%patch20 -p1
|
||||
%patch21 -p1
|
||||
%patch22 -p1
|
||||
%patch23 -p1
|
||||
%patch24 -p1
|
||||
%patch25 -p1
|
||||
%patch26 -p1
|
||||
%patch27 -p1
|
||||
|
||||
%build
|
||||
make NUMA=1 HAVE_PARSE_CPUSTRING_ALL=1
|
||||
@ -83,6 +111,9 @@ rm -rf $RPM_BUILD_ROOT
|
||||
/usr/bin/cyclicdeadline
|
||||
/usr/bin/deadline_test
|
||||
/usr/bin/queuelat
|
||||
/usr/bin/ssdd
|
||||
/usr/bin/determine_maximum_mpps.sh
|
||||
/usr/bin/get_cpuinfo_mhz.sh
|
||||
%doc
|
||||
/usr/share/man/man8/cyclictest.8.gz
|
||||
/usr/share/man/man8/hackbench.8.gz
|
||||
@ -97,8 +128,35 @@ rm -rf $RPM_BUILD_ROOT
|
||||
/usr/share/man/man8/pip_stress.8.gz
|
||||
/usr/share/man/man8/queuelat.8.gz
|
||||
/usr/share/man/man8/deadline_test.8.gz
|
||||
/usr/share/man/man8/ssdd.8.gz
|
||||
|
||||
%changelog
|
||||
* Wed Jul 31 2019 John Kacur <jkacur@redhat.com> - 1.3-21
|
||||
- Fix problem when tests use tracing_enabled which is no longer supported
|
||||
Resolves: rhbz#1731336
|
||||
|
||||
* Fri Jun 14 2019 John Kacur <jkacur@redhat.com> - 1.3-20
|
||||
- Add a manpage for ssdd
|
||||
Resolves: rhbz#1718735
|
||||
|
||||
* Fri May 10 2019 John Kacur <jkacur@redhat.com> - 1.3-19
|
||||
- Disable/enable c-state transitions during hwlatdetect run
|
||||
Resolves: rhbz#1707505
|
||||
|
||||
* Tue May 07 2019 John Kacur <jkacur@redhat.com> - 1.3-18
|
||||
- Install queuelat scripts
|
||||
Resolves: rhbz#1686494
|
||||
|
||||
* Thu Apr 25 2019 John Kacur <jkacur@redhat.com> - 1.3-17
|
||||
- Add ssdd test to the rt-tests suite
|
||||
Resolves: rhbz#1666351
|
||||
|
||||
* Thu Mar 28 2019 John Kacur <jkacur@redhat.com> - 1.3-16
|
||||
- cyclictest-Make-sure-affinity-is-respected-when-numa.patch
|
||||
- cyclictest-Fix-compiler-warning-about-srncpy-output.patch
|
||||
- cyclictest-fix_with_expected_identifier_in_latest.patch
|
||||
Resolves: rhbz#1596857
|
||||
|
||||
* Tue Jan 08 2019 John Kacur <jkacur@redhat.com> - 1.3-13
|
||||
- queuelat: use mfence for rdtsc ordering
|
||||
Resolves: rhbz#1663865
|
||||
|
Loading…
Reference in New Issue
Block a user