#include <haproxy/api.h>
extern struct timeval start_date; /* the process's start date in wall-clock time */
+extern struct timeval start_time; /* the process's start date in internal monotonic time */
extern volatile ullong global_now; /* common monotonic date between all threads (32:32) */
extern THREAD_LOCAL struct timeval now; /* internal monotonic date derived from real clock */
} while (0)
/* retrieve uptime */
- tv_remain(&start_date, &now, &up);
+ tv_remain(&start_time, &now, &up);
chunk_appendf(&trash, "thread_id: %u (%u..%u)\n", tid + 1, 1, global.nbthread);
chunk_appendf(&trash, "date_now: %lu.%06lu\n", (ulong)now.tv_sec, (ulong)now.tv_usec);
#include <haproxy/tools.h>
struct timeval start_date; /* the process's start date in wall-clock time */
+struct timeval start_time; /* the process's start date in internal monotonic time */
volatile ullong global_now; /* common monotonic date between all threads (32:32) */
volatile uint global_now_ms; /* common monotonic date in milliseconds (may wrap) */
/* initialize date, time, and pid */
tzset();
clock_init_process_date();
- start_date = now;
+ start_date = date;
+ start_time = now;
pid = getpid();
/* Set local host name and adjust some environment variables.
}
glob_out_b32 *= 32; // values are 32-byte units
- tv_remain(&start_date, &now, &up);
+ tv_remain(&start_time, &now, &up);
if (len < INF_TOTAL_FIELDS)
return 0;
chunk_appendf(out, "%ud %uh%02um%02us", (uint)up.tv_sec / 86400, ((uint)up.tv_sec % 86400) / 3600, ((uint)up.tv_sec % 3600) / 60, ((uint)up.tv_sec % 60));
info[INF_UPTIME_SEC] = (flags & STAT_USE_FLOAT) ? mkf_flt(FN_DURATION, up.tv_sec + up.tv_usec / 1000000.0) : mkf_u32(FN_DURATION, up.tv_sec);
- info[INF_START_TIME_SEC] = (flags & STAT_USE_FLOAT) ? mkf_flt(FN_DURATION, start_date.tv_sec + start_date.tv_usec / 1000000.0) : mkf_u32(FN_DURATION, start_date.tv_sec);
+ info[INF_START_TIME_SEC] = (flags & STAT_USE_FLOAT) ? mkf_flt(FN_DURATION, start_time.tv_sec + start_time.tv_usec / 1000000.0) : mkf_u32(FN_DURATION, start_time.tv_sec);
info[INF_MEMMAX_MB] = mkf_u32(FO_CONFIG|FN_LIMIT, global.rlimit_memmax);
info[INF_MEMMAX_BYTES] = mkf_u32(FO_CONFIG|FN_LIMIT, global.rlimit_memmax * 1048576L);
info[INF_POOL_ALLOC_MB] = mkf_u32(0, (unsigned)(pool_total_allocated() / 1048576L));