Commit Graph

2240 Commits

Author SHA1 Message Date
Jeffrey Huang
088e07b9f0 Merge changes Icd1b1e57,Ib9c6b9b4 into rvc-dev am: 898dda3919 am: 16024fbfde
Change-Id: I04f43f2b61fb0c28ce30f5c7e5d3fe67f189e24b
2020-04-01 19:21:21 +00:00
Jeffrey Huang
898dda3919 Merge changes Icd1b1e57,Ib9c6b9b4 into rvc-dev
* changes:
  Load Metadata from Disk
  Save metadata to Disk
2020-04-01 18:56:26 +00:00
Jeffrey Huang
475677e771 Load Metadata from Disk
Bug: 148280505
Test: bit statsd_test:*
Test: Manual - Added Config, Tested System Server Crash
Test: Manual - Added Config, Tested Device restart
Change-Id: Icd1b1e57bbf24e4a5676820a2b955f2034d4b37d
2020-03-31 19:10:58 -07:00
Jeffrey Huang
b8f5403d17 Save metadata to Disk
Bug: 148280505
Test: bit statsd_test:*
Change-Id: Ib9c6b9b4f22e7380717b480c7ae4a37bb3364619
2020-03-31 19:10:58 -07:00
Zhen Sun
9d4c65cd8e Merge "Add atom of TvSettings and its enum" into rvc-dev am: e31edc21a1
Change-Id: I133db962d0398e624d4c3b42342f61de20255c93
2020-03-31 23:39:59 +00:00
Zhen Sun
e31edc21a1 Merge "Add atom of TvSettings and its enum" into rvc-dev 2020-03-31 23:24:21 +00:00
TreeHugger Robot
e1ac4b0366 Merge "Log also the lang id model name that is involved in events" into rvc-dev am: 32f3bcfcd2
Change-Id: I70cf70f98711667cae04a9d9c487c997fd5e2d9b
2020-03-31 20:13:21 +00:00
TreeHugger Robot
32f3bcfcd2 Merge "Log also the lang id model name that is involved in events" into rvc-dev 2020-03-31 20:04:47 +00:00
TreeHugger Robot
30b9a38675 Merge "Guardrail for pull cooldown/timeout" into rvc-dev am: 533a99f3b0
Change-Id: Icd87036716c07c222193e61e068e90c5043774e3
2020-03-31 18:47:42 +00:00
Tony Mak
2c0049521b Log also the lang id model name that is involved in events
Possible values:
und_v0, und_v1

What is it:
The model version of the LangId model file.

Who determines this value?
The textclassifier team. The model version is burnt to the model file.

Test: m
Test: atest TextClassifierServiceTest

Bug: 152490822

Change-Id: I0058536ee4e5d8e9c14e100b61683c67af28981d
2020-03-31 17:12:17 +00:00
Tej Singh
abc1b8de87 Guardrail for pull cooldown/timeout
Enforce a 1 second minimum cooldown and a 10 second maximum timeout on
pullers.

Test: bit statsd_test:*
Test: atest LibStatsPullTests
Test: atest GtsStatsdHostTestCases
Bug: 152543610
Change-Id: Ida0047235a7e56d7b700f1a7ab5cfbc2a147caeb
2020-03-30 22:26:46 -07:00
Zhen Sun
0bec8d43a1 Add atom of TvSettings and its enum
The enums correspond to pages and entries of TvSettings. Some enums that
are related to unreleased features are not included in this CL but will
be added when this CL is cherrypicked into upstream non-public
TV-specific branches.

The atom definition is reviewed and approved by Metrics council.

Metrics council review bug: 151768952
Bug: 150979527
Test: the Android tree still builds normally

