Commit Graph

2889 Commits

Author SHA1 Message Date
Yi Jin
f3e800a216 Merge "Use uint64_t instead of long long as API type for consistent reason." into pi-dev am: 88840820d0
am: db8bc9ba01

Change-Id: If83ee0aa6477700b4245af9fd16fc94decaa5e97
2018-03-06 22:28:45 +00:00
TreeHugger Robot
554f8157f4 Merge "Atom: ResourceConfigurationChanged" 2018-03-06 17:15:02 +00:00
TreeHugger Robot
00cbd158f8 Merge "Refactor cpu stats pullers" 2018-03-06 03:26:26 +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
Tej Singh
8a6df9290f 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
2018-03-05 16:27:08 -08:00
Chenjie Yu
f248047d74 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
Fix: 73745189
Fix: 73780619
Fix: 73360959

Change-Id: I10a9bc91ca67fa812f4cd71c4fbd73c1a5ba580e
2018-03-05 15:47:39 -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
Kweku Adams
391284396b Add incidentd to readproc group.
This allows it to get cpu info and ps data.

Bug: 72384374
Test: flash device and check incident.proto output
Change-Id: I09f6318861fbedbf4fae1a4325e6a7d12b32b10e
2018-02-27 12:26:13 -08:00
Yi Jin
1a11fa1097 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
2018-02-27 11:36:29 -08:00
yro
255f72e73e 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

Bug: 73896814
Test: statsd_test
Change-Id: Ib0604e9f4c104560d570a64208a9e94d7526f8d6
2018-02-27 10:49:21 -08:00
TreeHugger Robot
dcd6ae8bc8 Merge "Atom: TemperatureReported" 2018-02-27 07:00:45 +00:00
Tej Singh
4029831e36 Atom: TemperatureReported
Makes the temperature reported atom pulled, and adds CPU, GPU, and SKIN
temperatures. Pulls information from the thermal hal.

Test: CTS test on cl in this topic
Change-Id: I0a8e2d1135bdd77e1cc510f24ff5214ce9e14ead
2018-02-26 20:55:26 -08:00
David Chen
77ef671c41 Updates jank metrics in statsd to include uid.
We need the uid to easily know which app to blame for producing the
frame with excessively long render time. Also updates the errors so
it's more obvious if the error is in parsing versus the other checks.

Test: Test that statsd builds and verified CTS test still passes.
Change-Id: Ib6518f2d9fe6f9c78d548b6dcbdb67a0f211ff5c
2018-02-26 17:18:20 -08:00
TreeHugger Robot
c4534e93e6 Merge "Fixes timebase used when dumping reports." 2018-02-26 23:18:57 +00:00
TreeHugger Robot
3b3d38d996 Merge "Avoid creating temporary objects in FiterValue()." 2018-02-24 10:13:19 +00:00
Yangster-mac
f520492279 Avoid creating temporary objects in FiterValue().
It reduces the cpu time from 1000ns to 750ns

Test: statsd test.
Change-Id: Ifa7e98e3368f8d55f85c7b09d05a6c416482981d
2018-02-23 20:53:23 -08:00
Steven Moreland
fb7952f57e Don't use cutils/Atomic.h
Test: builds
Change-Id: I74485a5cbecb8710714f7bf3e54da61dd787838f
2018-02-23 15:02:42 -08:00
David Chen
926fc7571a Fixes timebase used when dumping reports.
We should be using elapsed realtime for most timestamps in statsd
so that the times can only increase monotonically.

Test: Test that statsd builds and unit-tests passes.
Change-Id: I0bb23e89aa9a6dbf6d56a0c23eec77bdd053f29b
2018-02-23 14:36:06 -08:00
TreeHugger Robot
7509bb3f97 Merge "Use android reinterpret hash for float as it is faster." 2018-02-23 21:20:20 +00:00