From: Otto Date: Wed, 15 Sep 2021 08:20:20 +0000 (+0200) Subject: Move timestamps to a signed type X-Git-Tag: dnsdist-1.7.0-alpha2~9^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7705bec9fc3cce72f9428ef0a999573c10591dc8;p=thirdparty%2Fpdns.git Move timestamps to a signed type --- diff --git a/pdns/dnsmessage.proto b/pdns/dnsmessage.proto index 5a80267383..a9fd1f0730 100644 --- a/pdns/dnsmessage.proto +++ b/pdns/dnsmessage.proto @@ -145,7 +145,7 @@ message PBDNSMessage { } message Event { - required uint64 ts = 1; // Timestamp in ns relative to time of creation of event trace data structure + required int64 ts = 1; // Timestamp in ns relative to time of creation of event trace data structure required EventType event = 2; // Type of event required bool start = 3; // true for "start" events, false for "completed" events optional bool boolVal = 4; // Below are optional values associated with events diff --git a/pdns/recursordist/rec-eventtrace.hh b/pdns/recursordist/rec-eventtrace.hh index 55bf79eec3..fed756dc66 100644 --- a/pdns/recursordist/rec-eventtrace.hh +++ b/pdns/recursordist/rec-eventtrace.hh @@ -116,12 +116,12 @@ public: struct Entry { - Entry(Value_t& v, EventType e, bool start, uint64_t ts) : + Entry(Value_t& v, EventType e, bool start, int64_t ts) : d_value(v), d_ts(ts), d_event(e), d_start(start) { } Value_t d_value; - uint64_t d_ts; + int64_t d_ts; EventType d_event; bool d_start; @@ -154,7 +154,7 @@ public: } struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); - uint64_t stamp = ts.tv_nsec + ts.tv_sec * 1000000000; + int64_t stamp = ts.tv_nsec + ts.tv_sec * 1000000000; stamp -= d_base; d_events.emplace_back(v, e, start, stamp); } @@ -222,7 +222,7 @@ public: private: std::vector d_events; - uint64_t d_base; + int64_t d_base; enum Status { Disabled,