Commit Graph

2901 Commits

Author SHA1 Message Date
TreeHugger Robot
3ce208c1e9 Merge "Add team members in OWNER file" into pi-dev 2018-03-09 07:37:43 +00:00
yro
66781e1bf5 Add team members in OWNER file
Bug: 74415902

Test: no test necessary
Change-Id: I39d0a5cb9c6e8520fd29881442e66961096d52fc
2018-03-09 07:37:36 +00:00
TreeHugger Robot
7ad26e4bad Merge "Fix statsd crash due to bad bucket index" into pi-dev 2018-03-09 03:23:17 +00:00
TreeHugger Robot
12fa6b4ff6 Merge "Optimize incidentd memory usage" into pi-dev 2018-03-09 01:57:32 +00:00
TreeHugger Robot
ec66e9e726 Merge "Write data to file when StatsCompanionSerivice (system_server) crashes" into pi-dev 2018-03-09 01:18:27 +00:00
Bookatz
2fb5653b97 Fix statsd crash due to bad bucket index
Statsd crashes because predictAnomalyTimestamp requests past buckets
that occurred before time began. That's fine, but statsd needs to know
that the data before time began was 0 (instead of reading before the
beginning of the array and crashing).

AnomalyTracker's use of bucketNumbers is in general risky, and should be
auditted. But this cl will fix the current crashing.

Bug: 73825954
Test: Definitely necessary. Will write during audit.
Change-Id: I990ff134153f290d3089bfe3440d838f47996b63
2018-03-08 13:34:16 -08:00
TreeHugger Robot
641eb554fd Merge "Statsd cpu optimizaton" into pi-dev 2018-03-08 04:03:19 +00:00
Yi Jin
86dce413f8 Optimize incidentd memory usage
1. Remove dependency of libprotobuf-cpp-lite, saves .so mmap ~200KB
2. Don't use auto except iterator for readability.

Bug: 74254200
Test: adb shell dumpsys meminfo `pid incidentd`
Change-Id: If6198521c3b80929d6ea3f7ed466b5195991ccfd
2018-03-07 18:25:44 -08:00
yro
1cf2ac5241 Write data to file when StatsCompanionSerivice (system_server) crashes
Bug: 73352867
Change-Id: Iecbb1ae3e29264975771155a878b368cfc2f50f0
Test: statsd_test
2018-03-07 17:59:13 -08:00
TreeHugger Robot
09ed26a046 Merge "Dumping stack traces to proto." into pi-dev 2018-03-08 01:55:13 +00:00
Yangster
13fb7e4eea Statsd cpu optimizaton
- cache the changed dimensions in condition tracker.
- avoid query condition wizard when unnecessary.
- avoid copy dimension keys in condition key generation.

Test: statsd tests.

BUG: b/73959649
Change-Id: I17d68e2a82643de3f421309841e75f84c6fd8f43
2018-03-07 17:36:07 -08:00
Chenjie Yu
c8a6305ddf Merge "Refactor cpu stats pullers" into pi-dev 2018-03-08 00:24:00 +00:00
Kweku Adams
eadd123d68 Dumping stack traces to proto.
Bug: 72177715
Test: flash device and check incident.proto output
Change-Id: Id2a15e0fc62b66efe875949af97f0eb651c7e322
(cherry picked from commit 5c804e2b98)
2018-03-07 21:50:12 +00:00
Chenjie Yu
ec67661bdf Refactor cpu stats pullers
use same cpu stats readers with BatteryStats so that
1) both throttle to avoid too frequent pulls
2) cached value is served within throttle interval to avoid double
pulling by both statsd and BatteryStats

To run unit tests:
bit
FrameworksCoreTests:com.android.internal.os.KernelUidCpuFreqTimeReaderTest
bit
FrameworksCoreTests:com.android.internal.os.KernelUidCpuClusterTimeReaderTest
bit
FrameworksCoreTests:com.android.internal.os.KernelUidCpuActiveTimeReaderTest

make -j56 statsd_test && adb sync data && adb shell
/data/nativetest64/statsd_test/statsd_test

Test: cts test, unit test
Bug: 73745189
Bug: 73780619
Bug: 73360959

Merged-In: I10a9bc91ca67fa812f4cd71c4fbd73c1a5ba580e

Change-Id: I10a9bc91ca67fa812f4cd71c4fbd73c1a5ba580e
2018-03-07 21:43:00 +00:00
Anton Hansson
d137c872cd frameworks/base: Set LOCAL_SDK_VERSION where possible.
This change sets LOCAL_SDK_VERSION for all packages where
this is possible without breaking the build, and
LOCAL_PRIVATE_PLATFORM_APIS := true otherwise.

