Commit Graph

4203 Commits

Author SHA1 Message Date
Carmen Agimof
f38041dd56 Merge "Change the pulled atom SDCardInfo to ExternalStorageInfo so that we log information about all types of external storage (e.g. USBs)." 2019-03-19 13:15:39 +00:00
Yi Yang
9c18f9df2b Merge "Set DEBUG to false for statsd shell subscriber" 2019-03-19 00:33:12 +00:00
Muhammad Qureshi
4d6c66bf78 Merge "Fix app upgrade related tests" 2019-03-18 22:45:47 +00:00
Yi Yang
bdee4864ce Set DEBUG to false for statsd shell subscriber
Bug: 125843868
Test: N/A, remove logging
Change-Id: I204e900d3c6415142d7d6ed469445afde0953c9c
2019-03-18 14:53:32 -07:00
Carmen Agimof
12dec126d3 Change the pulled atom SDCardInfo to ExternalStorageInfo so that we log
information about all types of external storage (e.g. USBs).

Bug: 123688171
Test: Manually tested using statsd_testdrive script
Change-Id: I4bc7c43bb7f5ee9dee3989eb724d05c4d350aff2
2019-03-18 21:14:42 +00:00
Carmen Agimof
eb83cb51fe Merge "Add new pushed atom to log when an app is installed on external storage." 2019-03-18 19:47:06 +00:00
Ruslan Tkhakokhov
507e6f834d API Review: Internal RestoreSession#restorePackages
Bug: 120843781
Test: 1) atest RunBackupFrameworksServicesRoboTests
      2) atest CtsBackupTestCases
      3) atest CtsBackupHostTestCases
      4) atest GtsBackupTestCases
      5) atest GtsBackupHostTestCases

Change-Id: Ice42aedd702e1c16b074d7a00d7b15d8f4aaf733
2019-03-18 12:26:02 +00:00
Olivier Gaillard
03d694c432 Merge "Fix end-to-end value metrics tests." 2019-03-18 10:19:24 +00:00
TreeHugger Robot
f7a0b28443 Merge "Log the correct oom_adj when compacting apps." 2019-03-18 07:52:00 +00:00
TreeHugger Robot
7ccc9d7674 Merge "Full bucket should be reset even when the last bucket is invalid." 2019-03-16 00:25:27 +00:00
Muhammad Qureshi
902529abea Fix app upgrade related tests
It seems like test-breaking changes were introduced in ag/6410957

Test: make statsd_test && adb sync data && adb shell data/nativetest64/statsd_test/statsd_test
Change-Id: I4cf1c0396b8900d1faa500877df58c6d41479367
2019-03-15 21:30:43 +00:00
Olivier Gaillard
e3c4b93263 Fix end-to-end value metrics tests.
- Use no_time_contraints to pull the data in PartialBucket_e2e_test.
Fast means there is no time to complete the current bucket
- One test had to be updated since the condition was unknown so the
bucket was not valid

Test: atest statsd_test
Change-Id: Id22539b801b29ed6b384045979e7c3cc6e3fe8b6
2019-03-15 21:30:43 +00:00
Olivier Gaillard
c3719911cb Full bucket should be reset even when the last bucket is invalid.
If the bucket is not reset, we will sum the data from the previous
bucket and the next bucket.

As well, the value should only be added to the full bucket if the value
is set.

Bug: 128521677
Test: atest statsd_test
Change-Id: I45bf924a5d2966044cecda34fff84b7cbfe070b0
2019-03-15 21:30:43 +00:00
Ben Murdoch
885c21b094 Log the correct oom_adj when compacting apps.
The useful oom_adj value for app compaction logging is the
previous score, not the upcoming score. We were logging the wrong
value.

