Commit Graph

2174 Commits

Author SHA1 Message Date
TreeHugger Robot
0121af6189 Merge "Merge multiple eventMetricData entries into a single StatsLogReport when writing to dropbox" 2017-09-25 16:56:08 +00:00
Derek Sollenberger
71b36912e0 Merge "Reduce overhead by combining libskia and libhwui into a single library." 2017-09-25 15:45:34 +00:00
yro
fbeb4cb3af Merge multiple eventMetricData entries into a single StatsLogReport
when writing to dropbox

Test: manual test.

Change-Id: I8ce323002ae1cad62703ece92bd99a5058b16fba
2017-09-24 22:42:44 -07:00
Yao Chen
3f0c1f2368 Fix a timestamp bug.
Test: manual
Change-Id: I8067fa8029c0b5702cae09202f8f9f7e443e902d
2017-09-22 21:25:11 -07:00
Yao Chen
ef99c4fa23 clang-format existing code in statsd.
Added .clang-format, because there isn't an official .clang-format file for Android framework code.

before we upload changes, do:

clang-format -style=file -i [file list]

to format the files that you touched.

Test: formatting only. NO code changes.
Change-Id: I90e87f1ee6618da8ea9bc2221c609c415a4046a8
2017-09-22 16:26:54 -07:00
TreeHugger Robot
4a2fed98c5 Merge "Add missing key for temporary battery process event and missing tag id for process Test: tested locally" 2017-09-21 09:03:05 +00:00
yro
a5c807ae80 Add timestamp pair to stats log
Test: tested locally

Change-Id: I70dfb0856c8410d55ea9cc6eaf1377961139ecd8
2017-09-21 00:06:46 -07:00
yro
e03583e261 Add missing key for temporary battery process event and missing tag id
for process
Test: tested locally

Change-Id: I1ef376ba9478e1e88ff09fb201078d4972d8d51b
2017-09-20 23:34:46 -07:00
Bookatz
906a35c814 Statsd namespace is defined and used
Statsd code now lives in android::os::statsd namespace. Existing files
are largely modified to follow this convention.

Exception: parse_util, since it seems a bit different.

Test: code compiles and existing statsd_tests still pass
Change-Id: Idf92a071b9ed172d01eb3087a4fa3609d67a038c
2017-09-20 16:58:14 -07:00
TreeHugger Robot
e63e6fc643 Merge "statsd & statscompanion communication more robust" 2017-09-20 23:11:13 +00:00
Bookatz
b487b5533e statsd & statscompanion communication more robust
If statsd or statsdcompanion crashes, or if one loads
before the other, the other will be able to accomodate.

When statsd loads, it will attempt to tell statscompanion that it's
alive, and then get on to its business, while assuming that
statscompanion is not alive. Only when statscompanion tells statsd
that it is alive, statsd will then start to use it.

When statscompanion loads, it will attempt to tell statsd that it's
alive and then do nothing (since it has nothing to do). When statsd
tells statscompanion that statsd is alive, statscompanion will respond,
telling statsd that it is alive and, if that binder call returns, will
get to work.

This way, if statsd loads first, it can work unobstructed until
statscompanion informs statsd that it is alive, at which point they
shake hands and work. Conversely, if statscompanion loads first, it will
do nothing until statsd contacts it, at which point they will shake
hands and work.

Test: manual
Change-Id: I969ad47fb8060e27814d05ad37433a02711cfa6a
2017-09-20 14:13:44 -07:00
TreeHugger Robot
8f24283631 Merge "StatsCompanionService sends messages to statsd" 2017-09-20 21:13:07 +00:00
TreeHugger Robot
45a1064bb7 Merge "incidentd: fix memory leaks in a test" 2017-09-20 20:47:06 +00:00
Bookatz
1b0b114abc StatsCompanionService sends messages to statsd
StatsCompanionService can now inform statsd that an alarm (for anomaly
alerting and for polling) has fired, so that statsd can act accordingly.

Test: manual created an alarm from statsd.main and checked logcat that
statsd received the broadcast that it fired
Change-Id: I1d33dfbee0d3e213c91dd6973d2622ecacc890c8
2017-09-20 07:51:53 -07:00
Adam Bookatz
43b272e20c Merge changes I82fe220e,Iff324c73,I3bd73acd
* changes:
  indexed priority queue for AnomalyMonitor
  StatsCompanionService connection to Statsd
  Set up StatsCompanionService.java
2017-09-20 14:01:49 +00:00
George Burgess IV
bbe04e87e9 incidentd: fix memory leaks in a test
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
2017-09-19 16:42:01 -07:00
TreeHugger Robot
148f5074bb Merge "Translate Android log entries to stats_log proto Test: tested on local device" 2017-09-19 08:14:55 +00:00
yro
00698daf3c Translate Android log entries to stats_log proto
Test: tested on local device

