- The buffer size increased, and the CTS test that checked that
was triggering.
- Privacy filtering wasn't working for the stack trace sections
- The incident command was not handling the default arguments correctly
- The throttler was throttling streaming reports, which made the
test flaky.
Bug: 126253679
Test: atest CtsIncidentHostTestCases
Change-Id: I342cd7d0421ea8c22b7796fc99e779f21855af73
+ Sections which require encryption will be encryted on disk.
+ When the sections are requested by clients (e.g., permission controller, report assignee),
incidentd will decrypte the data.
+ For efficiency, encryption is done ONLY for sections that require encryption.
+ Use Keystore API for key management.
Bug: 131084614
Test: incidentd_test
Change-Id: I84d6b86807ba5bbde1051e847b2df6e79e6b5be5
+ IncidentReportArgs takes the bytes instead of IncidentHeaderProto object
This cl is the ag/6287053 + build fix.
Test: incidentd_test && statsd_test
Change-Id: I86bcb48f4ab212b36ca4611a1fa05faace9c3702
Arc++ devices don't have the /d/wakeup_sources file. There's a chance
other device won't have it either, and there may be other files that we
thought were standard but are actually not, so it's safer to just assume
that not every file will be available on every device and not treat a
missing file as an error.
Bug: 110109543
Test: atest incidentd_test
Change-Id: Ief09427f08d18aee611d057ddafdb9a3466744db
This is a temporary solution to bypass failure of reading cpu info or
battery type in P if the path doesn't exist on some devices. See bug for
details. However in Q, incidentd should implement reading from the
common Linux kernel interfaces.
Bug: 78028767
Bug: 78239764
Test: atest incidentd_test
Change-Id: I08ffcb21709efe5478d2ac46121deb5795af1024
Merged-In: I08ffcb21709efe5478d2ac46121deb5795af1024
This is a temporary solution to bypass failure of reading cpu info or
battery type in P if the path doesn't exist on some devices. See bug for
details. However in Q, incidentd should implement reading from the
common Linux kernel interfaces.
Bug: 78028767
Bug: 78239764
Test: atest incidentd_test
Change-Id: I08ffcb21709efe5478d2ac46121deb5795af1024
By moving the section stats collection before any return statements,
it won't missing stats collection.
Bug: 77962855
Test: atest incidentd_test
Change-Id: I0900556428c51636e24df48a407eb916ccff795c
The gtest will fail if the fix of b/77291057 isn't there. Should make
this change in with the fix, but later than none.
Bug: 77291057
Test: atest incidentd_test
Change-Id: I48ece311f78ee18d97486839a3b8b434c9419cf3
FdBuffer won't take ownership of the `main` fd.
It only enforces transfer ownership in readProcessedDataInStream.
Bug: 74021345
Test: atest incidentd_test
Change-Id: I6182730241c81c34b3be865b827a2d3e8c10c21c
But it is ok to disable procrank since the information can be obtain via
dumpsys meminfo
Optimize the code style a bit.
Bug: 72510307
Test: atest incidentd_test
Change-Id: If06201aa708461b569d9fb007f20d1e51342d5c2
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
The incidentd will accumulate the total size put into dropbox and once
it exceeds a threshold (currently 20MB) daily, it will stop further
requests. It allows collection again 24 hours later.
Bug: 64219725
Test: atest incidentd_test and manually flashed incidentd and test.
Change-Id: Iea21fbae40d5d01108797b190231d73e74eff213
to check if the report is uploadable.
Move incidentheader.proto to libincident so statds is able to include a lite
proto class for incident header.
Change IncidentReportArgs to add the proto object instead of serialized
bytes to prevent caller gives meaningless data.
Bug: 70241842
Test: push config to statsd and verify incidentd generate the report
with correct header.
Change-Id: If95b655be71047b019b229e5903a08f3c21a1f29
And implement a file section which reads from event-log-tags for
decoding binary logs.
Bug: 70936599
Test: atest incidentd_test && atest incident_helper_test and flush on
device and test log sections and event_log_tag_map
Change-Id: Ib3d35e317f355de69f01ded012482486e9a43da6
2. Expose Dest values in IIncidentReportArgs.h
Please see bug for detail descriptions.
Bug: 67869340
Test: unit tested and on-device test. Ran command:
$ out/host/linux-x86/bin/incident-section-gen incidentd
to test various of privacy taggings.
Change-Id: I12af3d7da4c7c72bd63598893fe2c1f70b09baa4
By default, WriteStringToFile will not follow link, the 'false'
parameter is unnecessary.
Test: build
Change-Id: Ied6dcbf2a85533108dc2f6d71a4571b44684e800
Protobuf defines classes, which can have self recursive message
definitions and cause a bug in generating privacy flags.
Solve the problem here. The details is in incident_section_gen/main.cpp.
The logic is a bit complicated to address more than one level of self
recursion proto message definition.
Also solve a bug when PrivacyBuffer strips fields.
Modify PRIVACY_POLICY_LIST to be type Privacy** in order to allow
initialization by a method.
Bug: 68162512
Test: unit tested and on device tests
Change-Id: I1d0b79f6813e5fd66c4cf5823d0fa17efc57bb1d
1. Change the APIs of ProtoOutputStream to be able to write bytes
2. Fix the tests in incidentd, stdout is closed so can't capture the
value, use temporaryFile instead.
Test: N/A
Change-Id: Ibc31f2efd068afc6c06188d92f57ca5a754c3683
Extract protobuf class out and creates EncodedBuffer class
which holds protobuf data.
Next step is to create a ProtoOutputStream and let incident helper
adapt the change as well.
please see frameworks/base/core/java/android/util/proto
Bug: 65641021
Test: unit tested
Change-Id: I0dd343b2e62d60f091c8f857fae3452ec8da6b96
The static analyzer found many memory leaks in this file. Converting
everything to use unique_ptr became really ugly, and involved lots of
copying from lists of unique_ptr<Privacy> to lists of Privacy*. Since
these tests really don't seem to allocate much, freeing everything en
masse at the end should be good enough.
Bug: 27101951
Test: mma; memory leak warnings are gone. Running
/data/nativetest64/incidentd_test/incidentd_test shows no failures.
Change-Id: I151b7ef4e02ee736e4e833924c0500e8dbedcc49
1. use struct {} to instantiate privacy fields for efficiency reason
2. use vector<uint8_t>* instead of vector<uint8_t>& to indicate the
caller knows the value gets changed.
3. binary search privay policy for sections
Bug: 65595927
Test: unit test covers
Change-Id: Ic58c2f607465d1a7f10352b9a38c3d8b1a5cf352
Create a HeaderSection to deal with header protos which is more testable
Bug: 65422268
Test: unit tested
Change-Id: Icdcbeded8bc963940a8f9e503cb65a9a247ca5b2
The incident request args sets privacy spec. Strip action is optimized
to run once for each type of spec and ready for flush multiple times.
Incident command is updated to take -p option to specify privacy spec.
Bug: 64687253
Test: unit tests written, manually run incident command to test as well
Change-Id: I6753df117f76dc1a5f4d2152baa3fbbf56b490e4
Implement EncodedBuffer that strip pii based on given privacy request.
The reason to implement another buffer is the length-delimited field's
size could change when its submessage gets stripped. It also intends to
keep the orignal data around for other requests to consume it.
In addition, the section implementation has adapted EncodedBuffer so
write out to each request's fd could be request-specific. The next step
is allow requests to set its privacy spec.
Notice the current design set the privacy spec of dropbox to AUTOMATIC,
this behavior might change in the future.
Bug: 64687253
Test: unit tests are writtern, see README.md for how to run unit tests.
Change-Id: I7ac236b8265ba9289dc6e17a8a5bf7f67ffb6bf5
1. automatically parse privacy options and generate lookup table
2. create FdBuffer iterator API in order to remove dependency on Reporter.h
Bug: 64687253
Test: Unit test for iterator API, and manually tested lookup table
Change-Id: I1ea376a4481fc4afc7bdf447936f767b63690fd3
Bug: 63863444
Test: manual - create gtests for CommandSection and Procrank Parser following
instructions in the README.md of incidentd and incident_helper on how to
run them.
Change-Id: I099808fd13bf9ed9a564b122f1126b1691a83291
Open modes are ignored if the user doesn't want the file to be created:
http://man7.org/linux/man-pages/man2/open.2.html
Since it's somewhat misleading/potentially indicative of a missing
O_CREAT/O_TMPFILE, we plan to issue a warning on open calls with useless
mode bits in the near future. Because -Werror is used in this project
(thank you!), we need to either make these modes useful, or remove them.
Bug: 64132680
Test: mma. New warnings no longer appear.
Change-Id: I5d9b98152e48135ea716592b28c5c771cc74018b
0) Implements a skeleton of incident_helper
1) Implements FileSection class which calls incident_helper to parse
file content to protobuf
2) Adds Kernel Wake Sources to incident.proto and makes it parsed by
FileSection
3) Adds basic gtests to test FdBuffer, io_utils, FileSection
implementation
Bug: 62923266
Bug: 62926061
Test: manual - push incidentd, incident_helper and incident to my device
and verify kernel wakeup sources file is able to be parsed.
Change-Id: I2aa6b6158d962ce70e6fa6c8a9c42213a45ff41c