1
0
mirror of https://github.com/Zygo/bees.git synced 2025-05-17 05:15:45 +02:00

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 <bees@furryterror.org>
This commit is contained in:
Zygo Blaxell 2021-05-28 02:17:54 -04:00
parent 5f0f7a8319
commit 7008c74113
2 changed files with 5 additions and 0 deletions

View File

@ -233,6 +233,7 @@ size_t
BeesRoots::crawl_batch(shared_ptr<BeesCrawl> 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));

View File

@ -734,6 +734,7 @@ bees_main(int argc, char *argv[])
// Create a context so we can apply configuration to it
shared_ptr<BeesContext> bc = make_shared<BeesContext>();
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<char>(c) << "'");
switch (c) {
case 'C':