Test: verified through event log that values in logs look right.
Bug: 128682578
Change-Id: I7f9554802dac7b4f47579869adb851bc06239ba6
2019-03-15 18:02:04 +00:00
Carmen Agimof
6688a35923 Add new pushed atom to log when an app is installed on external storage.
Change-Id: I998a64bf02c0bf97938396ff12e3ded2e2ac043d
Bug: 123688171
Test: Manually tested using statsd_testdrive script.
2019-03-15 14:52:12 +00:00
Jonathan Nguyen
bbe311c0e5 Maintain existing train information
When sendBinaryPushStateChangedAtom is called with empty train
name/version/experiment ids, populate the empty fields from the
trainInfo previously stored on disk if possible.

If no train info is on disk (or read fails), the empty fields are passed
through.

Test: gts in ag/6731864
Test: testdrive 10051 with partially/completely missing train info
Bug: 128640419

Change-Id: Iea3c2db5c11d07f0b42b41aec7b2d7913a99ca03
2019-03-15 00:26:32 -07:00
Rafal Slawik
93fc5bb44a Merge "Pull system ion heap size." 2019-03-14 11:53:55 +00:00
TreeHugger Robot
2ed4c7574e Merge "Prevent readTrainInfo from crashing statsd." 2019-03-14 07:58:58 +00:00
Tej Singh
d3e063fa2c Prevent readTrainInfo from crashing statsd.
copy_n in readTrainInfo needs an input iterator and an output iterator.
When we read the size of the trainName, we were passing an
outputIterator that was a pointer to size_t. The goal was to fill up the
size_t with the length of the train. However, we need to do this byte by
byte, and by passing the pointer to the size_t, we increment by size_t
bytes instead of one bytes when we increment the iterator.

The change now is to use linux read, which is the mirror to how we write
the file. This code is cleaner and less error prone than reading the
file to a string.

Another thing this cl does is implement some sanity checks to make sure
we dont read pass the string input buffer, and to try to safeguard
against devices that upgrade from beta 1 to beta 2 and have a trainInfo
from beta1 stored on the device (since they are not backwards
compatible.) Another option here is to create a separate file for
everything besides the experiment ids, but that might not be deasible in
the time we have.

Test: storage manager unit tests pass
Test: debug phonesky apk to trigger binary push, manually inspecting the
file created to ensure the write works, and using adb shell cmd stats
pull-source to verify the read works.
Test: statsd testdrive 10051

Bug: 128460940
Change-Id: I3c08d946db9c43d77e5efca2eb1088adbb4a3ce1
2019-03-13 23:15:46 -07:00
TreeHugger Robot
741b782f25 Merge changes from topic "gpustats-statsd-2"
* changes:
  Game Driver Metrics: add tests for GpuStatsPuller
  Game Driver Metrics: get gpu app stats with GpuStatsPuller
2019-03-13 02:01:05 +00:00
Jiyong Park
aff455f278 Merge "Revert^3 "Delay start of bootanimation until after the Runtime APEX is mounted."" am: 1a14dedcce am: 6623e402b3
am: 1c64a73f91

Change-Id: I1cf5a65959d3a2d4cba292c532afddebf58d9683
2019-03-12 16:50:26 -07:00
Jiyong Park
552ad7b7f1 Revert^3 "Delay start of bootanimation until after the Runtime APEX is mounted."
This reverts commit a6bb8916b0.

Bootanim doesn't need to be delayed because the APEXes from the system partition are now
activated very early in the boot sequence (far before bootanim is started).

See https://android-review.googlesource.com/q/topic:%22apex_earlymount_base%22+(status:open%20OR%20status:merged)

