diff options
author | Mike Ma <yanmin@google.com> | 2020-02-19 02:56:04 -0800 |
---|---|---|
committer | Mike Ma <yanmin@google.com> | 2020-02-23 08:05:42 +0000 |
commit | 5510f7c8cd3df39c85d4308d558841b9ed4aa46d (patch) | |
tree | 76161fcb381f448a3f12b54be5f4fe4c48f6476d /tools/incident_section_gen | |
parent | b629d69db047c40f2b110f2d73ad8ceb1b32ea68 (diff) |
Add text dumpsys section to incidentd
Enable Incidentd to dump any existing dumpsys section in plain text
(as dumpsys.proto), only in eng or userdebug build. This is for a
few dumpsys services that are prohibitively expensive to migrate to
protobuf dumpsys or will undergo a major rewrite (thus render the
previously defined proto completely useless).
Bug: 149816498
Bug: 146085372
Bug: 146086519
Test: $ incident -p EXPLICIT 4000 4001
Change-Id: I0693d9bace0055cfeb63d7c8d48995d57dc0b733
(cherry picked from commit 95ba73f9c9815da08cdb7015195939a3c1b250bd)
Diffstat (limited to 'tools/incident_section_gen')
-rw-r--r-- | tools/incident_section_gen/main.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/incident_section_gen/main.cpp b/tools/incident_section_gen/main.cpp index ded4b916c452..786223a430ae 100644 --- a/tools/incident_section_gen/main.cpp +++ b/tools/incident_section_gen/main.cpp @@ -415,7 +415,7 @@ static bool generateSectionListCpp(Descriptor const* descriptor) { } const SectionFlags s = getSectionFlags(field); - if (s.userdebug_and_eng_only()) { + if (s.userdebug_and_eng_only() || s.type() == SECTION_TEXT_DUMPSYS) { printf("#if ALLOW_RESTRICTED_SECTIONS\n"); } @@ -449,8 +449,13 @@ static bool generateSectionListCpp(Descriptor const* descriptor) { printf(" new TombstoneSection(%d, \"%s\"),\n", field->number(), s.args().c_str()); break; + case SECTION_TEXT_DUMPSYS: + printf(" new TextDumpsysSection(%d, ", field->number()); + splitAndPrint(s.args()); + printf(" NULL),\n"); + break; } - if (s.userdebug_and_eng_only()) { + if (s.userdebug_and_eng_only() || s.type() == SECTION_TEXT_DUMPSYS) { printf("#endif\n"); } } |