Skip to the content.

Event Counters

General

Event counters are used in bees to collect simple branch-coverage statistics. Every time bees makes a decision, it increments an event counter, so there are many event counters.

Events are grouped by prefix in their event names, e.g. block is block I/O, dedup is deduplication requests, tmp is temporary files, etc.

Events with the suffix _ms count total milliseconds spent performing the operation. These are counted separately for each thread, so there can be more than 1000 ms per second.

There is considerable overlap between some events, e.g. example_try denotes an event that is counted when an action is attempted, example_hit is counted when the attempt succeeds and has a desired outcome, and example_miss is counted when the attempt succeeds but the desired outcome is not achieved. In most cases example_try = example_hit + example_miss + (example failed and threw an exception), but some event groups defy such simplistic equations.

addr

The addr event group consists of operations related to translating (root, inode, offset) tuples (i.e. logical position within a file) into btrfs virtual block addresses (i.e. physical position on disk).

adjust

The adjust event group consists of operations related to translating stored virtual block addresses (i.e. physical position on disk) to (root, inode, offset) tuples (i.e. logical positions within files). BeesResolver::adjust_offset determines if a single candidate reference from the LOGICAL_INO ioctl corresponds to the requested btrfs virtual block address.

block

The block event group consists of operations related to reading data blocks from the filesystem.

bug

The bug event group consists of known bugs in bees.

chase

The chase event group consists of operations connecting btrfs virtual block addresses with (root, inode, offset) tuples. resolve is the top level, adjust is the bottom level, and chase is the middle level. BeesResolver::chase_extent_ref iterates over (root, inode, offset) tuples from LOGICAL_INO and attempts to find a single matching block in the filesystem given a candidate block from an earlier scan operation.

crawl

The crawl event group consists of operations related to scanning btrfs trees to find new extent refs to scan for dedupe.

dedup

The dedup (sic) event group consists of operations that deduplicate data.

exception

The exception event group consists of C++ exceptions. C++ exceptions are thrown due to IO errors and internal constraint check failures.

hash

The hash event group consists of operations related to the bees hash table.

inserted

The inserted event group consists of operations related to storing hash and address data in the hash table (i.e. the hash table client).

matched

The matched event group consists of events related to matching incoming data blocks against existing hash table entries.

open

The open event group consists of operations related to translating (root, inode) tuples into open file descriptors (i.e. open_by_handle emulation for btrfs).

pairbackward

The pairbackward event group consists of events related to extending matching block ranges backward starting from the initial block match found using the hash table.

pairforward

The pairforward event group consists of events related to extending matching block ranges forward starting from the initial block match found using the hash table.

readahead

The readahead event group consists of events related to calls to posix_fadvise.

replacedst

The replacedst event group consists of events related to replacing a single reference to a dst extent using any suitable src extent (i.e. eliminating a single duplicate extent ref during a crawl).

replacesrc

The replacesrc event group consists of events related to replacing every reference to a src extent using a temporary copy of the extent’s data (i.e. eliminating leftover unique data in a partially duplicate extent during a crawl).

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.

root

The root event group consists of operations related to translating a btrfs root ID (i.e. subvol ID) into an open file descriptor by navigating the btrfs root tree.

scan

The scan event group consists of operations related to scanning incoming data. This is where bees finds duplicate data and populates the hash table.

scanf

The scanf event group consists of operations related to BeesContext::scan_forward. This is the entry point where crawl schedules new data for scanning.

Note that in current versions of bees, scan_forward is passed extents that correspond exactly to btrfs extent items, so the scanf_extent and scanf_total numbers can only be different if the filesystem changes between crawl time and scan time.

sync

The sync event group consists of operations related to the fsync workarounds in bees.

tmp

The sync event group consists of operations related temporary files and the data within them.