projects
/
userspace-rcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tests: use standard malloc/free for synchronize_rcu()
[userspace-rcu.git]
/
tests
/
test_looplen.c
diff --git
a/tests/test_looplen.c
b/tests/test_looplen.c
index 53d39cd9edb6d559bebeb9794b0599591154cfa8..e1bd2ea25a037238cba132ba61d2879b1fd36f24 100644
(file)
--- a/
tests/test_looplen.c
+++ b/
tests/test_looplen.c
@@
-30,12
+30,15
@@
#include <unistd.h>
#include <stdio.h>
#include <assert.h>
#include <unistd.h>
#include <stdio.h>
#include <assert.h>
-#include <sys/syscall.h>
#include <sched.h>
#include <errno.h>
#include <urcu/arch.h>
#include <sched.h>
#include <errno.h>
#include <urcu/arch.h>
+#ifdef __linux__
+#include <syscall.h>
+#endif
+
#if defined(_syscall0)
_syscall0(pid_t, gettid)
#elif defined(__NR_gettid)
#if defined(_syscall0)
_syscall0(pid_t, gettid)
#elif defined(__NR_gettid)
@@
-58,10
+61,10
@@
static inline pid_t gettid(void)
#endif
#include <urcu.h>
#endif
#include <urcu.h>
-static inline void loop_sleep(unsigned long l)
+static inline void loop_sleep(unsigned long l
oops
)
{
{
- while
(l
-- != 0)
- cpu_relax();
+ while
(loops
-- != 0)
+ c
aa_c
pu_relax();
}
#define LOOPS 1048576
}
#define LOOPS 1048576
@@
-75,9
+78,9
@@
int main(int argc, char **argv)
double cpl;
for (i = 0; i < TESTS; i++) {
double cpl;
for (i = 0; i < TESTS; i++) {
- time1 = get_cycles();
+ time1 =
caa_
get_cycles();
loop_sleep(LOOPS);
loop_sleep(LOOPS);
- time2 = get_cycles();
+ time2 =
caa_
get_cycles();
time_tot += time2 - time1;
}
cpl = ((double)time_tot) / (double)TESTS / (double)LOOPS;
time_tot += time2 - time1;
}
cpl = ((double)time_tot) / (double)TESTS / (double)LOOPS;
This page took
0.025068 seconds
and
4
git commands to generate.