]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "core: hint the dout()'s message crafting as a cold code." 20636/head
authorKefu Chai <kchai@redhat.com>
Wed, 28 Feb 2018 08:24:16 +0000 (16:24 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 28 Feb 2018 08:29:34 +0000 (16:29 +0800)
This reverts commit b265ed2955570c17b954270e6a1449637790e9b8.

with b265ed29, we cannot use `dout(10) << __func__ << ...` anymore for
logging the name of the inner most function. what we will have is
always `operator()`, because the lambda closure will be the inner most
function with the the hinting change.

Fixes: http://tracker.ceph.com/issues/23169
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/common/compiler_extensions.h
src/common/dout.h
src/common/likely.h

index 64bad194038d7ee3cd20874ca499aa413bc0a538..2fd8f5c2d1367ed343e529c578cbe738ad4721cb 100644 (file)
 #ifdef __GNUC__
 // GCC
 #define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
-
-#define HINT_COLD_CODE __attribute__((cold))
-#define HINT_NO_INLINE __attribute__((noinline))
 #else
 // some other compiler - just make it a no-op
 #define WARN_UNUSED_RESULT
-
-#define HINT_COLD_CODE
-#define HINT_NO_INLINE
 #endif
 
 #endif
index 5651f37797b04b5b0d9e60e5847952cb094ed0f5..69b85c94788355a3792bc4ee744d91413545d7c7 100644 (file)
@@ -20,7 +20,6 @@
 
 #include "global/global_context.h"
 #include "common/config.h"
-#include "common/compiler_extensions.h"
 #include "common/likely.h"
 #include "common/Clock.h"
 #include "log/Log.h"
@@ -83,8 +82,7 @@ struct is_dynamic<dynamic_marker_t<T>> : public std::true_type {};
     }                                                                  \
   }(cct);                                                              \
                                                                        \
-  if (unlikely(should_gather)) {                                       \
-    [&]() HINT_NO_INLINE HINT_COLD_CODE {                              \
+  if (should_gather) {                                                 \
     static size_t _log_exp_length = 80;                                \
     ceph::logging::Entry *_dout_e =                                    \
       cct->_log->create_entry(v, sub, &_log_exp_length);               \
@@ -114,8 +112,7 @@ struct is_dynamic<dynamic_marker_t<T>> : public std::true_type {};
 // /usr/include/assert.h clobbers our fancier version.
 #define dendl_impl std::flush;                         \
   _ASSERT_H->_log->submit_entry(_dout_e);              \
-    }();                                               \
-    }                                                  \
+    }                                          \
   } while (0)
 
 #define dendl dendl_impl
index f3696bfb026fd9376079cdecd1cc6c9008730bba..e8146a3f69eb0884388e4e857a847276c3dd7fa5 100644 (file)
@@ -18,7 +18,7 @@
 /*
  * Likely / Unlikely macros
  */
-#define likely(x)       __builtin_expect((const bool)(x),1)
-#define unlikely(x)     __builtin_expect((const bool)(x),0)
+#define likely(x)       __builtin_expect((x),1)
+#define unlikely(x)     __builtin_expect((x),0)
 
 #endif