]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: print the flags as hex looks more friendly
authorYan Jun <yan.jun8@zte.com.cn>
Fri, 8 Jul 2016 08:58:15 +0000 (16:58 +0800)
committerYan Jun <yan.jun8@zte.com.cn>
Mon, 11 Jul 2016 10:52:43 +0000 (18:52 +0800)
Signed-off-by: Yan Jun <yan.jun8@zte.com.cn>
src/rgw/rgw_cache.cc

index cdd470c3b76fa91e735294a586664299215502be..3083cf08155eebda75e70a7e15c87fb320e1831c 100644 (file)
@@ -27,7 +27,8 @@ int ObjectCache::get(string& name, ObjectCacheInfo& info, uint32_t mask, rgw_cac
   ObjectCacheEntry *entry = &iter->second;
 
   if (lru_counter - entry->lru_promotion_ts > lru_window) {
-    ldout(cct, 20) << "cache get: touching lru, lru_counter=" << lru_counter << " promotion_ts=" << entry->lru_promotion_ts << dendl;
+    ldout(cct, 20) << "cache get: touching lru, lru_counter=" << lru_counter
+                   << " promotion_ts=" << entry->lru_promotion_ts << dendl;
     lock.unlock();
     lock.get_write(); /* promote lock to writer */
 
@@ -48,11 +49,15 @@ int ObjectCache::get(string& name, ObjectCacheInfo& info, uint32_t mask, rgw_cac
 
   ObjectCacheInfo& src = iter->second.info;
   if ((src.flags & mask) != mask) {
-    ldout(cct, 10) << "cache get: name=" << name << " : type miss (requested=" << mask << ", cached=" << src.flags << ")" << dendl;
+    ldout(cct, 10) << "cache get: name=" << name << " : type miss (requested=0x"
+                   << std::hex << mask << ", cached=0x" << src.flags
+                   << std::dec << ")" << dendl;
     if(perfcounter) perfcounter->inc(l_rgw_cache_miss);
     return -ENOENT;
   }
-  ldout(cct, 10) << "cache get: name=" << name << " : hit (requested=" << mask << ", cached=" << src.flags << ")" << dendl;
+  ldout(cct, 10) << "cache get: name=" << name << " : hit (requested=0x"
+                 << std::hex << mask << ", cached=0x" << src.flags
+                 << std::dec << ")" << dendl;
 
   info = src;
   if (cache_info) {
@@ -119,7 +124,8 @@ void ObjectCache::put(string& name, ObjectCacheInfo& info, rgw_cache_entry_info
     return;
   }
 
-  ldout(cct, 10) << "cache put: name=" << name << " info.flags=" << info.flags << dendl;
+  ldout(cct, 10) << "cache put: name=" << name << " info.flags=0x"
+                 << std::hex << info.flags << std::dec << dendl;
   map<string, ObjectCacheEntry>::iterator iter = cache_map.find(name);
   if (iter == cache_map.end()) {
     ObjectCacheEntry entry;