projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fio.1: minor fixes
[fio.git]
/
gettime.c
diff --git
a/gettime.c
b/gettime.c
index 48aeb075b65e1c9182e41a3c1240603ebf968691..136c02c15af797bc9057ea10a1511f1d79e856a4 100644
(file)
--- a/
gettime.c
+++ b/
gettime.c
@@
-1,15
+1,15
@@
/*
/*
- *
Memory helper
s
+ *
Clock function
s
*/
*/
+
#include <unistd.h>
#include <sys/time.h>
#include "fio.h"
#include <unistd.h>
#include <sys/time.h>
#include "fio.h"
-#include "os.h"
#include "hash.h"
#include "hash.h"
-static int clock_gettime_works =
1
;
+static int clock_gettime_works =
0
;
#ifdef FIO_DEBUG_TIME
#ifdef FIO_DEBUG_TIME
@@
-100,36
+100,30
@@
static void fio_init gtod_init(void)
#endif /* FIO_DEBUG_TIME */
#endif /* FIO_DEBUG_TIME */
+#ifdef FIO_DEBUG_TIME
void fio_gettime(struct timeval *tp, void *caller)
void fio_gettime(struct timeval *tp, void *caller)
+#else
+void fio_gettime(struct timeval *tp, void fio_unused *caller)
+#endif
{
#ifdef FIO_DEBUG_TIME
if (!caller)
caller = __builtin_return_address(0);
gtod_log_caller(caller);
{
#ifdef FIO_DEBUG_TIME
if (!caller)
caller = __builtin_return_address(0);
gtod_log_caller(caller);
-#else
- caller = NULL;
#endif
#endif
-repeat:
- if (!clock_gettime_works)
+ if (!clock_gettime_works) {
+gtod:
gettimeofday(tp, NULL);
gettimeofday(tp, NULL);
- else {
+
}
else {
struct timespec ts;
if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0) {
clock_gettime_works = 0;
struct timespec ts;
if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0) {
clock_gettime_works = 0;
- goto
repeat
;
+ goto
gtod
;
}
tp->tv_sec = ts.tv_sec;
tp->tv_usec = ts.tv_nsec / 1000;
}
}
}
tp->tv_sec = ts.tv_sec;
tp->tv_usec = ts.tv_nsec / 1000;
}
}
-
-static void fio_init check_clock(void)
-{
- struct timespec ts;
-
- if (clock_getres(CLOCK_MONOTONIC, &ts) < 0)
- clock_gettime_works = 0;
-}