From: Alan T. DeKok Date: Fri, 11 Nov 2016 00:19:19 +0000 (-0500) Subject: move time things around X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a07e5cfb991d2ec9e5735f7b1bb846571d5f5282;p=thirdparty%2Ffreeradius-server.git move time things around --- diff --git a/src/util/message.h b/src/util/message.h index 5e59c9eb24a..240cd1c180c 100644 --- a/src/util/message.h +++ b/src/util/message.h @@ -26,6 +26,7 @@ */ RCSIDH(message_h, "$Id$") +#include #include #ifdef __cplusplus @@ -44,6 +45,7 @@ typedef enum fr_message_status_t { typedef struct fr_message_t { fr_message_status_t status; //!< free, used, done, etc. + fr_time_t when; //!< when this message was sent fr_ring_buffer_t *rb; //!< pointer to the ring buffer uint8_t *data; //!< pointer to the data in the ring buffer size_t data_size; //!< size of the data in the ring buffer diff --git a/src/util/time.c b/src/util/time.c index 2ec9ad80b23..fe75756dae9 100644 --- a/src/util/time.c +++ b/src/util/time.c @@ -44,10 +44,6 @@ USES_APPLE_DEPRECATED_API # include #endif -#define NANOSEC (1000000000) -#define USEC (1000000) - - static struct timeval tm_started = { 0, 0}; #ifdef HAVE_CLOCK_GETTIME diff --git a/src/util/time.h b/src/util/time.h index 0d496d89362..a9576f221af 100644 --- a/src/util/time.h +++ b/src/util/time.h @@ -57,12 +57,16 @@ typedef struct fr_time_tracking_t { fr_time_t when; //!< last time we changed a field fr_time_t start; //!< time this request started being processed fr_time_t end; //!< when we stopped processing this request + fr_time_t predicted; //!< predicted processing time for this request fr_time_t yielded; //!< time this request yielded fr_time_t resumed; //!< time this request last resumed; fr_time_t running; //!< total time spent running fr_time_t waiting; //!< total time spent waiting } fr_time_tracking_t; +#define NANOSEC (1000000000) +#define USEC (1000000) + int fr_time_start(void); fr_time_t fr_time(void); void fr_time_to_timeval(struct timeval *tv, fr_time_t when) CC_HINT(nonnull);