]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore/BlueFS: use hex
authorSage Weil <sage@redhat.com>
Fri, 12 Aug 2016 20:05:12 +0000 (16:05 -0400)
committerSage Weil <sage@redhat.com>
Sat, 13 Aug 2016 15:49:20 +0000 (11:49 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueFS.cc
src/os/bluestore/bluefs_types.cc

index 835b76063fd7f122ed638df5410f261adf2e5135..5fab4550efe2338515f58bb5e7c9a0b9927a5372 100644 (file)
@@ -979,8 +979,8 @@ bool BlueFS::_should_compact_log()
   uint64_t current = log_writer->file->fnode.size;
   uint64_t expected = _estimate_log_size();
   float ratio = (float)current / (float)expected;
-  dout(10) << __func__ << " current " << current
-          << " expected " << expected
+  dout(10) << __func__ << " current 0x" << std::hex << current
+          << " expected " << expected << std::dec
           << " ratio " << ratio << dendl;
   if (current < g_conf->bluefs_log_compact_min_size ||
       ratio < g_conf->bluefs_log_compact_min_ratio)
@@ -1082,8 +1082,8 @@ void BlueFS::_pad_bl(bufferlist& bl)
 {
   uint64_t partial = bl.length() % super.block_size;
   if (partial) {
-    dout(10) << __func__ << " padding with " << super.block_size - partial
-            << " zeros" << dendl;
+    dout(10) << __func__ << " padding with 0x" << std::hex
+            << super.block_size - partial << " zeros" << std::dec << dendl;
     bl.append_zero(super.block_size - partial);
   }
 }
@@ -1116,8 +1116,8 @@ int BlueFS::_flush_and_sync_log(std::unique_lock<std::mutex>& l,
   // allocate some more space (before we run out)?
   uint64_t runway = log_writer->file->fnode.get_allocated() - log_writer->pos;
   if (runway < g_conf->bluefs_min_log_runway) {
-    dout(10) << __func__ << " allocating more log runway ("
-            << runway << " remaining" << dendl;
+    dout(10) << __func__ << " allocating more log runway (0x"
+            << std::hex << runway << std::dec  << " remaining)" << dendl;
     int r = _allocate(log_writer->file->fnode.prefer_bdev,
                      g_conf->bluefs_max_log_runway,
                      &log_writer->file->fnode.extents);
@@ -1432,7 +1432,7 @@ void BlueFS::flush_bdev()
 int BlueFS::_allocate(uint8_t id, uint64_t len, vector<bluefs_extent_t> *ev)
 {
   dout(10) << __func__ << " len 0x" << std::hex << len << std::dec
-           << " from " << id << dendl;
+           << " from " << (int)id << dendl;
   assert(id < alloc.size());
   uint64_t min_alloc_size = g_conf->bluefs_alloc_size;
 
@@ -1444,17 +1444,20 @@ int BlueFS::_allocate(uint8_t id, uint64_t len, vector<bluefs_extent_t> *ev)
   if (r < 0) {
     if (id != BDEV_SLOW) {
       if (bdev[id])
-       derr << __func__ << " failed to allocate " << left << " on bdev " << id
-            << ", free " << alloc[id]->get_free()
-            << "; fallback to bdev " << id + 1 << dendl;
+       derr << __func__ << " failed to allocate 0x" << std::hex << left
+            << " on bdev " << (int)id
+            << ", free 0x" << alloc[id]->get_free()
+            << "; fallback to bdev " << (int)id + 1
+            << std::dec << dendl;
       return _allocate(id + 1, len, ev);
     }
     if (bdev[id])
-      derr << __func__ << " failed to allocate " << left << " on bdev " << id
-          << ", free " << alloc[id]->get_free() << dendl;
+      derr << __func__ << " failed to allocate 0x" << std::hex << left
+          << " on bdev " << (int)id
+          << ", free 0x" << alloc[id]->get_free() << std::dec << dendl;
     else
-      derr << __func__ << " failed to allocate " << left << " on bdev " << id
-          << ", dne" << dendl;
+      derr << __func__ << " failed to allocate 0x" << std::hex << left
+          << " on bdev " << (int)id << ", dne" << std::dec << dendl;
     return r;
   }
 
index 5540a79ed5166c0cbc9369f630e2b2804420fb28..bba6506ce95ea318116a24903bb0f86240cd30ff 100644 (file)
@@ -45,7 +45,8 @@ void bluefs_extent_t::generate_test_instances(list<bluefs_extent_t*>& ls)
 
 ostream& operator<<(ostream& out, bluefs_extent_t e)
 {
-  return out << (int)e.bdev << ":" << e.offset << "+" << e.length;
+  return out << (int)e.bdev << ":0x" << std::hex << e.offset << "+" << e.length
+            << std::dec;
 }
 
 // bluefs_super_t
@@ -94,9 +95,9 @@ ostream& operator<<(ostream& out, const bluefs_super_t& s)
   return out << "super(uuid " << s.uuid
             << " osd " << s.osd_uuid
             << " v " << s.version
-            << " block_size " << s.block_size
-            << " log_fnode " << s.log_fnode
-            << ")";
+            << " block_size 0x" << std::hex << s.block_size
+            << " log_fnode 0x" << s.log_fnode
+            << std::dec << ")";
 }
 
 // bluefs_fnode_t
@@ -165,7 +166,7 @@ void bluefs_fnode_t::generate_test_instances(list<bluefs_fnode_t*>& ls)
 ostream& operator<<(ostream& out, const bluefs_fnode_t& file)
 {
   return out << "file(ino " << file.ino
-            << " size " << file.size
+            << " size 0x" << std::hex << file.size << std::dec
             << " mtime " << file.mtime
             << " bdev " << (int)file.prefer_bdev
             << " extents " << file.extents
@@ -231,7 +232,7 @@ void bluefs_transaction_t::generate_test_instance(
 ostream& operator<<(ostream& out, const bluefs_transaction_t& t)
 {
   return out << "txn(seq " << t.seq
-            << " len " << t.op_bl.length()
-            << " crc " << t.op_bl.crc32c(-1)
-            << ")";
+            << " len 0x" << std::hex << t.op_bl.length()
+            << " crc 0x" << t.op_bl.crc32c(-1)
+            << std::dec << ")";
 }