/* If we're a child, this is the first call we did ourselves. */
static struct failtest_call *our_history_start = NULL;
/* For printing runtime with --trace. */
-static struct timespec start;
+static struct timeabs start;
/* Set when failtest_hook returns FAIL_PROBE */
static bool probing = false;
/* Table to track duplicates. */
if (child == 0) {
traceindent++;
if (tracef) {
- struct timespec diff;
+ struct timerel diff;
const char *p;
char *failpath;
struct failtest_call *c;
c = tlist_tail(&history, list);
- diff = time_sub(time_now(), start);
+ diff = time_between(time_now(), start);
failpath = failpath_string();
p = strrchr(c->file, '/');
if (p)
p = c->file;
trace("%u->%u (%u.%02u): %s (%s:%u)\n",
getppid(), getpid(),
- (int)diff.tv_sec, (int)diff.tv_nsec / 10000000,
+ (int)diff.ts.tv_sec, (int)diff.ts.tv_nsec / 10000000,
failpath, p, c->line);
free(failpath);
}
set_cleanup(p, cleanup_read, struct read_call);
}
}
- trace("%sread %s:%u fd %i %zu@%llu -> %i\n",
+ trace("%sread %s:%u fd %i %zu@%llu -> %zi\n",
is_pread ? "p" : "", file, line, fd, count, (long long)off,
p->u.read.ret);
errno = p->error;
else
p->u.write.ret = write(fd, buf, count);
}
- trace("%swrite %s:%i %zu@%llu on fd %i -> %i\n",
+ trace("%swrite %s:%i %zu@%llu on fd %i -> %zi\n",
p->u.write.is_pwrite ? "p" : "",
file, line, count, (long long)off, fd, p->u.write.ret);
errno = p->error;