]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
adjust verbosity, timestamp debug output
authorsageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Mon, 6 Aug 2007 22:21:06 +0000 (22:21 +0000)
committersageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Mon, 6 Aug 2007 22:21:06 +0000 (22:21 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1596 29311d96-e01e-0410-9327-a35deaab8ce9

branches/sage/mds/ebofs/Allocator.cc
branches/sage/mds/ebofs/BlockDevice.cc
branches/sage/mds/ebofs/BufferCache.cc
branches/sage/mds/ebofs/Ebofs.cc
branches/sage/mds/ebofs/FileJournal.cc

index 70b641cfee14f1c0d767d293d430089961a0ad0e..a9c79f01a315a6e26799c93e148d92c1deebe831 100644 (file)
@@ -19,7 +19,7 @@
 
 
 #undef dout
-#define dout(x) if (x <= g_conf.debug_ebofs) cout << "ebofs(" << fs->dev.get_device_name() << ").allocator."
+#define dout(x) if (x <= g_conf.debug_ebofs) cout << g_clock.now() << " ebofs(" << fs->dev.get_device_name() << ").allocator."
 
 
 void Allocator::dump_freelist()
index 8fcb6bf549a8eb77675b06199e20ab88353c35ee..83de7b69efd0e6b8b41b10e6e7494f6b36b213ed 100644 (file)
@@ -62,8 +62,8 @@ inline ostream& operator<<(ostream& out, BlockDevice::biovec &bio)
  */
 
 #undef dout
-#define dout(x) if (x <= g_conf.debug_bdev) cout << "bdev(" << dev << ").elevatorq."
-#define derr(x) if (x <= g_conf.debug_bdev) cerr << "bdev(" << dev << ").elevatorq."
+#define dout(x) if (x <= g_conf.debug_bdev) cout << g_clock.now() << " bdev(" << dev << ").elevatorq."
+#define derr(x) if (x <= g_conf.debug_bdev) cerr << g_clock.now() << " bdev(" << dev << ").elevatorq."
 
 
 int BlockDevice::ElevatorQueue::dequeue_io(list<biovec*>& biols, 
@@ -211,7 +211,7 @@ int BlockDevice::ElevatorQueue::dequeue_io(list<biovec*>& biols,
  * BarrierQueue
  */
 #undef dout
-#define dout(x) if (x <= g_conf.debug_bdev) cout << "bdev(" << dev << ").barrierq."
+#define dout(x) if (x <= g_conf.debug_bdev) cout << g_clock.now() << " bdev(" << dev << ").barrierq."
 
 void BlockDevice::BarrierQueue::barrier()
 {
@@ -259,7 +259,7 @@ int BlockDevice::BarrierQueue::dequeue_io(list<biovec*>& biols,
  */
 
 #undef dout
-#define dout(x) if (x <= g_conf.debug_bdev) cout << "bdev(" << dev << ")."
+#define dout(x) if (x <= g_conf.debug_bdev) cout << g_clock.now() << " bdev(" << dev << ")."
 
 
 
@@ -275,10 +275,10 @@ block_t BlockDevice::get_num_blocks()
     r = ioctl(fd, BLKGETSIZE64, &bytes);
     num_blocks = bytes / (uint64_t)EBOFS_BLOCK_SIZE;
     if (r == 0) {
-      dout(1) << "get_num_blocks ioctl BLKGETSIZE64 reports "
-             << num_blocks << " 4k blocks, " 
-             << bytes << " bytes" 
-             << endl;
+      dout(10) << "get_num_blocks ioctl BLKGETSIZE64 reports "
+              << num_blocks << " 4k blocks, " 
+              << bytes << " bytes" 
+              << endl;
 #else
     // hrm, try the 32 bit ioctl?
     unsigned long sectors = 0;
@@ -286,8 +286,8 @@ block_t BlockDevice::get_num_blocks()
     num_blocks = sectors/8ULL;
     bytes = sectors*512ULL;
     if (r == 0) {
-      dout(1) << "get_num_blocks ioctl BLKGETSIZE reports " << sectors << " sectors, "
-             << num_blocks << " 4k blocks, " << bytes << " bytes" << endl;
+      dout(10) << "get_num_blocks ioctl BLKGETSIZE reports " << sectors << " sectors, "
+              << num_blocks << " 4k blocks, " << bytes << " bytes" << endl;
 #endif
     } else {
       // hmm, try stat!
@@ -296,7 +296,7 @@ block_t BlockDevice::get_num_blocks()
       fstat(fd, &st);
       uint64_t bytes = st.st_size;
       num_blocks = bytes / EBOFS_BLOCK_SIZE;
-      dout(1) << "get_num_blocks stat reports " << num_blocks << " 4k blocks, " << bytes << " bytes" << endl;
+      dout(10) << "get_num_blocks stat reports " << num_blocks << " 4k blocks, " << bytes << " bytes" << endl;
     }
     
     if (g_conf.bdev_fake_mb) {
index a83ce5cb480fdf967516800a800762dec6df2466..d110d066e6993fcf55b8320faff9f3e08997e7bc 100644 (file)
@@ -22,7 +22,7 @@
 
 
 #undef dout
-#define dout(x)  if (x <= g_conf.debug_ebofs) cout << "ebofs.bh."
+#define dout(x)  if (x <= g_conf.debug_ebofs) cout << g_clock.now() << " ebofs.bh."
 
 
 
@@ -33,7 +33,7 @@
 
 
 #undef dout
-#define dout(x)  if (x <= g_conf.debug_ebofs) cout << "ebofs.oc."
+#define dout(x)  if (x <= g_conf.debug_ebofs) cout << g_clock.now() << " ebofs.oc."
 
 
 
@@ -737,7 +737,7 @@ void ObjectCache::clone_to(Onode *other)
 /************** BufferCache ***************/
 
 #undef dout
-#define dout(x)  if (x <= g_conf.debug_ebofs) cout << "ebofs.bc."
+#define dout(x)  if (x <= g_conf.debug_ebofs) cout << g_clock.now() << " ebofs.bc."
 
 
 
index 394ecff6e20a84a69a15c5935225e71ff58c7d2e..44d99eedf38b019a9cfdca1f227c3183ff3bd210 100644 (file)
@@ -30,8 +30,8 @@
 // *******************
 
 #undef dout
-#define dout(x) if (x <= g_conf.debug_ebofs) cout << "ebofs(" << dev.get_device_name() << ")."
-#define derr(x) if (x <= g_conf.debug_ebofs) cerr << "ebofs(" << dev.get_device_name() << ")."
+#define dout(x) if (x <= g_conf.debug_ebofs) cout << g_clock.now() << " ebofs(" << dev.get_device_name() << ")."
+#define derr(x) if (x <= g_conf.debug_ebofs) cerr << g_clock.now() << " ebofs(" << dev.get_device_name() << ")."
 
 
 char *nice_blocks(block_t b) 
@@ -124,31 +124,31 @@ int Ebofs::mount()
   if (journalfn) {
     journal = new FileJournal(this, journalfn);
     if (journal->open() < 0) {
-      dout(-3) << "mount journal " << journalfn << " open failed" << endl;
+      dout(3) << "mount journal " << journalfn << " open failed" << endl;
       delete journal;
       journal = 0;
     } else {
-      dout(-3) << "mount journal " << journalfn << " opened, replaying" << endl;
+      dout(3) << "mount journal " << journalfn << " opened, replaying" << endl;
       
       while (1) {
        bufferlist bl;
        epoch_t e;
        if (!journal->read_entry(bl, e)) {
-         dout(-3) << "mount replay: end of journal, done." << endl;
+         dout(3) << "mount replay: end of journal, done." << endl;
          break;
        }
 
        if (e < super_epoch) {
-         dout(-3) << "mount replay: skipping old entry in epoch " << e << " < " << super_epoch << endl;
+         dout(3) << "mount replay: skipping old entry in epoch " << e << " < " << super_epoch << endl;
          continue;
        }
        if (e == super_epoch+1) {
          super_epoch++;
-         dout(-3) << "mount replay: jumped to next epoch " << super_epoch << endl;
+         dout(3) << "mount replay: jumped to next epoch " << super_epoch << endl;
        }
        assert(e == super_epoch);
        
-       dout(-3) << "mount replay: applying transaction in epoch " << e << endl;
+       dout(3) << "mount replay: applying transaction in epoch " << e << endl;
        Transaction t;
        int off = 0;
        t._decode(bl, off);
@@ -161,7 +161,9 @@ int Ebofs::mount()
   commit_thread.create();
   finisher_thread.create();
 
-  dout(1) << "mounted " << dev.get_device_name() << " " << dev.get_num_blocks() << " blocks, " << nice_blocks(dev.get_num_blocks()) << endl;
+  dout(1) << "mounted " << dev.get_device_name() << " " << dev.get_num_blocks() << " blocks, " << nice_blocks(dev.get_num_blocks())
+         << (journal ? ", with journal":", no journal")
+         << endl;
   mounted = true;
 
 
index 4d2d7b1243fe4d942020487dff2ea841cb9f45fd..c822f16acc2e04e23efefa4beb9e6fc1dfb5dac0 100644 (file)
 
 #include "config.h"
 #undef dout
-#define dout(x) if (x <= g_conf.debug_ebofs) cout << "ebofs(" << ebofs->dev.get_device_name() << ").journal "
-#define derr(x) if (x <= g_conf.debug_ebofs) cerr << "ebofs(" << ebofs->dev.get_device_name() << ").journal "
+#define dout(x) if (x <= g_conf.debug_ebofs) cout << g_clock.now() << " ebofs(" << ebofs->dev.get_device_name() << ").journal "
+#define derr(x) if (x <= g_conf.debug_ebofs) cerr << g_clock.now() << " ebofs(" << ebofs->dev.get_device_name() << ").journal "
 
 
 int FileJournal::create()
 {
-  dout(1) << "create " << fn << endl;
+  dout(2) << "create " << fn << endl;
 
   // open/create
   fd = ::open(fn.c_str(), O_RDWR|O_SYNC);
   if (fd < 0) {
-    dout(1) << "create failed " << errno << " " << strerror(errno) << endl;
+    dout(2) << "create failed " << errno << " " << strerror(errno) << endl;
     return -errno;
   }
   assert(fd > 0);
@@ -45,7 +45,7 @@ int FileJournal::create()
   // get size
   struct stat st;
   ::fstat(fd, &st);
-  dout(1) << "open " << fn << " " << st.st_size << " bytes" << endl;
+  dout(2) << "create " << fn << " " << st.st_size << " bytes" << endl;
 
   // write empty header
   memset(&header, 0, sizeof(header));
@@ -71,7 +71,7 @@ int FileJournal::open()
   assert(fd == 0);
   fd = ::open(fn.c_str(), O_RDWR|O_SYNC);
   if (fd < 0) {
-    dout(1) << "open failed " << errno << " " << strerror(errno) << endl;
+    dout(2) << "open failed " << errno << " " << strerror(errno) << endl;
     return -errno;
   }
   assert(fd > 0);
@@ -83,7 +83,7 @@ int FileJournal::open()
   // read header?
   read_header();
   if (header.fsid != ebofs->get_fsid()) {
-    dout(2) << "journal fsid doesn't match, invalid (someone else's?) journal" << endl;
+    dout(2) << "open journal fsid doesn't match, invalid (someone else's?) journal" << endl;
   } 
   else if (header.num > 0) {
     // valid header, pick an offset