Bug: 125549215
Test: bootanim is started without being delayed
Change-Id: I367b1a5c6bf08dad770cd2bf7f6d67dbf1a813e6
2019-03-12 22:33:44 +00:00
Yiwei Zhang
d476542338 Game Driver Metrics: add tests for GpuStatsPuller
Bug: 123529932
Test: atest GpuStatsPuller_test
Change-Id: I325f90d203539b51ee0a9deb2b048b8671e5e89a
2019-03-12 15:29:49 -07:00
Yiwei Zhang
4fb9289a18 Game Driver Metrics: get gpu app stats with GpuStatsPuller
Bug: 123529932
Test: adb shell cmd stats pull-source 10055
Change-Id: I04320221de6ac457acd0b0533a05ce2f8dfbdde0
2019-03-12 14:53:04 -07:00
Rafal Slawik
d4e8757fb6 Pull system ion heap size.
Test: m -j
Test: atest MemoryStatUtilTest
Bug: 128412961
Change-Id: I9a12b03ef92d0df067253fee5165107586bdad54
2019-03-12 15:47:35 +00:00
Fabian Kozynski
214e6b2940 Merge "Added atoms for logging" 2019-03-12 13:00:10 +00:00
Rafal Slawik
2065e5bb1f Show number of failed pulls in print-stats
Test: m -j and cmd stats print-stats
Change-Id: I457f9c3ed7f1dbe95940ba922d2704310a3a46ca
2019-03-11 18:21:54 +00:00
TreeHugger Robot
e11bfbe411 Merge changes from topic "idmap-default-policies"
* changes:
  Fix idmap scan to supply correct policies
  Revert "Revert "Enforce a default policy on packages without <overlayable>""
2019-03-11 15:38:09 +00:00
Fabian Kozynski
bfd6d85dd6 Added atoms for logging
Adds atom for tracking when the Privacy chip is viewed and clicked and
how the Privacy Dialog is dismissed, as long as dismissed from inside the dialog.

Test: manual using statsd_testdrive
Bug: 123896378
Bug: 125731930
Change-Id: Ia09f39dc6bd636a120f8ed2b1b892bdb1a78951f
2019-03-11 09:09:22 -04:00
Ryan Mitchell
4c09a4a4f7 Fix idmap scan to supply correct policies
Overlayable policies were not being passed correctly to idmap2 create
from scan. This fixes that and adds better error messages for when
policy failures occur.

Bug: 127860892
Test: manual
Change-Id: I8fae20884a75f4c57a0eb4aafdb4e09da3ebaf93
2019-03-08 09:31:44 -08:00
TreeHugger Robot
fd1672a52d Merge "Fix ProcessMemoryStatReported atom definition" 2019-03-08 00:13:46 +00:00
Ryan Mitchell
b863ca3348 Revert "Revert "Enforce a default policy on packages without <overlayable>""
This reverts commit 6ce5b00f2a.

Bug: 127835630
Test: manual and idmap2_tests
2019-03-07 14:31:54 -08:00
Ryan Mitchell
6ce5b00f2a Revert "Enforce a default policy on packages without <overlayable>"
This reverts commit 48945224bd.

Reason for revert: <b/127835630>

Change-Id: I0bc90c26e5b7d6b4d94704a2a1f92bbc889c025c
2019-03-07 21:58:14 +00:00
Muhammad Qureshi
dda732096c Fix ProcessMemoryStatReported atom definition
- Add unit to duration field

Test: None
Change-Id: Idec08d8e64d142570ffb326b69abd620996ef98a
2019-03-07 13:54:20 -08:00
Ryan Mitchell
48945224bd Enforce a default policy on packages without <overlayable>
In order to lift the signature/preinstalled install restrictions on overlays,
we must protect packages that have not migrated to <overlayable> from
being overlaid. If a resources is not specified as overlayable and the
overlay does not define an <overlayable>, require the overlay to be
preinstalled or signed with the same signature as the target.