Change-Id: If9a779a96d31cefaffb1e4424629c14b08e1fc57
2017-09-18 23:30:14 -07:00
Steven Moreland
7633c50c2b Merge "Remove unused variable from screencap." am: 376234fc74 am: 32bdb1e9b0 am: 0fcb7719e0
am: 2aea4cae01

Change-Id: I2eb8b57458721a1b78766552cb5a12c284b291e7
2017-09-19 03:40:31 +00:00
Steven Moreland
2aea4cae01 Merge "Remove unused variable from screencap." am: 376234fc74 am: 32bdb1e9b0
am: 0fcb7719e0

Change-Id: I6aebd6df0bf9734e1567db31d31bfe85609cbb48
2017-09-19 03:35:00 +00:00
Steven Moreland
32bdb1e9b0 Merge "Remove unused variable from screencap."
am: 376234fc74

Change-Id: I5afb38c24ab6924925ab2852c5fe0ef29a91a2ff
2017-09-19 03:22:42 +00:00
Treehugger Robot
376234fc74 Merge "Remove unused variable from screencap." 2017-09-19 03:12:18 +00:00
Philip P. Moltmann
80e8e399d0 Use 1MB buffer for install cmds
Similar to Package Installer App. This reduces the overhead of each
chunk and slighly speeds up package installation.

Test: Installed app via 'adb install' and 'adb shell pm install'
Change-Id: Ic8f67087e578bf0696e3d55ad3d7f3892ca2bf90
2017-09-18 09:36:29 -07:00
TreeHugger Robot
d166b03505 Merge "Adding ability to add configs via adb command-line. The input must be in serialized binary format. Also fixes small issue in build rule related to proto lib." 2017-09-16 00:22:29 +00:00
Jeff Sharkey
76ffccc044 Merge "Move long-running calls to async with listeners." 2017-09-15 22:46:00 +00:00
David Chen
0656b7a158 Adding ability to add configs via adb command-line. The input
must be in serialized binary format. Also fixes small issue
in build rule related to proto lib.

Test: Manually tested that ADB command works without crashing.

Change-Id: Iba2e677561ff500adb601a598f73e8a7b32540e5
2017-09-15 14:07:52 -07:00
Jeff Sharkey
b302c54f11 Move long-running calls to async with listeners.
Now that we're using Binder, we can have callers provide explicit
listeners for every request instead of trying to squeeze them all
into unsolicited socket events.

Move benchmarking to be async to avoid blocking other commands for
up to several minutes.  Remove post-trim benchmarking flag, since
benchmarking now requires a separate callback.  Will bring back in
a future CL.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Test: adb shell sm fstrim
Bug: 62201209, 13758960
Change-Id: I26f76c66734ac2fd0f64713b8ab9828430499019
2017-09-15 14:19:46 -06:00
Max Bires
2eba753d38 Merge "Adding extra rc commands to fix incidentd with respect to selinux" 2017-09-15 15:56:11 +00:00
Max Bires
e6b224920e Adding extra rc commands to fix incidentd with respect to selinux
Incidentd has sepolicy rules to allow it to write to
/data/misc/incidents/ but it needs the directory to already be created.
This modification will set the service to be UID/GID system and create
the directory under system permissions.

Test: no selinux denials related to incidentd on bootup
Bug: 64275854
Change-Id: I0f4db90f4eeb6dae5019e5bc1df590bd781a9507
2017-09-14 23:26:55 +00:00
Yi Jin
757c659160 Merge "Implement PageTypeInfo section" 2017-09-14 21:43:10 +00:00
Bookatz
0e95909ef0 indexed priority queue for AnomalyMonitor
Created a new class, indexed_priority_queue, which is a priority queue
that allows the removal of elements (other than just the top element).
This is required for AnomalyMonitor, which will henceforth use it.

Some tests for this new class are included.

I have only implemented the methods in indexed_priority_queue that are
currently needed. For example, pop_top() has not been written as
AnomalyMonitor does not need it.

Test: adb shell data/nativetest64/statsd_test/statsd_test
Change-Id: I82fe220ee5a879189b0cfa03b551c829cfdd05f0
2017-09-14 13:04:45 -07:00
Bookatz
486d1cf358 StatsCompanionService connection to Statsd
Created AnomalyMonitor in statsd, which can monitor statsd's internal
anomaly alarms and register the soonest one with the
StatsCompanionService.

This cl introduces the AnomalyMonitor and allows it to register alarms.
It does not yet allow for the removal of internal alarms.

