diff --git a/docs/event-counters.md b/docs/event-counters.md index f74cbdc..3821455 100644 --- a/docs/event-counters.md +++ b/docs/event-counters.md @@ -296,6 +296,7 @@ resolve The `resolve` event group consists of operations related to translating a btrfs virtual block address (i.e. physical block address) to a `(root, inode, offset)` tuple (i.e. locating and opening the file containing a matching block). `resolve` is the top level, `chase` and `adjust` are the lower two levels. + * `resolve_empty`: The `LOGICAL_INO` ioctl returned successfully with an empty reference list (0 items). * `resolve_fail`: The `LOGICAL_INO` ioctl returned an error. * `resolve_large`: The `LOGICAL_INO` ioctl returned more than 2730 results (the limit of the v1 ioctl). * `resolve_ms`: Total time spent in the `LOGICAL_INO` ioctl (i.e. wallclock time, not kernel CPU time). diff --git a/src/bees-context.cc b/src/bees-context.cc index 73e2b64..36cccc9 100644 --- a/src/bees-context.cc +++ b/src/bees-context.cc @@ -821,6 +821,10 @@ BeesContext::resolve_addr_uncached(BeesAddress addr) // Avoid performance problems - pretend resolve failed if there are too many refs const size_t rv_count = log_ino.m_iors.size(); + if (!rv_count) { + BEESLOGDEBUG("LOGICAL_INO returned 0 refs at " << to_hex(addr)); + BEESCOUNT(resolve_empty); + } if (rv_count < BEES_MAX_EXTENT_REF_COUNT) { rv.m_biors = vector(log_ino.m_iors.begin(), log_ino.m_iors.end()); } else {