{
uint64_t diff, latency_avg_prev;
- diff = now(CLOCK_THREAD_CPUTIME_ID) - prev;
+ diff = now(CLOCK_REALTIME) - prev;
stats.count++;
stats.latency_acc += diff;
int ret;
if (use_memfd) {
- uint64_t now_ns = now(CLOCK_THREAD_CPUTIME_ID);
+ uint64_t now_ns = now(CLOCK_REALTIME);
struct kdbus_item *item = memfd_item_offset + kdbus_msg;
memfd = sys_memfd_create("memfd-name", 0);
ASSERT_RETURN_VAL(memfd,>=,0, memfd);
fds[0].fd = conn_a->fd;
fds[1].fd = conn_b->fd;
- start = now(CLOCK_THREAD_CPUTIME_ID);
+ start = now(CLOCK_REALTIME);
reset_stats();
- send_ns = now(CLOCK_THREAD_CPUTIME_ID);
+ send_ns = now(CLOCK_REALTIME);
ASSERT_ZERO(send_echo_request(conn_b, kdbus_msg, memfd_cached_offset));
while (1) {
if (fds[0].revents & POLLIN) {
ASSERT_ZERO(handle_echo_reply(conn_a, send_ns));
- send_ns = now(CLOCK_THREAD_CPUTIME_ID);
+ send_ns = now(CLOCK_REALTIME);
ASSERT_ZERO(send_echo_request(conn_b, kdbus_msg, memfd_cached_offset));
}
- now_ns = now(CLOCK_THREAD_CPUTIME_ID);
+ now_ns = now(CLOCK_REALTIME);
diff = now_ns - start;
if (diff > 1000000000ULL) {
start = now_ns;
/* cancel any pending message */
UNUSED(read(uds[1], buf, sizeof(buf)));
- start = now(CLOCK_THREAD_CPUTIME_ID);
+ start = now(CLOCK_REALTIME);
reset_stats();
- send_ns = now(CLOCK_THREAD_CPUTIME_ID);
+ send_ns = now(CLOCK_REALTIME);
ASSERT_RETURN((typeof(write(uds[0], stress_payload, sizeof(stress_payload))))sizeof(stress_payload),==,write(uds[0], stress_payload, sizeof(stress_payload)));
while (1) {
add_stats(send_ns);
- send_ns = now(CLOCK_THREAD_CPUTIME_ID);
+ send_ns = now(CLOCK_REALTIME);
ASSERT_RETURN((typeof(write(uds[0], buf, sizeof(buf))))sizeof(buf),==,write(uds[0], buf, sizeof(buf)));
}
- now_ns = now(CLOCK_THREAD_CPUTIME_ID);
+ now_ns = now(CLOCK_REALTIME);
diff = now_ns - start;
if (diff > 1000000000ULL) {
start = now_ns;