X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=libcfs%2Finclude%2Flibcfs%2Flibcfs_debug.h;h=662d2908a2855a361b99862385972c5787b05585;hp=19466e9e18d2203d0617bf11fe9a3a549dcda29f;hb=3769245cad0775816b653253e497e57b7500033c;hpb=0f5d3c4b954da2f6b880da243dacec52cb4011a6 diff --git a/libcfs/include/libcfs/libcfs_debug.h b/libcfs/include/libcfs/libcfs_debug.h index 19466e9..662d290 100644 --- a/libcfs/include/libcfs/libcfs_debug.h +++ b/libcfs/include/libcfs/libcfs_debug.h @@ -212,10 +212,32 @@ static inline int cfs_cdebug_show(unsigned int mask, unsigned int subsystem) #define LCONSOLE_EMERG(format, ...) \ CDEBUG(D_CONSOLE | D_EMERG, format, ## __VA_ARGS__) +int libcfs_debug_msg(struct libcfs_debug_msg_data *msgdata, + const char *format1, ...) + __printf(2, 3); + +/* other external symbols that tracefile provides: */ +int cfs_trace_copyout_string(char __user *usr_buffer, int usr_buffer_nob, + const char *knl_buffer, char *append); + +#define LIBCFS_DEBUG_FILE_PATH_DEFAULT "/tmp/lustre-log" + #if defined(CDEBUG_ENTRY_EXIT) -void libcfs_log_goto(struct libcfs_debug_msg_data *goto_data, - const char *label, long rc); +static inline long libcfs_log_return(struct libcfs_debug_msg_data *msgdata, long rc) +{ + libcfs_debug_msg(msgdata, "Process leaving (rc=%lu : %ld : %lx)\n", + rc, rc, rc); + return rc; +} + +static inline void libcfs_log_goto(struct libcfs_debug_msg_data *msgdata, + const char *label, long rc) +{ + libcfs_debug_msg(msgdata, + "Process leaving via %s (rc=%lu : %ld : %#lx)\n", + label, rc, rc, rc); +} # define GOTO(label, rc) \ do { \ @@ -229,8 +251,6 @@ do { \ goto label; \ } while (0) - -long libcfs_log_return(struct libcfs_debug_msg_data *, long rc); # if BITS_PER_LONG > 32 # define RETURN(rc) \ do { \ @@ -285,16 +305,6 @@ do { \ return; \ } while (0) -int libcfs_debug_msg(struct libcfs_debug_msg_data *msgdata, - const char *format1, ...) - __printf(2, 3); - -/* other external symbols that tracefile provides: */ -int cfs_trace_copyout_string(char __user *usr_buffer, int usr_buffer_nob, - const char *knl_buffer, char *append); - -#define LIBCFS_DEBUG_FILE_PATH_DEFAULT "/tmp/lustre-log" - void cfs_debug_init(void); #endif /* __LIBCFS_DEBUG_H__ */