diff options
author | Yi Jin <jinyithu@google.com> | 2018-02-22 16:44:10 -0800 |
---|---|---|
committer | Yi Jin <jinyithu@google.com> | 2018-02-27 11:36:29 -0800 |
commit | 1a11fa10977ee1e2645d400844ff4d472b8f5f02 (patch) | |
tree | f2a56b25e6da627ab148344900be49ee6e8281c7 /libs | |
parent | acb42c36f5ecfa2ab442fce1b97ab446c73008a8 (diff) |
Implement a new section to attach LAST_KMSG to incident report
This section simply gzip a large file and stores result in GZippedFileProto
This greatly improves the size, before gzip, the last kmsg size ~500KB,
after gzip the proto size is ~60KB.
Bug: 73354384
Test: atest incidentd_test and manual on device test
Change-Id: I9bfc2cf07384487671edbffb5f0bd8495608fea6
Diffstat (limited to 'libs')
-rw-r--r-- | libs/incident/proto/android/section.proto | 3 | ||||
-rw-r--r-- | libs/protoutil/include/android/util/EncodedBuffer.h | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/libs/incident/proto/android/section.proto b/libs/incident/proto/android/section.proto index 49bfe1e8a598..ef6a8ff6bcea 100644 --- a/libs/incident/proto/android/section.proto +++ b/libs/incident/proto/android/section.proto @@ -40,6 +40,9 @@ enum SectionType { // incidentd calls logs for annotated field SECTION_LOG = 4; + + // incidentd read file and gzip the data in bytes field + SECTION_GZIP = 5; } message SectionFlags { diff --git a/libs/protoutil/include/android/util/EncodedBuffer.h b/libs/protoutil/include/android/util/EncodedBuffer.h index 0a8a5aa347ba..bf698d4a8f1d 100644 --- a/libs/protoutil/include/android/util/EncodedBuffer.h +++ b/libs/protoutil/include/android/util/EncodedBuffer.h @@ -154,7 +154,7 @@ public: void editRawFixed32(size_t pos, uint32_t val); /** - * Copy _size_ bytes of data starting at __srcPos__ to wp. + * Copy _size_ bytes of data starting at __srcPos__ to wp, srcPos must be larger than wp.pos(). */ void copy(size_t srcPos, size_t size); |