]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/common/LogEntry.cc
update sources to v12.1.0
[ceph.git] / ceph / src / common / LogEntry.cc
index bc887e1b3ad4df1a999ef7dcdd009b9549d9fa5f..40bdbea2b3ac72e929d6515ecabb684d0bf66b86 100644 (file)
@@ -1,11 +1,8 @@
-
 #include <syslog.h>
-
 #include <boost/algorithm/string/predicate.hpp>
 
 #include "LogEntry.h"
 #include "Formatter.h"
-
 #include "include/stringify.h"
 
 // ----
@@ -23,6 +20,7 @@ void LogEntryKey::decode(bufferlist::iterator& bl)
   ::decode(who, bl);
   ::decode(stamp, bl);
   ::decode(seq, bl);
+  _calc_hash();
 }
 
 void LogEntryKey::dump(Formatter *f) const
@@ -184,7 +182,7 @@ void LogEntry::log_to_syslog(string level, string facility)
 
 void LogEntry::encode(bufferlist& bl, uint64_t features) const
 {
-  ENCODE_START(3, 2, bl);
+  ENCODE_START(4, 2, bl);
   __u16 t = prio;
   ::encode(who, bl, features);
   ::encode(stamp, bl);
@@ -192,12 +190,13 @@ void LogEntry::encode(bufferlist& bl, uint64_t features) const
   ::encode(t, bl);
   ::encode(msg, bl);
   ::encode(channel, bl);
+  ::encode(name, bl);
   ENCODE_FINISH(bl);
 }
 
 void LogEntry::decode(bufferlist::iterator& bl)
 {
-  DECODE_START_LEGACY_COMPAT_LEN(3, 2, 2, bl);
+  DECODE_START_LEGACY_COMPAT_LEN(4, 2, 2, bl);
   __u16 t;
   ::decode(who, bl);
   ::decode(stamp, bl);
@@ -213,12 +212,16 @@ void LogEntry::decode(bufferlist::iterator& bl)
     // clue of what a 'channel' is.
     channel = CLOG_CHANNEL_CLUSTER;
   }
+  if (struct_v >= 4) {
+    ::decode(name, bl);
+  }
   DECODE_FINISH(bl);
 }
 
 void LogEntry::dump(Formatter *f) const
 {
   f->dump_stream("who") << who;
+  f->dump_stream("name") << name;
   f->dump_stream("stamp") << stamp;
   f->dump_unsigned("seq", seq);
   f->dump_string("channel", channel);
@@ -248,6 +251,10 @@ void LogSummary::decode(bufferlist::iterator& bl)
   ::decode(version, bl);
   ::decode(tail, bl);
   DECODE_FINISH(bl);
+  keys.clear();
+  for (auto& p : tail) {
+    keys.insert(p.key());
+  }
 }
 
 void LogSummary::dump(Formatter *f) const