crosvm/cros_tracing
Daniel Verkamp 1445ac1b93 cros_tracing: simplify trace_marker file checking
Rather than checking if the trace_marker file in sysfs exists and then
immediately proceeding to open it, we can just try to open it and handle
the resulting error if it doesn't exist.

Additionally, log the filename if the file can't be opened to make the
debugging process easier.

BUG=b:256052372
TEST=cargo build --features=trace_marker

Change-Id: I117324b0903afdbd351d03a18755321cacf1f42c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4262323
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2023-02-21 20:31:04 +00:00
..
src cros_tracing: simplify trace_marker file checking 2023-02-21 20:31:04 +00:00
Cargo.toml