From 7008c74113fafd99b3f2dce410e8cf73bc04737b Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Fri, 28 May 2021 02:17:54 -0400 Subject: [PATCH] bees: trace and log improvements during roots and context startup Currently if crawl throws an exception, we don't have basic information about what was being crawled or even if the crawler was running at all. These traces also help identify the causes of early exception failures. Signed-off-by: Zygo Blaxell --- src/bees-roots.cc | 2 ++ src/bees.cc | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/bees-roots.cc b/src/bees-roots.cc index 9a10e1a..fe322a0 100644 --- a/src/bees-roots.cc +++ b/src/bees-roots.cc @@ -233,6 +233,7 @@ size_t BeesRoots::crawl_batch(shared_ptr this_crawl) { BEESNOTE("Crawling batch " << this_crawl->get_state_begin()); + BEESTRACE("Crawling batch " << this_crawl->get_state_begin()); auto ctx_copy = m_ctx; size_t batch_count = 0; auto subvol = this_crawl->get_state_begin().m_root; @@ -709,6 +710,7 @@ BeesRoots::open_root(uint64_t rootid) bool BeesRoots::is_root_ro_nocache(uint64_t root) { + BEESTRACE("checking subvol flags on root " << root); Fd root_fd = open_root(root); BEESTRACE("checking subvol flags on root " << root << " path " << name_fd(root_fd)); diff --git a/src/bees.cc b/src/bees.cc index c61eec3..98ce192 100644 --- a/src/bees.cc +++ b/src/bees.cc @@ -734,6 +734,7 @@ bees_main(int argc, char *argv[]) // Create a context so we can apply configuration to it shared_ptr bc = make_shared(); + BEESLOGDEBUG("context constructed"); string cwd(readlink_or_die("/proc/self/cwd")); @@ -789,6 +790,8 @@ bees_main(int argc, char *argv[]) break; } + BEESLOGDEBUG("Parsing option '" << static_cast(c) << "'"); + switch (c) { case 'C':