Change-Id: I4258312c19aa4f2f0cd178bc5b5dc53e52c6c737
Merged-In: I4258312c19aa4f2f0cd178bc5b5dc53e52c6c737
2020-03-30 23:39:19 +00:00
TreeHugger Robot
bbf4db7cce Merge changes from topic "tej-uid" into rvc-dev am: 0ac1c345a4
Change-Id: Ia9d60b28c0a4f07059069811e81bc547b824b592
2020-03-28 04:38:48 +00:00
Tej Singh
f4e17e6639 LibstatsPullTest, Testdrive updates for sandboxing
Test: atest LibStatsPullTests
Test: statsd_testdrive 10051 10004 10055
Test: adb shell cmd stats pull-source 10051 AID_STATSD
Test: adb shell cmd stats pull-source 10055 AID_GPU_SERVICE
Test: adb shell cmd stats pull-source 10004
Bug: 151642352
Change-Id: I3b104cb2f2427b4558d5175dfeb3bb2c80012d0e
2020-03-27 19:02:10 -07:00
Chen Chen
c6cf6a8eb7 Merge "Bluetooth Metrics: Add metric_id field for Bluetooth metrics to proto. The incremental id is neither a device id nor a pseudo name and therefore PII free." into rvc-dev am: 0941d63aee
Change-Id: I22f7d098de494503fca06d90e12de1ef33661183
2020-03-28 01:08:08 +00:00
Tej Singh
3be093b518 Uid Sandboxing of Pullers
Overall flow of implementation:
1. parsing the config in MetricsManager to store the uids per atom. It
follows the mAllowedLogSources logic very closely
2. MetricsManager register itself as a PullUidProvider with the
PullerManager.
3. Metrics pass the config key when pulling (for both registering
receivers and normal pulls) , and the puller manager gets
the allowed uids from the PullUidProvider for that config.
4. PullerManager keys receivers by <atomId, configKey> so that it can
look up the uids for that atom using the PullUidProvider as well.
5. Added shell subscriber support. Hardcode a default of AID_SYSTEM for
them and also allow packages per atom. This involved adding a second
interface to Pull that simply accepts the uids, since I didnt want to
make the ShellSubscriber a PullUidProvider as well.
6. Change adb shell cmd stats pull-source to allow users to specify a
package. Default to AID_SYSTEM as well.

Notes:
The feature is flagged off right now, since configs do not pass in the
desired package. Another approach could be to hardcode in the current
mapping, but that doesn't work for OEM pulled atoms.

Test: m statsd
Test: bit statsd_test:* with useUids = false
Test: bit statsd_test:* with useUids = true
Bug: 144099783
Bug: 151978258

Change-Id: I4a7481d7402a52b9beb4ea28b102803f9e50e79f
2020-03-27 18:07:24 -07:00
Chen Chen
0941d63aee Merge "Bluetooth Metrics: Add metric_id field for Bluetooth metrics to proto. The incremental id is neither a device id nor a pseudo name and therefore PII free." into rvc-dev 2020-03-28 00:54:26 +00:00
TreeHugger Robot
eb1f442779 Merge "Fix atom id annotation parsing" into rvc-dev am: 4efa78539d
Change-Id: I9b575ef4648b7bfc3c18d418e1f21da7efad1a8b
2020-03-27 22:26:59 +00:00
TreeHugger Robot
4efa78539d Merge "Fix atom id annotation parsing" into rvc-dev 2020-03-27 22:02:38 +00:00
Muhammad Qureshi
f2012da846 Fix atom id annotation parsing
Bug: 152633444
Test: m -j cts && m -j CtsStatsdHostTestCases && cts-tradefed run
cts-dev -m CtsStatsdHostTestCases -t
android.cts.statsd.atom.UidAtomTests#testAudioState
Test: bit statsd_test:*

Change-Id: I167012330e431b38b86f190ca6b5d4f90995172f
2020-03-27 12:38:00 -07:00
Maryam Karimzadehgan
9be6a4739c Proto changes and binary for adding more logs to the Back am: 4f9ab82c08
Change-Id: Id259b0fff3c41019ea25c144cb11d4c24b52861d
2020-03-26 17:14:17 +00:00
Maryam Karimzadehgan
4f9ab82c08 Proto changes and binary for adding more logs to the Back
Gesture. Design document:
go/logging-back-gesture.

Test: manual
Bug: 148104018
Change-Id: I63b745f30b7581306150d2d7ab1fe3cccfe5147f
2020-03-26 17:01:22 +00:00
Christine Tsai
fef7a80bec Merge "Update unit tests to use new socket schema" into rvc-dev am: 0810d57f95
Change-Id: I9d7952fb1a646bc772ee80ecca6690bd715a2e03
2020-03-26 16:57:55 +00:00
Christine Tsai
0810d57f95 Merge "Update unit tests to use new socket schema" into rvc-dev 2020-03-26 16:42:44 +00:00
tsaichristine
d5800b208e Update unit tests to use new socket schema
I forgot to update Gauge and EventMetricProducer unit test files to use
the new socket schema.