Test: manually added alarms and ensured they were correctly registered
in StatsCompanionService
Change-Id: Iff324c73751c4f43b1507dc64649b50ac388adef
2017-09-14 12:56:59 -07:00
Yi Jin
810b14f5c2 Implement PageTypeInfo section
Bug: 65560369
Test: unit tests written, manually tested in incident_report tool
Change-Id: Ibb588fe3affc9675db4cfc2835eea31d1bbb701b
2017-09-14 11:47:44 -07:00
Yi Jin
e44481f7e0 Merge "Fixes regarding to comments in ag/2839267" 2017-09-14 17:23:48 +00:00
Bernardo Rufino
0ede3a0a9b Merge "Add logs to IOExceptions during adb backup" into oc-mr1-dev
am: 786354a53f

Change-Id: I21dc3f5523632306f69e9f8d0f99072f52742f85
2017-09-14 15:28:59 +00:00
TreeHugger Robot
8e7418509d Merge changes from topic "dropbox"
* changes:
  Add a cmd line tool to StatsService to parse log files from Dropbox
  Add a DropboxWriter in statsd.
2017-09-14 03:41:38 +00:00
Yao Chen
482d272d7c Add a cmd line tool to StatsService to parse log files from Dropbox
Test: adb shell cmd stats all-logs
Change-Id: I7803c9c021a971619f60fbf6bdfabd33d2f476ef
2017-09-13 16:58:41 -07:00
Yao Chen
ab273e2e13 Add a DropboxWriter in statsd.
+ The DropboxWriter keeps data in cache, and flush to files once the
  size exceeds the maximum value.

+ Different components should create their owner DropboxWriter with
  different tags, e.g., anomly detection, experiment metrics, etc.

+ Copied stats_log related protos from g3

Test: run statsd, and adb shell dumpsys dropbox
      Will add unit tests.

Change-Id: If06e9a9953be32082252b340a97124d732656b40
2017-09-13 16:58:40 -07:00
Yi Jin
7e0b4e5880 Fixes regarding to comments in ag/2839267
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
2017-09-13 14:32:42 -07:00
TreeHugger Robot
f18c6ffae8 Merge "Add logs to IOExceptions during adb backup" 2017-09-13 14:59:28 +00:00
Bernardo Rufino
628fee52b1 Add logs to IOExceptions during adb backup
Test: Run adb backup
Bug: 65435587
Change-Id: I744cb2878654b716858d7c9bedeb12fb9978df6b
2017-09-13 13:58:38 +00:00
Bernardo Rufino
5176c02501 Add logs to IOExceptions during adb backup
Test: Run adb backup
Bug: 65435587
Change-Id: I744cb2878654b716858d7c9bedeb12fb9978df6b
2017-09-13 14:10:20 +01:00
Yi Jin
4518ea94fd Merge changes Icdcbeded,I6753df11
* changes:
  Extract IncidentHeaderProto to a separated file for statsd to consume
  Implement Pii Stripper Part 3
2017-09-12 21:40:31 +00:00
Yi Jin
a425dc36e8 Merge "Implement PII Stripper, part 2" 2017-09-12 21:35:19 +00:00
Dan Willemsen
116abe23c4 Merge changes I93cf24d4,I32e438ef am: 30798ad13a am: c28d591b36 am: 59225490b8
am: 2e9ec5f0de

Change-Id: Ie590c34bce9d0218bb9b48294756dae04e9210b7
2017-09-10 02:15:34 +00:00
Dan Willemsen
2e9ec5f0de Merge changes I93cf24d4,I32e438ef am: 30798ad13a am: c28d591b36
am: 59225490b8

Change-Id: I6cf57e951900b3df816070feee0d3bf92a6a5a7d
2017-09-10 02:05:05 +00:00
Dan Willemsen
c28d591b36 Merge changes I93cf24d4,I32e438ef
am: 30798ad13a

Change-Id: I0b178c8523d0c5829d731f6ed05cfa3fe89ad9b4
2017-09-10 01:44:06 +00:00
Treehugger Robot
30798ad13a Merge changes I93cf24d4,I32e438ef
* changes:
  Convert host tools to Android.bp
  Rename aapt_defaults to aapt2_defaults
2017-09-10 01:29:21 +00:00
Dan Willemsen
c80623a641 Merge "Convert libhidcommand_jni to Android.bp" into stage-aosp-master am: a97f4d4ac3 am: 21d5fdbbce
am: f1ae466af8

Change-Id: I5a1c6df3f934706753f72718b2ca5d37add84ca3
2017-09-09 19:53:11 +00:00
Dan Willemsen
f1ae466af8 Merge "Convert libhidcommand_jni to Android.bp" into stage-aosp-master am: a97f4d4ac3
am: 21d5fdbbce

Change-Id: I7d2ca2f6c9b9c8522510d4e7ac1d9ded0167b38b
2017-09-09 19:43:54 +00:00