Lightning Talk: Tokenized Logging with Pigweed - Al Semjonovs, Google
Channel: The Linux Foundation
Date: 2023-07-12

Lightning Talk: Tokenized Logging with Pigweed - Al Semjonovs, Google

For space saving, Zephyr’s logging subsystem can be enabled to provide a dictionary based logging system. This creates a JSON database file in the build directory which contains information to correctly parse log data.  This database file only works with the build it's generated with.  Other builds cannot use the same database file as strings are mapped to their address.  At Google, we’re opting to use Pigweeds (PW) tokenizer logging module.  Instead of mapping strings to addresses, PW tokenizer maps strings to a hash.  When log format strings stay the same between builds, the hash stays the same. Any new strings are appended to the hash database. Addresses are almost entirely unpredictable between builds.  This reduces friction for developers in viewing logs when making changes while also reducing image size. We’re working on making pigweed as an additional Zephyr module which can be linked in with KConfig options. The hash database will be updated and stored as an artifact of each build.