]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Move timestamps to a signed type
authorOtto <otto.moerbeek@open-xchange.com>
Wed, 15 Sep 2021 08:20:20 +0000 (10:20 +0200)
committerOtto <otto.moerbeek@open-xchange.com>
Wed, 13 Oct 2021 12:33:17 +0000 (14:33 +0200)
pdns/dnsmessage.proto
pdns/recursordist/rec-eventtrace.hh

index 5a80267383b599a3d5bb60e5e998c1a99dbf6eec..a9fd1f07309272d04b3161146490b34dc79462f2 100644 (file)
@@ -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
index 55bf79eec334128af4fc727f78a8f5c9ba2cab1c..fed756dc66d6cd1a807625c5bc1b801039c72d2f 100644 (file)
@@ -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<Entry> d_events;
-  uint64_t d_base;
+  int64_t d_base;
   enum Status
   {
     Disabled,