util/cbmem: Add --loglevel option to restrict console printing by level
commitb8258bd2b97d138a1589b07f53d839ed7a838eb5
authorJulius Werner <jwerner@chromium.org>
Thu, 10 Feb 2022 01:26:39 +0000 (9 17:26 -0800)
committerFelix Held <felix-coreboot@felixheld.de>
Fri, 11 Feb 2022 23:56:13 +0000 (11 23:56 +0000)
tree06e48becfd2f48c54fb18113e6f9c2a5186ebdcd
parent1169e5943c97416761b01efe684151435c7fe7a9
util/cbmem: Add --loglevel option to restrict console printing by level

This patch adds a new --loglevel option to the CBMEM utility which can
be used either numerically (e.g. `cbmem -1 --loglevel 6`) or by name
(e.g. `cbmem -c --loglevel INFO`) to restrict the lines that will be
printed from the CBMEM console log to a maximum loglevel. By default,
using this option means that lines without a loglevel (which usually
happens when payloads or other non-coreboot components add their own
logs to the CBMEM console) will not be printed. Prefixing a `+`
character to the option value (e.g. `--loglevel +6` or
`--loglevel +INFO`) can be used to change that behavior.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: I8458027083246df5637dffd3ebfeb4d0a78deadf
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61779
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
util/cbmem/cbmem.c