diff options
author | Daniel Sangorrin <daniel.sangorrin@gmail.com> | 2011-05-04 15:04:41 -0500 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2011-05-04 15:04:41 -0500 |
commit | 4681c81debd1aa204a0f3bad4baa859700dd48ca (patch) | |
tree | 60d909aa047d7a774a2885544f971a9e7523515e | |
parent | a5693cc7854fbb5a60931407440a53f2efd81dc1 (diff) | |
download | rt-tests-4681c81debd1aa204a0f3bad4baa859700dd48ca.tar.gz rt-tests-4681c81debd1aa204a0f3bad4baa859700dd48ca.tar.xz |
fix sched_setaffinity type error when building with UCLIBC
Change type of faux sched_setaffinity to match headers.
Also add additional report info when dumping histogram.
Signed-off-by: Clark Williams <williams@redhat.com>
-rw-r--r-- | src/cyclictest/cyclictest.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c index 0847aed..0038c1a 100644 --- a/src/cyclictest/cyclictest.c +++ b/src/cyclictest/cyclictest.c @@ -65,14 +65,17 @@ static int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec return syscall(__NR_clock_nanosleep, clock_id, flags, req, rem); } -static int sched_setaffinity(pid_t pid, unsigned int cpusetsize, - cpu_set_t *mask) +int sched_setaffinity (__pid_t __pid, size_t __cpusetsize, + __const cpu_set_t *__cpuset) { return -EINVAL; } -static void CPU_SET(int cpu, cpu_set_t *set) { } -static void CPU_ZERO(cpu_set_t *set) { } +#undef CPU_SET +#undef CPU_ZERO +#define CPU_SET(cpu, cpusetp) +#define CPU_ZERO(cpusetp) + #else extern int clock_nanosleep(clockid_t __clock_id, int __flags, __const struct timespec *__req, @@ -1160,6 +1163,15 @@ static void print_hist(struct thread_param *par[], int nthreads) for (j = 0; j < nthreads; j++) printf(" %09llu", log_entries[j]); printf("\n"); + printf("# Min Latencys:"); + for (j = 0; j < nthreads; j++) + printf(" %05lu", par[j]->stats->min); + printf("\n"); + printf("# Avg Latencys:"); + for (j = 0; j < nthreads; j++) + printf(" %05lu", par[j]->stats->cycles ? + (long)(par[j]->stats->avg/par[j]->stats->cycles) : 0); + printf("\n"); printf("# Max Latencys:"); for (j = 0; j < nthreads; j++) printf(" %05lu", par[j]->stats->max); |