The EventMetric tests were also incomplete so I added test code to
output the dump report and check its contents.

Test: bit statsd_test:*
Bug: 149590301 && 110561136

Change-Id: I685688285d9890cf7c5bd3ffc43f13cbbb8f93de
2020-03-25 16:36:18 -07:00
Jeffrey Huang
716b3149f7 Merge changes I7127dd7d,I84da0cd9 into rvc-dev am: 1bd7fe106a
Change-Id: Ia1959d487784f0e30de71e77e8ee4a7a80010db0
2020-03-25 22:34:43 +00:00
Jeffrey Huang
1bd7fe106a Merge changes I7127dd7d,I84da0cd9 into rvc-dev
* changes:
  Add mAlertToAnomalyTrackerMap to MetricsManager
  Add StatsMetadataList proto
2020-03-25 22:31:02 +00:00
Raff Tsai
4244a87d19 Merge "Add SettingSnapshot atom" into rvc-dev am: 9a54e23d8e
Change-Id: I1aa30249ae99c6c27af1679927845ef12fec80dc
2020-03-25 20:45:38 +00:00
Raff Tsai
9a54e23d8e Merge "Add SettingSnapshot atom" into rvc-dev 2020-03-25 20:42:07 +00:00
Muhammad Qureshi
e440df36bb Merge changes Iad76baea,I3db5f4ff into rvc-dev am: 6fe5fd6e2e
Change-Id: Ibd751ce32cc1ed3bec08712bf019af81fc595985
2020-03-25 17:40:28 +00:00
TreeHugger Robot
2783274cbe Merge "Fix ValueMetricProducer_test on hwasan" into rvc-dev am: 8910bf95c6
Change-Id: Ic47b08af8e5db157372684542050a0d83a60812a
2020-03-25 17:38:39 +00:00
Muhammad Qureshi
6fe5fd6e2e Merge changes Iad76baea,I3db5f4ff into rvc-dev
* changes:
  Run clang-format in stats_log_api_gen
  Add truncate_timestamp annotation
2020-03-25 17:38:05 +00:00
TreeHugger Robot
8910bf95c6 Merge "Fix ValueMetricProducer_test on hwasan" into rvc-dev 2020-03-25 17:32:55 +00:00
Christine Tsai
819aa0f9f0 Merge "Update the cc_benchmark to use the new socket schema" into rvc-dev am: be88f7df21
Change-Id: I72ee6099c39454d5cc601fa337249aad4ba2972f
2020-03-25 16:43:16 +00:00
Raff Tsai
ea4db183fe Add SettingSnapshot atom
Bug: 142941011
Test: m Settings
Change-Id: I135a8ee1c0f8527d539c3613425e7e4c082ec099
2020-03-25 17:08:26 +08:00
Tej Singh
547f46331c Fix ValueMetricProducer_test on hwasan
TestUseZeroDefaultBaseWithPullFailures was failing on hwasan builds
because the test had a reference to an Interval object that was
deleted. The test tried to get another Interval object and assign it to
the reference. However, what this really did is change the Interval
object that the reference referred to. Since that Interval object had
been deleted, hwasan failed the test.

This fixes the issue. Also clean up some usages of auto to make
the test more readable.

Test: bit statsd_test:* on blueline_hwasan
Bug: 152354576
Change-Id: I392740770715391c727d190b1ed8ba22cc01210f
2020-03-25 08:10:35 +00:00
Jeffrey Huang
38d702697d Add mAlertToAnomalyTrackerMap to MetricsManager
Bug: 148280505
Test: bit statsd_test:*
Change-Id: I7127dd7dac9f6c4f3d415534c339aaba28fa41f3
2020-03-24 17:22:32 -07:00
Muhammad Qureshi
9b995809fb Add truncate_timestamp annotation
Mark privacy-sensitive atoms with truncate_timestamp annotation.

Factor out annotation collation to a helper method.

Add truncate_timestamp annotation support in stats-log-api-gen.

Add writeAnnotation* calls in Java and native generated code for
atom id annotations.

TODO: remove kTruncatingTimestampAtoms from atoms_info.
TODO: use truncate_timestamp annotation inside statsd.

