commit rt-tests for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package rt-tests for openSUSE:Factory checked in at 2021-08-31 19:55:39 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rt-tests (Old) and /work/SRC/openSUSE:Factory/.rt-tests.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "rt-tests" Tue Aug 31 19:55:39 2021 rev:7 rq:915214 version:2.2 Changes: -------- --- /work/SRC/openSUSE:Factory/rt-tests/rt-tests.changes 2021-07-29 21:33:05.972687165 +0200 +++ /work/SRC/openSUSE:Factory/.rt-tests.new.1899/rt-tests.changes 2021-08-31 19:56:33.802027686 +0200 @@ -1,0 +2,9 @@ +Tue Aug 31 08:27:01 UTC 2021 - Daniel Wagner <daniel.wagner@suse.com> + +- Update to upstream version v2.2 + * signaltest: Fix JSON output latency values for 32bit machines + * oslat: Don't take trace_threshold into account during preheat + * sched_deadline: Update HRTICK_DL location + * Allow static builds by dropping dependency on pthread_getaffinity_np + +------------------------------------------------------------------- Old: ---- rt-tests-2.1.tar.gz New: ---- rt-tests-2.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rt-tests.spec ++++++ --- /var/tmp/diff_new_pack.F7iiuS/_old 2021-08-31 19:56:34.242028295 +0200 +++ /var/tmp/diff_new_pack.F7iiuS/_new 2021-08-31 19:56:34.242028295 +0200 @@ -17,7 +17,7 @@ Name: rt-tests -Version: 2.1 +Version: 2.2 Release: 0 Summary: Realtime Kernel Testsuite License: GPL-2.0-only ++++++ rt-tests-2.1.tar.gz -> rt-tests-2.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rt-tests-2.1/Makefile new/rt-tests-2.2/Makefile --- old/rt-tests-2.1/Makefile 2021-06-30 05:09:41.000000000 +0200 +++ new/rt-tests-2.2/Makefile 2021-08-31 03:58:19.000000000 +0200 @@ -1,4 +1,4 @@ -VERSION = 2.1 +VERSION = 2.2 CC = $(CROSS_COMPILE)gcc AR = $(CROSS_COMPILE)ar diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rt-tests-2.1/src/lib/rt-numa.c new/rt-tests-2.2/src/lib/rt-numa.c --- old/rt-tests-2.1/src/lib/rt-numa.c 2021-06-30 05:09:41.000000000 +0200 +++ new/rt-tests-2.2/src/lib/rt-numa.c 2021-08-31 03:58:19.000000000 +0200 @@ -68,15 +68,13 @@ int cpu_for_thread_ua(int thread_num, int max_cpus) { int res, num_cpus, i, m, cpu; - pthread_t thread; cpu_set_t cpuset; - thread = pthread_self(); CPU_ZERO(&cpuset); - res = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset); + res = sched_getaffinity(0, sizeof(cpu_set_t), &cpuset); if (res != 0) - fatal("pthread_getaffinity_np failed: %s\n", strerror(res)); + fatal("sched_getaffinity failed: %s\n", strerror(res)); num_cpus = CPU_COUNT(&cpuset); m = thread_num % num_cpus; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rt-tests-2.1/src/oslat/oslat.c new/rt-tests-2.2/src/oslat/oslat.c --- old/rt-tests-2.1/src/oslat/oslat.c 2021-06-30 05:09:41.000000000 +0200 +++ new/rt-tests-2.2/src/oslat/oslat.c 2021-08-31 03:58:19.000000000 +0200 @@ -29,7 +29,7 @@ #include <numa.h> #include <math.h> #include <limits.h> -#include <inttypes.h> +#include <stdbool.h> #include <sys/prctl.h> #include <sys/stat.h> @@ -151,6 +151,7 @@ struct global { /* Configuration. */ unsigned int runtime_secs; + bool preheat; /* * Number of threads running for current test * (either pre heat or real run) @@ -300,7 +301,7 @@ us = index + 1; assert(us > 0); - if (g.trace_threshold && us >= g.trace_threshold) { + if (!g.preheat && g.trace_threshold && us >= g.trace_threshold) { char *line = "%s: Trace threshold (%d us) triggered with %u us!\n" "Stopping the test.\n"; tracemark(line, g.app_name, g.trace_threshold, us); @@ -516,11 +517,12 @@ fprintf(f, " }\n"); } -static void run_expt(struct thread *threads, int runtime_secs) +static void run_expt(struct thread *threads, int runtime_secs, bool preheat) { int i; g.runtime_secs = runtime_secs; + g.preheat = preheat; g.n_threads_started = 0; g.n_threads_running = 0; g.n_threads_finished = 0; @@ -847,14 +849,14 @@ g.n_threads = 1; else g.n_threads = g.n_threads_total; - run_expt(threads, 1); + run_expt(threads, 1, true); record_bias(threads); if (!g.quiet) printf("Test starts...\n"); /* Reset n_threads to always run on all the cores */ g.n_threads = g.n_threads_total; - run_expt(threads, g.runtime); + run_expt(threads, g.runtime, false); if (!g.quiet) printf("Test completed.\n\n"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rt-tests-2.1/src/pi_tests/pi_stress.c new/rt-tests-2.2/src/pi_tests/pi_stress.c --- old/rt-tests-2.1/src/pi_tests/pi_stress.c 2021-06-30 05:09:41.000000000 +0200 +++ new/rt-tests-2.2/src/pi_tests/pi_stress.c 2021-08-31 03:58:19.000000000 +0200 @@ -668,7 +668,7 @@ } /* initial state */ - pi_debug("low_priority[%d]: entering start wait (%d)\n", p->id, + pi_debug("low_priority[%d]: entering start wait (%ld)\n", p->id, count++); status = pthread_barrier_wait(&p->start_barrier); if (status && status != PTHREAD_BARRIER_SERIAL_THREAD) { @@ -796,7 +796,7 @@ } /* start state */ - pi_debug("med_priority[%d]: entering start state (%d)\n", p->id, + pi_debug("med_priority[%d]: entering start state (%ld)\n", p->id, count++); status = pthread_barrier_wait(&p->start_barrier); if (status && status != PTHREAD_BARRIER_SERIAL_THREAD) { @@ -949,8 +949,7 @@ status = pthread_barrier_wait(&p->finish_barrier); if (status && status != PTHREAD_BARRIER_SERIAL_THREAD) { pi_error - ("high_priority[%d]: pthread_barrier_wait(finish): %x", - status); + ("high_priority[%d]: pthread_barrier_wait(finish): %x", p->id, status); return NULL; } /* update the group stats */ @@ -1259,10 +1258,8 @@ k = strsep(&buf, del); } - if (!id) { - free(buf); + if (!id) return FAILURE; - } /* We do not validate the options, instead we pass all garbage * to the kernel and see what's happening */ @@ -1280,7 +1277,6 @@ retval = FAILURE; } - free(buf); return retval; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rt-tests-2.1/src/pi_tests/pip_stress.c new/rt-tests-2.2/src/pi_tests/pip_stress.c --- old/rt-tests-2.1/src/pi_tests/pip_stress.c 2021-06-30 05:09:41.000000000 +0200 +++ new/rt-tests-2.2/src/pi_tests/pip_stress.c 2021-08-31 03:58:19.000000000 +0200 @@ -254,7 +254,7 @@ res = sysconf(_SC_THREAD_PROCESS_SHARED); if (res == -1) { int err = errno; /* save the error number */ - err_msg("%s: sysconf(_SC_THREAD_PROCESS_SHARED): "); + err_msg("%s: sysconf(_SC_THREAD_PROCESS_SHARED): ", __func__); err_exit(err, NULL); } #else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rt-tests-2.1/src/ptsematest/ptsematest.c new/rt-tests-2.2/src/ptsematest/ptsematest.c --- old/rt-tests-2.1/src/ptsematest/ptsematest.c 2021-06-30 05:09:41.000000000 +0200 +++ new/rt-tests-2.2/src/ptsematest/ptsematest.c 2021-08-31 03:58:19.000000000 +0200 @@ -58,7 +58,6 @@ void *semathread(void *param) { int mustgetcpu = 0; - int first = 1; struct params *par = param; cpu_set_t mask; int policy = SCHED_FIFO; @@ -92,11 +91,6 @@ if (mustgetcpu) par->cpu = get_cpu(); } else { - /* Receiver */ - if (!first) { - pthread_mutex_lock(&syncmutex[par->num]); - first = 1; - } pthread_mutex_lock(&testmutex[par->num]); /* ... Got the lock: End of latency measurement */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rt-tests-2.1/src/sched_deadline/cyclicdeadline.c new/rt-tests-2.2/src/sched_deadline/cyclicdeadline.c --- old/rt-tests-2.1/src/sched_deadline/cyclicdeadline.c 2021-06-30 05:09:41.000000000 +0200 +++ new/rt-tests-2.2/src/sched_deadline/cyclicdeadline.c 2021-08-31 03:58:19.000000000 +0200 @@ -230,13 +230,55 @@ mark_fd = open(files, O_WRONLY); } +/* + * Return true if file exists + */ +static int check_file_exists(char *path) +{ + int ret; + struct stat st; + + ret = !stat(path, &st); + + return ret; + +} + +/* + * Return 0 on success + */ + +static int fill_sched_features(char *path) +{ + int ret; + const char *debugfs; + + debugfs = find_debugfs(); + if (strlen(debugfs) == 0) + return -1; + + snprintf(path, MAX_PATH, "%s/sched/features", debugfs); + ret = check_file_exists(path); + if (ret) + return 0; + + snprintf(path, MAX_PATH, "%s/sched_features", debugfs); + ret = check_file_exists(path); + if (ret) + return 0; + + memset(path, 0, MAX_PATH); + + return ret; + +} + static int setup_hr_tick(void) { - const char *debugfs = find_debugfs(); - char files[strlen(debugfs) + strlen("/sched_features") + 1]; + char path[MAX_PATH]; char buf[500]; - struct stat st; static int set = 0; + int hrtick_dl = 0; char *p; int ret; int len; @@ -244,27 +286,23 @@ if (set) return 1; - set = 1; - if (strlen(debugfs) == 0) + ret = fill_sched_features(path); + if (ret) return 0; - sprintf(files, "%s/sched_features", debugfs); - ret = stat(files, &st); - if (ret < 0) - return 0; - - fd = open(files, O_RDWR); - perror(files); - if (fd < 0) + fd = open(path, O_RDWR); + if (fd < 0) { + perror(path); return 0; + } len = sizeof(buf); ret = read(fd, buf, len); if (ret < 0) { - perror(files); + perror(path); close(fd); return 0; } @@ -274,18 +312,34 @@ ret = 1; - p = strstr(buf, "HRTICK"); - if (p + 3 >= buf) { + p = strstr(buf, "HRTICK_DL"); + if (p && p - 3 >= buf) { + hrtick_dl = 1; p -= 3; - if (strncmp(p, "NO_HRTICK", 9) == 0) { - ret = write(fd, "HRTICK", 6); - if (ret != 6) + if (strncmp(p, "NO_HRTICK_DL", 12) == 0) { + ret = write(fd, "HRTICK_DL", 9); + if (ret != 9) ret = 0; else ret = 1; } } + /* Backwards compatibility for kernel that only have HRTICK */ + if (!hrtick_dl) { + p = strstr(buf, "HRTICK"); + if (p && p - 3 >= buf) { + p -=3; + if (strncmp(p, "NO_HRTICK", 9) == 0) { + ret = write(fd, "HRTICK", 6); + if (ret != 6) + ret = 0; + else + ret = 1; + } + } + } + close(fd); return ret; } @@ -1092,7 +1146,7 @@ /* Default cpu to use is the last one */ if (!all_cpus && !setcpu) { - setcpu_buf = malloc(10); + setcpu_buf = malloc(12); if (!setcpu_buf) fatal("malloc"); sprintf(setcpu_buf, "%d", cpu_count - 1); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rt-tests-2.1/src/sched_deadline/deadline_test.c new/rt-tests-2.2/src/sched_deadline/deadline_test.c --- old/rt-tests-2.1/src/sched_deadline/deadline_test.c 2021-06-30 05:09:41.000000000 +0200 +++ new/rt-tests-2.2/src/sched_deadline/deadline_test.c 2021-08-31 03:58:19.000000000 +0200 @@ -368,6 +368,49 @@ mark_fd = open(files, O_WRONLY); } +/* + * Return true if file exists + */ +static int check_file_exists(char *path) +{ + int ret; + struct stat st; + + ret = !stat(path, &st); + + return ret; + +} + +/* + * Return 0 on success + */ + +static int fill_sched_features(char *path) +{ + int ret; + const char *debugfs; + + debugfs = find_debugfs(); + if (strlen(debugfs) == 0) + return -1; + + snprintf(path, MAX_PATH, "%s/sched/features", debugfs); + ret = check_file_exists(path); + if (ret) + return 0; + + snprintf(path, MAX_PATH, "%s/sched_features", debugfs); + ret = check_file_exists(path); + if (ret) + return 0; + + memset(path, 0, MAX_PATH); + + return ret; + +} + /** * setup_hr_tick - Enable the HRTICK in sched_features (if available) * @@ -381,11 +424,10 @@ */ static int setup_hr_tick(void) { - const char *debugfs = find_debugfs(); - char files[strlen(debugfs) + strlen("/sched_features") + 1]; + char path[MAX_PATH]; char buf[500]; - struct stat st; static int set = 0; + int hrtick_dl = 0; char *p; int ret; int len; @@ -396,17 +438,13 @@ set = 1; - if (strlen(debugfs) == 0) - return 0; - - sprintf(files, "%s/sched_features", debugfs); - ret = stat(files, &st); - if (ret < 0) + ret = fill_sched_features(path); + if (ret) return 0; - fd = open(files, O_RDWR); + fd = open(path, O_RDWR); if (fd < 0) { - perror(files); + perror(path); return 0; } @@ -414,7 +452,7 @@ ret = read(fd, buf, len); if (ret < 0) { - perror(files); + perror(path); close(fd); return 0; } @@ -424,18 +462,35 @@ ret = 1; - p = strstr(buf, "HRTICK"); - if (p + 3 >= buf) { + p = strstr(buf, "HRTICK_DL"); + if (p && p - 3 >= buf) { + hrtick_dl = 1; p -= 3; - if (strncmp(p, "NO_HRTICK", 9) == 0) { - ret = write(fd, "HRTICK", 6); - if (ret != 6) + if (strncmp(p, "NO_HRTICK_DL", 12) == 0) { + ret = write(fd, "HRTICK_DL", 9); + if (ret != 9) ret = 0; else ret = 1; } } + /* Backwards compatibility for kernel that only have HRTICK */ + if (!hrtick_dl) { + p = strstr(buf, "HRTICK"); + if (p && p - 3 >= buf) { + p -=3; + if (strncmp(p, "NO_HRTICK", 9) == 0) { + ret = write(fd, "HRTICK", 6); + if (ret != 6) + ret = 0; + else + ret = 1; + } + } + } + + close(fd); return ret; } @@ -673,12 +728,12 @@ int *pids; int i; - va_start(ap, flags); - fd = open_cpuset(path, "tasks"); if (fd < 0) return "open tasks"; + va_start(ap, flags); + ret = 0; pids = va_arg(ap, int *); @@ -818,10 +873,6 @@ goto again; fprintf(stderr, "Failed to remove %s\n", path); perror("rmdir"); - if (retry++ < 5) { - fprintf(stderr, "Trying again\n"); - goto again; - } } } @@ -1766,6 +1817,11 @@ exit(-1); } + if (nr_threads < 1) { + fprintf(stderr, "The number of threads must be at least 1\n"); + exit(-1); + } + if (setcpu) { nr_cpus = calc_nr_cpus(setcpu, &setcpu_buf); if (nr_cpus < 0) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rt-tests-2.1/src/signaltest/signaltest.c new/rt-tests-2.2/src/signaltest/signaltest.c --- old/rt-tests-2.1/src/signaltest/signaltest.c 2021-06-30 05:09:41.000000000 +0200 +++ new/rt-tests-2.2/src/signaltest/signaltest.c 2021-08-31 03:58:19.000000000 +0200 @@ -393,9 +393,9 @@ for (i = 0; i < num_threads; i++) { fprintf(f, " \"%u\": {\n", i); s = &par->stats[i]; - fprintf(f, " \"cycles\": %" PRIu64 ",\n", s->cycles); - fprintf(f, " \"min\": %" PRIu64 ",\n", s->min); - fprintf(f, " \"max\": %" PRIu64 ",\n", s->max); + fprintf(f, " \"cycles\": %ld,\n", s->cycles); + fprintf(f, " \"min\": %ld,\n", s->min); + fprintf(f, " \"max\": %ld,\n", s->max); fprintf(f, " \"avg\": %.2f,\n", s->avg/s->cycles); fprintf(f, " \"cpu\": %d\n", par->cpu); fprintf(f, " }%s\n", i == num_threads - 1 ? "" : ",");
participants (1)
-
Source-Sync