Setting one of these two will be made required soon, and this
is a change in preparation for that. Not setting LOCAL_SDK_VERSION
makes the app implicitly depend on the bootclasspath, which is
often not required. This change effectively makes depending on
private apis opt-in rather than opt-out.

Test: make relevant packages
Bug: 73535841
Exempt-From-Owner-Approval: Global cleanup
Change-Id: I26458e41ecb84de91ac9a356a5d4bafb44f463c1
2018-03-07 11:42:04 +00:00
TreeHugger Robot
f9500e9c01 Merge "Atom: ResourceConfigurationChanged" into pi-dev 2018-03-07 00:41:35 +00:00
Tej Singh
a883b37fc0 Atom: ResourceConfigurationChanged
Logs when the configuration changes, such as when the screen orientation
changes. Logs information including font scale, screen width/height,
screen orientation, color mode.

Test: verified atom appears in adb logcat -b stats when screen
orientation changes.

Change-Id: Ifc3f3c62c5e386960b77d78f2ff2f17fc27db2b8
(cherry picked from commit 8a6df9290f)
2018-03-06 17:49:39 +00:00
Yi Jin
5ee0787024 Use uint64_t instead of long long as API type for consistent reason.
Bug: 74118023
Test: manual
Change-Id: Icd5f506c76d3a008a79cb6c9d2061962ca7fdd40
2018-03-05 18:18:27 -08:00
TreeHugger Robot
076eebfb3d Merge "Add #alerts to StatsdStats printout" 2018-03-05 05:43:44 +00:00
TreeHugger Robot
b603fb06ba Merge "Add API to let metrics directly drop data without writing to an output." 2018-03-02 23:38:21 +00:00
TreeHugger Robot
644e15d5bd Merge "Reduce statsd binary size from 730KB-> 664KB" 2018-03-02 19:41:56 +00:00
TreeHugger Robot
a793e50849 Merge "Add the MetricDimensionKey to the log when anomaly happens." 2018-03-02 19:12:18 +00:00
Bookatz
aea8d10b1e Add #alerts to StatsdStats printout
When print-stats is called, now #alert=0 won't always be 0.

Change-Id: If618c9a0890b45f7211f05853f4d97332d7f4cf1
Fixes: 73493830
Test: Manual confirmation
2018-03-02 10:37:24 -08:00
TreeHugger Robot
cbecb1a006 Merge "Add StateTracker." 2018-03-02 17:54:08 +00:00
Yao Chen
06dba5d79c Add API to let metrics directly drop data without writing to an output.
+ Metrics will do flushIfNeeded() to correctly move the clock and informing
  AnomalyTracker the past bucket info, and then clear past buckets.

+ We will still keep the current bucket data for the validity of the future metrics.

Bug: 70571383
Test: statsd_test
Change-Id: Ib13c45574974e7b4e82bd8f305091dc93bda76f5
2018-03-01 15:22:55 -08:00
Rajeev Kumar
51b54606d7 Create a pushed atom that gets logged when the ActivityManagerService detects that an app died.
Test: Manual
Bug: 73660232
Change-Id: I8e1fda35deb1e6876da0b6638fefea9f1b92b641
2018-03-01 13:28:31 -08:00
Yao Chen
99427efbe8 Add the MetricDimensionKey to the log when anomaly happens.
Test: statsd_test
Change-Id: I9454da23a95d106a6e70249bb26c04492fee9135
2018-03-01 13:03:38 -08:00
Yao Chen
580ea321b1 Add StateTracker.
StateTracker is a special condition tracker that's based on a state atom.
State atoms are annotated in atoms.proto.

The rules for StateTracker:
 1. must not have "stop". must have "dimension"
 2. must be based on a state atom.
 3. it must have the all primary fields and the exclusive state field in its dimension.

 For example UidProcessStateTracker, will have output dimension {uid, state}.

Test: unit tests added.
Change-Id: I6b77e58e9fabe61f7326daf929577d8b2cfbf27b
2018-02-28 16:57:03 -08:00
Yao Chen
20e9e6231a Reduce statsd binary size from 730KB-> 664KB
1. StatsdStats does not use the proto object in memory anymore.
2. lite_static -> lite
3. don't use sstream

Bug: 72129300
Test: statsd_test