Bug: 151111680
Test: stats-log-api-gen-test
Test: m statslog-framework-java-gen
Test: m libstatsmetadata

Change-Id: I3db5f4ffbf959bd36c62f890cc88606912798d40
2020-03-24 16:49:36 -07:00
tsaichristine
63143251fe Update the cc_benchmark to use the new socket schema
Also removed unused CreateEvent helper functions in metric_util.cpp

Test: bit statsd_benchmark:*
Bug: 149794614
Change-Id: I14bcc254c44773eb42f749305beadaaf23a19b2b
2020-03-24 16:03:48 -07:00
Christine Tsai
7e70b4f3db Merge "(Part 3) Use new socket schema with statsd tests" into rvc-dev am: 4aa7af0a8f
Change-Id: I050455f4f3f95d765bfcdb314b0b4e04b002e1d4
2020-03-24 21:06:49 +00:00
Christine Tsai
4aa7af0a8f Merge "(Part 3) Use new socket schema with statsd tests" into rvc-dev 2020-03-24 20:55:26 +00:00
Jeffrey Huang
8a617e0024 Add StatsMetadataList proto
Bug: 148280505
Test: m -j
Change-Id: I84da0cd9c79dc1073c40a439fe2acff2e3fbc7ec
2020-03-24 12:46:14 -07:00
junyulai
cb37064a73 [SM01] Add rat type fields in data usage atoms for mobile data am: f889330c89
Change-Id: Ia8393cd41a605f062b9f3abe93f5727a2d57aaff
2020-03-24 07:27:28 +00:00
junyulai
f889330c89 [SM01] Add rat type fields in data usage atoms for mobile data
Test: build
Bug: 129082217
Change-Id: Idfc048d49f98acb805f49046a0b3dc871e001142
Merged-In: Idfc048d49f98acb805f49046a0b3dc871e001142
(cherry picked from commit 071a06635b)
2020-03-24 04:28:48 +00:00
TreeHugger Robot
925972ebf9 Merge "Native API Council asked that we remove the C++ class from the public header." into rvc-dev am: 14f33ae83e
Change-Id: Ibfaba0a7bd05cae259c13c82a1059e3428730198
2020-03-24 01:54:05 +00:00
TreeHugger Robot
14f33ae83e Merge "Native API Council asked that we remove the C++ class from the public header." into rvc-dev 2020-03-24 01:35:40 +00:00
tsaichristine
a3d2ed8cb2 (Part 3) Use new socket schema with statsd tests
Update last set of statsd tests to use new socket schema

Test: bit statsd_test:*
Bug: 149590301
Change-Id: I0fe2c219ad75813db54ff0cfbad50f55e29cb626
2020-03-23 12:23:26 -07:00
TreeHugger Robot
ccdc9e2ba1 Merge "ShellSubscriber: Avoid rollover bug" into rvc-dev am: f1d96d48f6
Change-Id: I3c9118b5df7f376b3cc46b72abac27a59f61edc9
2020-03-23 17:55:14 +00:00
Jooyung Han
592d6bf8cd use vector<uint8_t> for byte[] in AIDL
In native world, byte stream is typically represented in uint8_t[]
or vector<uint8_t>. C++ backend already generates that way. This
change involves NDK backend.

Now NDK backend also uses vector<uint8_t> just like C++ backend.

Bug: 144957764
Test: atest CtsNdkBinderTestCases
Merged-In: I74bf803a3781c83c4102972f5df67312131bb879
Change-Id: I74bf803a3781c83c4102972f5df67312131bb879
(cherry picked from commit d9a228a937)

Exempt-From-Owner-Approval: cp from master to avoid merge-conflict
2020-03-23 16:12:09 +00:00
Greg Kaiser
f0f1d83624 ShellSubscriber: Avoid rollover bug
We initialize 'mToken' instead of leaving it uninitialized, making
it much less likely to rollover.  In additional, we change our
check to inequality, to handle rollover if that were to happen.

There is the (theoretical) possibility of exactly 2^32 other
requests being claimed between our claim and our check.  It's
assumed that is essentially impossible and not a concern.

Test: TreeHugger
Bug: 150619687
Change-Id: Iee303e05082a6b3b31ed546bd62d3afe67c771d8
2020-03-23 16:09:57 +00:00