Whamcloud - gitweb
LU-2675 libcfs: remove {ENTRY,EXIT}_NESTING macros 84/11984/5
authorJohn L. Hammond <john.hammond@intel.com>
Wed, 17 Sep 2014 12:42:23 +0000 (07:42 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 15 Oct 2014 13:32:07 +0000 (13:32 +0000)
Remove the unnecessary macros ENTRY_NESTING_SUPPORT, ENTRY_NESTING,
EXIT_NESTING, and __current_nesting_level().

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I12c3c9a253b1dc0929a78c2f807b2a94434d3496
Reviewed-on: http://review.whamcloud.com/11984
Tested-by: Jenkins
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Tested-by: Oleg Drokin <oleg.drokin@intel.com>
libcfs/include/libcfs/libcfs_debug.h
libcfs/include/libcfs/linux/libcfs.h
libcfs/include/libcfs/posix/libcfs.h
libcfs/libcfs/tracefile.c

index bf83c89..0042f92 100644 (file)
@@ -304,7 +304,6 @@ long libcfs_log_return(struct libcfs_debug_msg_data *, long rc);
 #if BITS_PER_LONG > 32
 #define RETURN(rc)                                                     \
 do {                                                                   \
 #if BITS_PER_LONG > 32
 #define RETURN(rc)                                                     \
 do {                                                                   \
-       EXIT_NESTING;                                                   \
        if (cfs_cdebug_show(D_TRACE, DEBUG_SUBSYSTEM)) {                \
                 LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_TRACE, NULL);    \
                 return (typeof(rc))libcfs_log_return(&msgdata,         \
        if (cfs_cdebug_show(D_TRACE, DEBUG_SUBSYSTEM)) {                \
                 LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_TRACE, NULL);    \
                 return (typeof(rc))libcfs_log_return(&msgdata,         \
@@ -321,7 +320,6 @@ do {                                                                        \
  */
 #define RETURN(rc)                                                     \
 do {                                                                   \
  */
 #define RETURN(rc)                                                     \
 do {                                                                   \
-       EXIT_NESTING;                                                   \
        if (cfs_cdebug_show(D_TRACE, DEBUG_SUBSYSTEM)) {                \
                typeof(rc) __rc = (rc);                                 \
                LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_TRACE, NULL);     \
        if (cfs_cdebug_show(D_TRACE, DEBUG_SUBSYSTEM)) {                \
                typeof(rc) __rc = (rc);                                 \
                LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_TRACE, NULL);     \
@@ -333,18 +331,9 @@ do {                                                                       \
 } while (0)
 #endif /* BITS_PER_LONG > 32 */
 
 } while (0)
 #endif /* BITS_PER_LONG > 32 */
 
+#define ENTRY  CDEBUG(D_TRACE, "Process entered\n")
+#define EXIT   CDEBUG(D_TRACE, "Process leaving\n")
 
 
-#define ENTRY                                                           \
-ENTRY_NESTING;                                                          \
-do {                                                                    \
-        CDEBUG(D_TRACE, "Process entered\n");                           \
-} while (0)
-
-#define EXIT                                                            \
-do {                                                                    \
-        CDEBUG(D_TRACE, "Process leaving\n");                           \
-        EXIT_NESTING;                                                   \
-} while(0)
 #else /* !CDEBUG_ENTRY_EXIT */
 
 # define GOTO(label, rc)                                               \
 #else /* !CDEBUG_ENTRY_EXIT */
 
 # define GOTO(label, rc)                                               \
index b5ce289..cda2b1f 100644 (file)
@@ -99,11 +99,6 @@ do {                                                                    \
 /* initial pid  */
 #define LUSTRE_LNET_PID          12345
 
 /* initial pid  */
 #define LUSTRE_LNET_PID          12345
 
-#define ENTRY_NESTING_SUPPORT (1)
-#define ENTRY_NESTING   do {;} while (0)
-#define EXIT_NESTING   do {;} while (0)
-#define __current_nesting_level() (0)
-
 /**
  * Platform specific declarations for cfs_curproc API (libcfs/curproc.h)
  *
 /**
  * Platform specific declarations for cfs_curproc API (libcfs/curproc.h)
  *
index 6dec16b..6a2d831 100644 (file)
@@ -167,11 +167,6 @@ typedef unsigned long long cfs_cycles_t;
 /* initial pid  */
 #define LUSTRE_LNET_PID          12345
 
 /* initial pid  */
 #define LUSTRE_LNET_PID          12345
 
-#define ENTRY_NESTING_SUPPORT (1)
-#define ENTRY_NESTING   do {;} while (0)
-#define EXIT_NESTING   do {;} while (0)
-#define __current_nesting_level() (0)
-
 /**
  * Platform specific declarations for cfs_curproc API (libcfs/curproc.h)
  *
 /**
  * Platform specific declarations for cfs_curproc API (libcfs/curproc.h)
  *
index d0b031e..6090fdf 100644 (file)
@@ -270,7 +270,6 @@ int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata,
         int                        needed = 85; /* average message length */
         int                        max_nob;
         va_list                    ap;
         int                        needed = 85; /* average message length */
         int                        max_nob;
         va_list                    ap;
-        int                        depth;
         int                        i;
         int                        remain;
         int                        mask = msgdata->msg_mask;
         int                        i;
         int                        remain;
         int                        mask = msgdata->msg_mask;
@@ -299,8 +298,7 @@ int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata,
                 goto console;
         }
 
                 goto console;
         }
 
-        depth = __current_nesting_level();
-        known_size = strlen(file) + 1 + depth;
+       known_size = strlen(file) + 1;
         if (msgdata->msg_fn)
                 known_size += strlen(msgdata->msg_fn) + 1;
 
         if (msgdata->msg_fn)
                 known_size += strlen(msgdata->msg_fn) + 1;
 
@@ -371,12 +369,6 @@ int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata,
                 debug_buf += sizeof(header);
         }
 
                 debug_buf += sizeof(header);
         }
 
-        /* indent message according to the nesting level */
-        while (depth-- > 0) {
-                *(debug_buf++) = '.';
-                ++ tage->used;
-        }
-
         strcpy(debug_buf, file);
         tage->used += strlen(file) + 1;
         debug_buf += strlen(file) + 1;
         strcpy(debug_buf, file);
         tage->used += strlen(file) + 1;
         debug_buf += strlen(file) + 1;