Bug: 121016681
Bug: 125933494
Test: idmap2_tests
Change-Id: I38f520929031b743e4bbe0366a9be55aac5795c5
2019-03-07 16:37:10 +00:00
Yi Kong
974d516e5f Add missing WARN_UNUSED attribute
The upcoming compiler update warns against missing WARN_UNUSED
attribute:

  frameworks/base/cmds/idmap2/libidmap2/Idmap.cpp:58:3: error: function 'Map' should be marked [[nodiscard]] [modernize-use-nodiscard,-warnings-as-errors]
    inline const std::map<TypeId, std::set<std::pair<ResourceId, ResourceId>>>& Map() const {
    ^
    [[nodiscard]]

Test: m checkbuild
Bug: 126457671
Change-Id: Ib006dacbc17446377b2886c73190548f53429a44
2019-03-06 16:22:42 -08:00
TreeHugger Robot
7e477caf01 Merge "Update TrainInfo and BinaryPushStateChanged atoms" 2019-03-06 01:29:22 +00:00
Suren Baghdasaryan
f3f935d0d6 Merge "Add min_score_adj into LmkKillOccurred event" am: 927b3dcb53 am: 37d2a30ef4
am: 8b78132f5a

Change-Id: Ib238a0dd6511da301fefaefe26a6d561e6aeaecd
2019-03-05 16:30:43 -08:00
Muhammad Qureshi
f4ca82495b Update TrainInfo and BinaryPushStateChanged atoms
Add trainName string field to TrainInfo atom
Add status enum to TrainInfo atom
Add additional states to BinaryPushStateChanged.State

Bug: 124397500
Bug: 126787525
Bug: 126780868
Test: add/edit tests in StorageManagerTest to verify new
serialization/deserialization logic

Change-Id: I7bf4cd3b3cb4fdb8b1ebe51a602cfde9fdace6e1
2019-03-05 14:26:38 -08:00
Suren Baghdasaryan
1fbaa1f2b2 Add min_score_adj into LmkKillOccurred event
Log min_score_adj when lmkd kills a process to determine the oom_score
levels that lmkd considers during the kill.
Accompanies Piper cl/236692672

Bug: 123024834
Change-Id: Ibfec13ef80ef1d74f5f224dde2e24970f7a88bfa
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-03-05 15:24:08 +00:00
TreeHugger Robot
55805af719 Merge "Add receiver info to IncidentdDetails in statsd_config" 2019-03-05 09:15:31 +00:00
Howard Ro
d8f2fa31b3 Merge "Fix a typo in ROLLBACK_ROOT_TRIGGERED enum" 2019-03-05 07:52:15 +00:00
Yao Chen
a8e78b9b88 Add receiver info to IncidentdDetails in statsd_config
This can be used for sending a broadcast to an app which incidentd
would share the incident report with.

Test: added unit test in statsd_test

Change-Id: Ieaf5b3b4d67168e2a99ff54e6392c77d8372ed4e
2019-03-04 23:47:27 -08:00
TreeHugger Robot
e33fbee403 Merge "Fix incident_helper crash." 2019-03-05 00:59:37 +00:00
Howard Ro
e4d6feda5d Fix a typo in ROLLBACK_ROOT_TRIGGERED enum
Test: no test needed for an enum change
Bug: 126934738
Fixes: 126934738
Change-Id: Iac673fbe6994c2cb5dcce36725630cbfde231826
2019-03-04 16:59:04 -08:00
Yao Chen
b5908aedc0 Fix incident_helper crash.
The header of top cmd changes from Tasks to Threads, causing the parser to run into
undefined behavior.

Bug: 125377622
Test: adb shell dumpsys incident   && incident_helper_test
Change-Id: I5ae88767dce22f0ee7b49611b2f19889a07e66ac
2019-03-04 14:28:30 -08:00
Howard Ro
6b5cae41e8 Merge "Remove gaillard@google.com from OWNERS of statsd" am: a982663c2b am: 4e48a18e64
am: 91161bb0d4

Change-Id: I76c01c94917b2f58ec0360b2b2ef1bf8a87c32de
2019-03-03 15:27:35 -08:00
TreeHugger Robot
de15ad0361 Merge "Game Driver Metrics: add GpuStatsPuller to get gpu global stats" 2019-03-02 12:01:13 +00:00
Yiwei Zhang
7e6330353e Game Driver Metrics: add GpuStatsPuller to get gpu global stats
Bug: 123529932
Test: adb shell cmd stats pull-source 10054
Change-Id: Ib43a93661d24ce0d4b1e1ae6b6d0b50dbdfd3c15
2019-03-01 22:43:32 -08:00
TreeHugger Robot
2c21cde15a Merge "Add ROLLBACK_ROOT_TRIGGERED enum to WatchdogRollback" 2019-03-02 03:19:28 +00:00