Browse Source

Fix some logging

trace-sqes
Vitaliy Filippov 1 year ago
parent
commit
41dddddbf2
  1. 2
      blockstore_flush.cpp
  2. 4
      blockstore_journal.cpp
  3. 5
      blockstore_write.cpp
  4. 2
      dump_journal.cpp

2
blockstore_flush.cpp

@ -331,7 +331,7 @@ resume_1:
else
{
clean_disk_entry *new_entry = (clean_disk_entry*)(meta_new.buf + meta_new.pos*bs->clean_entry_size);
assert(new_entry->oid.inode == 0);
assert(new_entry->oid.inode == 0 || new_entry->oid == cur.oid);
new_entry->oid = cur.oid;
new_entry->version = cur.version;
if (!bs->inmemory_meta)

4
blockstore_journal.cpp

@ -148,7 +148,7 @@ bool journal_t::trim()
auto journal_used_it = used_sectors.lower_bound(used_start);
#ifdef BLOCKSTORE_DEBUG
printf(
"Trimming journal (used_start=%lu, next_free=%lu, first_used=%lu, usage_count=%lu)\n",
"Trimming journal (used_start=%08lx, next_free=%08lx, first_used=%08lx, usage_count=%08lx)\n",
used_start, next_free,
journal_used_it == used_sectors.end() ? 0 : journal_used_it->first,
journal_used_it == used_sectors.end() ? 0 : journal_used_it->second
@ -180,7 +180,7 @@ bool journal_t::trim()
return false;
}
#ifdef BLOCKSTORE_DEBUG
printf("Journal trimmed to %lu (next_free=%lu)\n", used_start, next_free);
printf("Journal trimmed to %08lx (next_free=%08lx)\n", used_start, next_free);
#endif
return true;
}

5
blockstore_write.cpp

@ -49,7 +49,10 @@ bool blockstore_impl_t::enqueue_write(blockstore_op_t *op)
}
// Immediately add the operation into dirty_db, so subsequent reads could see it
#ifdef BLOCKSTORE_DEBUG
printf("%s %lu:%lu v%lu\n", is_del ? "Delete" : "Write", op->oid.inode, op->oid.stripe, op->version);
if (is_del)
printf("Delete %lu:%lu v%lu\n", op->oid.inode, op->oid.stripe, op->version);
else
printf("Write %lu:%lu v%lu offset=%u len=%u\n", op->oid.inode, op->oid.stripe, op->version, op->offset, op->len);
#endif
dirty_db.emplace((obj_ver_id){
.oid = op->oid,

2
dump_journal.cpp

@ -76,7 +76,7 @@ int main(int argc, char *argv[])
}
else
{
printf("offset %08lx: no magic in the beginning, looks like random data\n", self.journal_pos);
printf("offset %08lx: no magic in the beginning, looks like random data (pattern=%lx)\n", self.journal_pos, *((uint64_t*)data));
self.journal_pos += self.journal_block;
}
}

Loading…
Cancel
Save