Change-Id: I8a5adaf222d4d5034e8bf115215fb6dd5f042cac
2018-02-28 16:20:54 -08:00
TreeHugger Robot
780bcc1f5a Merge "Fix heap buffer overflow" 2018-02-28 23:05:09 +00:00
TreeHugger Robot
6158952c30 Merge "Avoid reading logs that were processed before." 2018-02-28 19:37:05 +00:00
Yi Jin
06ebd1af8e Fix heap buffer overflow
Bug: 74000767
Test: manual
Change-Id: Id57674c0ae527da055a06acf4f458c440328c5c3
2018-02-28 11:25:58 -08:00
TreeHugger Robot
9371be3b88 Merge "Bmgr about running backups" 2018-02-28 14:26:34 +00:00
Steven Moreland
df7675f1cb Merge "Don't use cutils/Atomic.h" am: 07735797a2 am: a272d540d8
am: 0f4ca4a5c0

Change-Id: I4b9798b39d890537f888415b5ac283227970e4de
2018-02-28 14:13:52 +00:00
Steven Moreland
a272d540d8 Merge "Don't use cutils/Atomic.h"
am: 07735797a2

Change-Id: Ie56fadea498f35c7e820f9fadac1b64697565a78
2018-02-28 13:51:44 +00:00
Bernardo Rufino
760c1f552c Bmgr about running backups
Says that backups can be canceled if one already running. Put message
for running backups in dumpsys for checking.

Bug: 72484277
Test: Triggered backup, checked dumpsys and bmgr backupnow
Change-Id: I028cf663858e374389f50175aaf5a3e8c9d45e42
2018-02-28 12:11:26 +00:00
TreeHugger Robot
99e8972919 Merge "Add the option to match a whitelist of strings in FieldValueMatcher." 2018-02-28 04:50:17 +00:00
TreeHugger Robot
16b989fc0e Merge "Add incidentd to readproc group." 2018-02-28 04:13:20 +00:00
TreeHugger Robot
bb69f73a0c Merge "Atoms: Keygaurd and Bouncer" 2018-02-28 04:10:29 +00:00
TreeHugger Robot
f4405efb97 Merge "Add a comment to allocate field number above 100000 for OEMs to use and block them off from being used." 2018-02-28 03:15:46 +00:00
TreeHugger Robot
ec98448f15 Merge "Implement a new section to attach LAST_KMSG to incident report This section simply gzip a large file and stores result in GZippedFileProto" 2018-02-28 03:02:16 +00:00
yro
a1fe77c6bd Add a comment to allocate field number above 100000 for OEMs to use and block
them off from being used.

Bug: 72866543
Test: statsd_test, cts tests
Change-Id: I2074f53eb3360aa93a9bea4e596a8c295696312f
2018-02-27 16:59:49 -08:00
Yangster-mac
539288806f Duration tracker optimization.
* Avoid querying sliced condition for stop/stopAll events for duration metric.
* Avoid extracting the internal dimension key when it is identical to the what dimension.

Test: statsd test
Change-Id: I664e8d3b1a68960d05c9ce4789caefb60b1ab502
2018-02-27 15:31:57 -08:00
Yao Chen
8f42ba0e2c Avoid reading logs that were processed before.
This could happen when statsd is disconnected from logd reader. When we reconnect, we are going to
get all events from the buffer again.

Bug: 72379125
Test: manual
Change-Id: Ie0122d5452555500c3bdfc1f905a0b1c646efdf7
2018-02-27 15:17:07 -08:00
TreeHugger Robot
03b91d77c4 Merge "Alarm: wakes up statsd and notifies the subscribers." 2018-02-27 23:08:31 +00:00
TreeHugger Robot
82d7883f05 Merge "Return when invalid config ID was provided through adb command and change the separator of config_uid and config_id to underscore from dash to disambiguate negative config ids" 2018-02-27 23:07:27 +00:00
Tej Singh
dd7bd35f30 Atoms: Keygaurd and Bouncer
Logs changes in the state of the keyguard and the keyguard bouncer

Test: verified logs appear in adb logcat -b stats
Change-Id: I1ffdf72ab088318c883197b3e1eb283bec2b8b2a
2018-02-27 14:54:00 -08:00
Yao Chen
9b1140eecd Add the option to match a whitelist of strings in FieldValueMatcher.
+ This is useful when we want to build Anomaly detection on wakelocks, but want to whitelist
wakelocks held by some apps that are whitelisted. It reduces the number of matchers needed
in such a config.

+ Also added the ability to match an AID by string name.

Bug: 73897465
Test: unit tests added.
Change-Id: I19315ae4d7d27fc467655d3a29866049cd8c9a2b
2018-02-27 14:52:31 -08:00
Yangster-mac
932ececa16 Alarm: wakes up statsd and notifies the subscribers.
Test: manually tested it.
Change-Id: Id796a68976aeb1611183023ba4e9c6a8b8c44bb8
2018-02-27 13:30:48 -08:00
TreeHugger Robot
f3537c2054 Merge "Updates jank metrics in statsd to include uid." 2018-02-27 20:47:33 +00:00