rt-tests: cyclicdeadline: Fix usage for duration
PATCH 1/5 rt-tests: cyclicdeadline: Fix usage for duration
Fix the usage message for the -D or --duration option to indicate that the default length is in seconds if you don't append 'm', 'h', or 'd' for minutes, hours or days.
--- src/sched_deadline/cyclicdeadline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/sched_deadline/cyclicdeadline.c +1 -1
@@ -688,7 +688,7 @@ static void usage(int error)"-a [CPUSET] --affinity Comma/hyphen separated list of CPUs to run deadline\n" " tasks on. An empty CPUSET runs on all CPUs a deadline\n" " task.\n" -"-D TIME --duration Specify a length for the test run.\n" +"-D TIME --duration Specify a length in seconds for the test run.\n" " Append 'm', 'h', or 'd' to specify minutes, hours or\n" " days\n" "-h --help Show this help menu.\n"
Signature · 1 line
2.49.0
PATCH 2/5 Revert "Fix rt-tests build with glibc-2.41"
This reverts commit d3a23a0cc76789c3083df3bad78982cd49bc4c5e.
When people backport the feature into earlier versions of glibc, then the patches fails.
--- src/include/rt-sched.h | 2 -- src/lib/rt-sched.c | 2 -- 2 files changed, 4 deletions(-)
src/include/rt-sched.h +0 -2
@@ -42,7 +42,6 @@#define __NR_sched_getattr 275#endif -#if ! __GLIBC_PREREQ(2, 41)struct sched_attr {uint32_t size;uint32_t sched_policy;
@@ -68,6 +67,5 @@ int sched_getattr(pid_t pid,struct sched_attr *attr, unsigned int size, unsigned int flags); -#endif #endif /* __RT_SCHED_H__ */
src/lib/rt-sched.c +0 -2
@@ -14,7 +14,6 @@#include "rt-sched.h" -#if !__GLIBC_PREREQ (2 ,41 )int sched_setattr (pid_t pid,const struct sched_attr *attr,unsigned int flags)
@@ -29,4 +28,3 @@ int sched_getattr(pid_t pid, {return syscall (__NR_sched_getattr, pid, attr, size, flags); } -#endif
Signature · 1 line
2.49.0
PATCH 3/5 sched_attr: Do not define for glibc >= 2.41
In reply to John KacurFrom: Khem Raj <[email protected]>
glibc 2.41+ has added [1] definitions for sched_setattr and sched_getattr functions and struct sched_attr. Therefore, it needs to be checked for here as well before defining sched_attr
Define sched_attr conditionally on SCHED_ATTR_SIZE_VER0
Fixes builds with glibc/trunk
--- src/include/rt-sched.h | 4 ++++ 1 file changed, 4 insertions(+)
src/include/rt-sched.h +4 -0
@@ -42,6 +42,8 @@#define __NR_sched_getattr 275#endif +/* sched_attr is not defined in glibc < 2.41 */ +#ifndef SCHED_ATTR_SIZE_VER0 struct sched_attr { uint32_t size; uint32_t sched_policy;
@@ -68,4 +70,6 @@ int sched_getattr(pid_t pid,unsigned int size, unsigned int flags); +#endif /* SCHED_ATTR_SIZE_VER0 */ +#endif /* __RT_SCHED_H__ */
Signature · 1 line
2.49.0
PATCH 4/5 rteval: pi_stress: Change PRIu64 to llu to match upstream sched_attr
In reply to John Kacur- Change from PRIu64 to llu to match upstream glibc sched_attr. This change is for when we are getting the definitions from upstream glibc
- Change our definition in rt-sched.h to match upstream glibc This change is for when we are using our own definition of structsched_attr
--- src/include/rt-sched.h | 6 +++--- src/pi_tests/pi_stress.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
src/include/rt-sched.h +3 -3
@@ -56,9 +56,9 @@ struct sched_attr {uint32_t sched_priority;/* SCHED_DEADLINE */ -uint64_t sched_runtime; -uint64_t sched_deadline; -uint64_t sched_period; +unsigned long long sched_runtime; +unsigned long long sched_deadline; +unsigned long long sched_period; }; int sched_setattr(pid_t pid,
src/pi_tests/pi_stress.c +1 -1
@@ -1294,7 +1294,7 @@ void print_sched_attr(const char *name, struct sched_attr *sa)printf (" priority %d\n" , sa->sched_priority);break ;case SCHED_DEADLINE : -printf (" runtime %" PRIu64" deadline %" PRIu64" period %" PRIu64"\n" , +printf (" runtime %llu deadline %llu period %llu\n" , sa->sched_runtime, sa->sched_deadline, sa->sched_period);break ;
Signature · 1 line
2.49.0
PATCH 5/5 Makefile: Use -Wno-error=format-truncation=
In reply to John KacurSince compile warnings are now errors, use -Wno-error=format-truncation= at least until we can sort out MAXPATH MAX_PATH, PATH_MAX and determine what is needed.
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
@@ -33,7 +33,7 @@ prefix ?= /usr/local bindir ?= $(prefix)/bin mandir ?= $(prefix)/share/man -CFLAGS ?= -Wall -Werror -Wno-nonnull -Wextra -Wno-sign-compare -Wno-unused-parameter +CFLAGS ?= -Wall -Werror -Wno-nonnull -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-error=format-truncation= CPPFLAGS += -D_GNU_SOURCE -Isrc/include LDFLAGS ?=
Signature · 1 line
2.49.0