diff options
Diffstat (limited to 'src/cyclictest/cyclictest.c')
-rw-r--r-- | src/cyclictest/cyclictest.c | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c index 975e785..b53fb27 100644 --- a/src/cyclictest/cyclictest.c +++ b/src/cyclictest/cyclictest.c @@ -40,6 +40,8 @@ #include "rt-utils.h" +#include <bionic.h> + #define DEFAULT_INTERVAL 1000 #define DEFAULT_DISTANCE 500 @@ -87,15 +89,7 @@ int sched_setaffinity (__pid_t __pid, size_t __cpusetsize, extern int clock_nanosleep(clockid_t __clock_id, int __flags, __const struct timespec *__req, struct timespec *__rem); -#endif - -#ifdef NO_PTHREAD_SETAFFINITY -static inline int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, - const cpu_set_t *cpuset) -{ - return sched_setaffinity(0, cpusetsize, cpuset); -} -#endif +#endif /* __UCLIBC__ */ #define USEC_PER_SEC 1000000 #define NSEC_PER_SEC 1000000000 @@ -202,14 +196,12 @@ static pthread_mutex_t break_thread_id_lock = PTHREAD_MUTEX_INITIALIZER; static pid_t break_thread_id = 0; static uint64_t break_thread_value = 0; -#ifndef NO_PTHREAD_BARRIER static int aligned = 0; static int secaligned = 0; static int offset = 0; static pthread_barrier_t align_barr; static pthread_barrier_t globalt_barr; static struct timespec globalt; -#endif /* Backup of kernel variables that we modify */ static struct kvars { @@ -813,7 +805,6 @@ static void *timerthread(void *param) par->cpu, par->prio); /* Get current time */ -#ifndef NO_PTHREAD_BARRIER if (aligned || secaligned) { pthread_barrier_wait(&globalt_barr); if (par->tnum == 0) { @@ -838,7 +829,6 @@ static void *timerthread(void *param) tsnorm(&now); } } else -#endif clock_gettime(par->clock, &now); next = now; @@ -1052,9 +1042,7 @@ static void display_help(int error) "-a [NUM] --affinity run thread #N on processor #N, if possible\n" " with NUM pin all threads to the processor NUM\n" #endif -#ifndef NO_PTHREAD_BARRIER "-A USEC --aligned=USEC align thread wakeups to a specific offset\n" -#endif "-b USEC --breaktrace=USEC send break trace command when latency > USEC\n" "-B --preemptirqs both preempt and irqsoff tracing (used with -b)\n" "-c CLOCK --clock=CLOCK select clock\n" @@ -1095,9 +1083,7 @@ static void display_help(int error) "-R --resolution check clock resolution, calling clock_gettime() many\n" " times. list of clock_gettime() values will be\n" " reported with -X\n" -#ifndef NO_PTHREAD_BARRIER " --secaligned [USEC] align thread wakeups to the next full second,\n" -#endif " and apply the optional offset\n" "-s --system use sys_nanosleep and sys_setitimer\n" "-S --smp Standard SMP testing: options -a -t -n and\n" @@ -1247,10 +1233,7 @@ enum option_values { OPT_PRIOSPREAD, OPT_RELATIVE, OPT_RESOLUTION, OPT_SYSTEM, OPT_SMP, OPT_THREADS, OPT_TRACER, OPT_UNBUFFERED, OPT_NUMA, OPT_VERBOSE, OPT_WAKEUP, OPT_WAKEUPRT, OPT_DBGCYCLIC, OPT_POLICY, OPT_HELP, OPT_NUMOPTS, -#ifndef NO_PTHREAD_BARRIER - OPT_ALIGNED, OPT_SECALIGNED, -#endif - OPT_LAPTOP, + OPT_ALIGNED, OPT_SECALIGNED, OPT_LAPTOP, }; /* Process commandline options */ @@ -1268,9 +1251,7 @@ static void process_options (int argc, char *argv[], int max_cpus) static struct option long_options[] = { {"affinity", optional_argument, NULL, OPT_AFFINITY}, {"notrace", no_argument, NULL, OPT_NOTRACE }, -#ifndef NO_PTHREAD_BARRIER {"aligned", optional_argument, NULL, OPT_ALIGNED }, -#endif {"breaktrace", required_argument, NULL, OPT_BREAKTRACE }, {"preemptirqs", no_argument, NULL, OPT_PREEMPTIRQ }, {"clock", required_argument, NULL, OPT_CLOCK }, @@ -1300,9 +1281,7 @@ static void process_options (int argc, char *argv[], int max_cpus) {"priospread", no_argument, NULL, OPT_PRIOSPREAD }, {"relative", no_argument, NULL, OPT_RELATIVE }, {"resolution", no_argument, NULL, OPT_RESOLUTION }, -#ifndef NO_PTHREAD_BARRIER {"secaligned", optional_argument, NULL, OPT_SECALIGNED }, -#endif {"system", no_argument, NULL, OPT_SYSTEM }, {"smp", no_argument, NULL, OPT_SMP }, {"threads", optional_argument, NULL, OPT_THREADS }, @@ -1337,7 +1316,6 @@ static void process_options (int argc, char *argv[], int max_cpus) setaffinity = AFFINITY_USEALL; } break; -#ifndef NO_PTHREAD_BARRIER case 'A': case OPT_ALIGNED: aligned=1; @@ -1348,7 +1326,6 @@ static void process_options (int argc, char *argv[], int max_cpus) else offset = 0; break; -#endif case 'b': case OPT_BREAKTRACE: tracelimit = atoi(optarg); break; @@ -1449,7 +1426,6 @@ static void process_options (int argc, char *argv[], int max_cpus) case OPT_RESOLUTION: check_clock_resolution = 1; break; case 's': -#ifndef NO_PTHREAD_BARRIER case OPT_SECALIGNED: secaligned = 1; if (optarg != NULL) @@ -1459,7 +1435,6 @@ static void process_options (int argc, char *argv[], int max_cpus) else offset = 0; break; -#endif case OPT_SYSTEM: use_system = MODE_SYS_OFFSET; break; case 'S': @@ -1596,7 +1571,6 @@ static void process_options (int argc, char *argv[], int max_cpus) if (num_threads < 1) error = 1; -#ifndef NO_PTHREAD_BARRIER if (aligned && secaligned) error = 1; @@ -1604,7 +1578,6 @@ static void process_options (int argc, char *argv[], int max_cpus) pthread_barrier_init(&globalt_barr, NULL, num_threads); pthread_barrier_init(&align_barr, NULL, num_threads); } -#endif if (error) { if (affinity_mask) rt_bitmask_free(affinity_mask); |