libgfs2: Use __FUNCTION__ rather than __FILE__ for debug messages
PATCH 16/44 libgfs2: Use __FUNCTION__ rather than __FILE__ for debug messages
From 97b0253e2347b87f29ecf5d5fefbb08655358bb2 Mon Sep 17 00:00:00 2001
From: Bob Peterson <[email protected]>
Date: Mon, 8 Aug 2011 16:11:48 -0500
Subject: [PATCH 16/44] libgfs2: Use __FUNCTION__ rather than __FILE__ for
debug messages
This patch changes the debug output of gfs2-utils to use __FUNCTION__ rather than __FILE__. The output file is much smaller. Digging through a 6.5GB output is better and faster than a 9GB output file.
rhbz#675723
--- gfs2/fsck/metawalk.c | 13 +++---------- gfs2/fsck/metawalk.h | 2 +- gfs2/libgfs2/libgfs2.h | 2 +- 3 files changed, 5 insertions(+), 12 deletions(-)
gfs2/fsck/metawalk.c +3 -10
@@ -100,17 +100,10 @@ int _fsck_blockmap_set(struct gfs2_inode *ip, uint64_t bblock,int error;if (print_level >=MSG_DEBUG ) { -const char *p; - - p =strrchr (caller,'/' ); -if (p) - p++; -else - p = caller;/* I'm circumventing the log levels here on purpose to make the output easier to debug. */ if (ip->i_di.di_num.no_addr == bblock) { - print_fsck_log(MSG_DEBUG, p, fline, + print_fsck_log(MSG_DEBUG, caller, fline, _("%s inode found at block %lld " "(0x%llx): marking as '%s'\n"), btype, (unsigned long long)
@@ -119,7 +112,7 @@ int _fsck_blockmap_set(struct gfs2_inode *ip, uint64_t bblock, ip->i_di.di_num.no_addr, block_type_string(mark)); }else if (mark == gfs2_bad_block || mark == gfs2_meta_inval) { - print_fsck_log(MSG_DEBUG, p, fline, + print_fsck_log(MSG_DEBUG, caller, fline, _("inode %lld (0x%llx) references " "%s block %lld (0x%llx): " "marking as '%s'\n"),
@@ -131,7 +124,7 @@ int _fsck_blockmap_set(struct gfs2_inode *ip, uint64_t bblock, (unsigned long long )bblock, block_type_string(mark)); }else { - print_fsck_log(MSG_DEBUG, p, fline, + print_fsck_log(MSG_DEBUG, caller, fline, _("inode %lld (0x%llx) references " "%s block %lld (0x%llx): " "marking as '%s'\n"),
gfs2/fsck/metawalk.h +1 -1
@@ -39,7 +39,7 @@ extern struct gfs2_inode *fsck_system_inode(struct gfs2_sbd *sdp,#define is_duplicate (dblock) ((dupfind(dblock)) ? 1 : 0)#define fsck_blockmap_set (ip, b, bt, m) _fsck_blockmap_set(ip, b, bt, m, \ - __FILE__, __LINE__) + __FUNCTION__, __LINE__)/* metawalk_fxns: function pointers to check various parts of the fs *
gfs2/libgfs2/libgfs2.h +1 -1
@@ -697,7 +697,7 @@ extern int print_level;#define MSG_NULL 1 #define print_log(priority, format...) \ - do { print_fsck_log(priority, __FILE__, __LINE__, ## format); } while(0) + do { print_fsck_log(priority, __FUNCTION__, __LINE__, ## format); } while(0) #define log_debug(format...) \ do { if(print_level >= MSG_DEBUG) print_log(MSG_DEBUG, format); } while(0)
Signature · 1 line
1.7.4.4
PATCH 16/44 libgfs2: Use __FUNCTION__ rather than __FILE__ for debug messages
ACK. Looks good,
Steve.
Quoted 84 lines · Bob Peterson
Quoted 1 line
From
97b0253e2347b87f29ecf5d5fefbb08655358bb2Mon Sep 17 00:00:00 2001From: Bob Peterson <[email protected]>
Date: Mon, 8 Aug 2011 16:11:48 -0500
Subject: [PATCH 16/44] libgfs2: Use__FUNCTION__rather than__FILE__for
debug messagesThis patch changes the debug output of gfs2-utils to use
__FUNCTION__rather than__FILE__. The output file is much smaller. Digging through a 6.5GB output is better and faster than a 9GB output file.rhbz#675723
--- gfs2/fsck/metawalk.c | 13 +++---------- gfs2/fsck/metawalk.h | 2 +- gfs2/libgfs2/libgfs2.h | 2 +- 3 files changed, 5 insertions(+), 12 deletions(-)gfs2/fsck/metawalk.c +3
-10@@ -100,17 +100,10 @@ int _fsck_blockmap_set(struct gfs2_inode *ip, uint64_t bblock,int error;if (print_level >=MSG_DEBUG ) { -const char *p; - - p =strrchr (caller,'/' ); -if (p) - p++; -else - p = caller;/* I'm circumventing the log levels here on purpose to make the output easier to debug. */ if (ip->i_di.di_num.no_addr == bblock) { - print_fsck_log(MSG_DEBUG, p, fline, + print_fsck_log(MSG_DEBUG, caller, fline, _("%s inode found at block %lld " "(0x%llx): marking as '%s'\n"), btype, (unsigned long long)@@ -119,7 +112,7 @@ int _fsck_blockmap_set(struct gfs2_inode *ip, uint64_t bblock, ip->i_di.di_num.no_addr, block_type_string(mark)); }else if (mark == gfs2_bad_block || mark == gfs2_meta_inval) { - print_fsck_log(MSG_DEBUG, p, fline, + print_fsck_log(MSG_DEBUG, caller, fline, _("inode %lld (0x%llx) references " "%s block %lld (0x%llx): " "marking as '%s'\n"),@@ -131,7 +124,7 @@ int _fsck_blockmap_set(struct gfs2_inode *ip, uint64_t bblock, (unsigned long long )bblock, block_type_string(mark)); }else { - print_fsck_log(MSG_DEBUG, p, fline, + print_fsck_log(MSG_DEBUG, caller, fline, _("inode %lld (0x%llx) references " "%s block %lld (0x%llx): " "marking as '%s'\n"),gfs2/fsck/metawalk.h +1
-1@@ -39,7 +39,7 @@ extern struct gfs2_inode *fsck_system_inode(struct gfs2_sbd *sdp,#define is_duplicate (dblock) ((dupfind(dblock)) ? 1 : 0)#define fsck_blockmap_set (ip, b, bt, m) _fsck_blockmap_set(ip, b, bt, m, \ - __FILE__, __LINE__) + __FUNCTION__, __LINE__)/* metawalk_fxns: function pointers to check various parts of the fs * gfs2/libgfs2/libgfs2.h +1
-1@@ -697,7 +697,7 @@ extern int print_level;#define MSG_NULL 1 #define print_log(priority, format...) \ - do { print_fsck_log(priority, __FILE__, __LINE__, ## format); } while(0) + do { print_fsck_log(priority, __FUNCTION__, __LINE__, ## format); } while(0) #define log_debug(format...) \ do { if(print_level >= MSG_DEBUG) print_log(MSG_DEBUG, format); } while(0)