base: Add crash keys
This CL adds support for crash keys (named after
chromium's CrashKey). A Crash Key is a global
variable, which can be either cleared, set to an
integer value or a string value.
When a crash report is generated, the non-cleared
crash keys are appended to the crash log.
Test: perfetto_unittests --gtest_filter=CrashKeysTest.*
Bug: 202283508
Change-Id: I4b374d22a97659bb9598c01e3e88fa4bb88bb59f
diff --git a/BUILD b/BUILD
index edf1172..9e1fcd0 100644
--- a/BUILD
+++ b/BUILD
@@ -333,6 +333,7 @@
srcs = [
"include/perfetto/ext/base/circular_queue.h",
"include/perfetto/ext/base/container_annotations.h",
+ "include/perfetto/ext/base/crash_keys.h",
"include/perfetto/ext/base/ctrl_c_handler.h",
"include/perfetto/ext/base/endian.h",
"include/perfetto/ext/base/event_fd.h",
@@ -634,6 +635,7 @@
perfetto_cc_library(
name = "src_base_base",
srcs = [
+ "src/base/crash_keys.cc",
"src/base/ctrl_c_handler.cc",
"src/base/event_fd.cc",
"src/base/file_utils.cc",