785 Commits

Author SHA1 Message Date
Jack He
50b90a031d Merge "Atom: Update BluetoothConnectionStateChanged atom" am: 1ff7bdb095
am: 93c60d8e14

Change-Id: I042bde724451436ef0fa81e60e42b19a68ff138e
2019-01-17 15:36:47 -08:00
Jack He
610a8bffc0 Merge "Atom: Add BluetoothLinkLayerConnectionEvent atom" am: 9a6046bb3b
am: 6bb6b5b280

Change-Id: I3de2055961c34e661a28ad1d578980e088087c95
2019-01-17 15:21:25 -08:00
Jack He
22e4a1da50 Atom: Update BluetoothConnectionStateChanged atom
* Use salted hashed Bluetooth device identifier and deprecate old
  ofuscted_id
* Add BluetoothAclConnectionStateChanged and BluetoothScoConnectionStateChanged
  to track ACL and SCO connections

Bug: 112969790
Test: Bluetooth unit test, test drive with statsd
Change-Id: I5398e4caae751e1fe1d6a95fa3bc56d062eb6172
Merged-In: I5398e4caae751e1fe1d6a95fa3bc56d062eb6172
(cherry picked from commit d9837c8a9e9c91d9907ea10e67bf6c6581ba1b4b)
2019-01-16 16:11:45 -08:00
Jack He
522601435d Atom: Add BluetoothLinkLayerConnectionEvent atom
* Add this atom to report events related to Bluetooth link layer
  connection, including:
  - Obfuscated ID of remote device
  - Connection handle
  - Direction of the connection
  - Type of the connection
  - Associated HCI command and/or event
  - Status code associated with HCI command and/or event
  - Reason code associated with HCI command and/or event
* Add enum definitions for HCI commands and events as defined in the
  Bluetooth 5.0 specification
* Add enum definitions for link type and direction

Bug: 112969790
Test: make, test drive with statsd
Change-Id: I0fdc59274d49ad503e9ba9cf8f49c9d8872a4131
Merged-In: I0fdc59274d49ad503e9ba9cf8f49c9d8872a4131
(cherry picked from commit ab86dbd20cf17a1389d42135865eabfc4fc48604)
2019-01-16 11:51:20 -08:00
Chiachang Wang
6936b95677 merge conflicts of c564b6e118905cd6e5000215ddcd58266c57890a to pi-dev-plus-aosp
Test: Fix conflict as instruction
Bug: None
Change-Id: Iebce2651c795abd223c2df1ae5ddf168351d70ad
Merged-In: I96f74d938663d579e4fea1eee6a4a250d7e21b3a
2019-01-16 13:28:35 +08:00
Chiachang Wang
bcfa1bfe3d resolve merge conflicts of c564b6e118905cd6e5000215ddcd58266c57890a to pi-dev-plus-aosp
Test: Fix conflict as instruction
Bug: None
Change-Id: I315b2c0ab50d033588dce75e6976f5ccbb5bed29
Merged-In: I96f74d938663d579e4fea1eee6a4a250d7e21b3a
2019-01-16 11:14:27 +08:00
lifr
76e0bba86b resolve merge conflicts of 2b208601c2a454220e0d49be4ac607f45079a7a2 to pi-dev-plus-aosp
Test: I solemnly swear I tested this conflict resolution.
Bug: None
Change-Id: I57b03766b585bb38e657e772dc4d6c3ad69a5237
Merged-in: I4588cec0dea8a4c5a19847a32a6d53bfc5953be7
2019-01-15 17:53:02 +08:00
Chiachang Wang
67f2447feb Add data_stall_event.proto to atoms.proto
Test: Build pass
Bug: 120452078
Bug: 121185319
Change-Id: I5a428fb60d4c1eb4fe397426606e937f27eacbc3
Merged-In: I96f74d938663d579e4fea1eee6a4a250d7e21b3a
2019-01-15 15:14:00 +08:00
lifr
35a7cf0192 Define DNS statistic data atom in atoms.proto file
Test: run runtests.sh, make sure no missing test and get all pass
      run /out/host/linux-x86/bin/statsd_testdrive
      116
      Got following metric data dump:pass for local test
Bug: 119862317

Change-Id: I83ee8500fac7f443711ced097cbd376feb801ccf
Merged-in: I4588cec0dea8a4c5a19847a32a6d53bfc5953be7
2019-01-15 12:44:33 +08:00
Jim Blackler
905fc275df Merge "Add start time to LmkKillOccurred" am: 09c786a414
am: 5b37871e11

Change-Id: I78d822c5ede897d3a9798fd67ad5de591032db27
2019-01-09 05:18:18 -08:00
Jim Blackler
972a5c51f6 Add start time to LmkKillOccurred
To accompany Piper cl/222070329 and https://googleplex-android-review.git.corp.google.com/c/platform/system/core/+/5578724

Bug: 119854389
Test: Manual
Change-Id: Ib2af1b66d4649279fdcb97e7cdf8cdb92e361765
Merged-In: Ib2af1b66d4649279fdcb97e7cdf8cdb92e361765
(cherry picked from Ib2af1b66d4649279fdcb97e7cdf8cdb92e361765)
2019-01-04 11:36:41 +00:00
Chih-hung Hsieh
b51d2df568 Merge "Fix/suppress statsd google-explicit-constructor warnings" am: 699692402a
am: 32dc82a63a

Change-Id: I0dbf5428746a8e2bcf3413f65f8eefc2069741e6
2018-12-21 09:15:42 -08:00
Chih-Hung Hsieh
3227aabea6 Fix/suppress statsd google-explicit-constructor warnings
* Add explicit to conversion constructors/operators
* Remove redundant explicit of copy constructors

Bug: 28341362
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,google-explicit-constructor
Change-Id: Ifd0ca9a1afe4a2cb0456a36c69bee1633af5a93a
2018-12-20 15:17:33 -08:00
Chih-Hung Hsieh
2296036a40 Merge "Fix performance-for-range-copy warnings" am: bc29242288
am: 7adb73f332

Change-Id: I0ab1a28f5490f96bc8b08f073d364a01ff2f20df
2018-12-17 14:17:57 -08:00
Chih-Hung Hsieh
a1b644e88c Fix performance-for-range-copy warnings
Bug: 30413223
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,performance*
Change-Id: Ie481e88025a7a1f3abde8ff63420d5ccd8577e52
2018-12-17 20:00:55 +00:00
Yao Chen
d090104b51 Merge changes from topic "statsd-allow-bytes-type" am: 783ec04909
am: 393e1ba2e2

Change-Id: I2840072c4986cc0fb5ed4a79b0bfa7994bcc1448
2018-12-16 19:00:11 -08:00
Yao Chen
2822b4f42f Skip writing message field in an atom if it's empty
Test: unit test added
Bug: 120635548
Change-Id: I825b1ce526944a20fe65705508ad180ece37492c
Merged-In: I825b1ce526944a20fe65705508ad180ece37492c
(cherry picked from commit 8e6f9983009eadf32d05ad65e38906d3985bc9ba)
2018-12-15 13:52:27 -08:00
Yao Chen
046b51295e Adding tests and move launcher.proto
Test: statsd_test
Bug: 120635548
Change-Id: I0655f70098d78f8f6dc9381921c4a687d2195bd4
Merged-In: I0655f70098d78f8f6dc9381921c4a687d2195bd4
(cherry picked from commit 8c4338614513f59e53c2d7a164a05d309a470e81)
2018-12-15 13:52:06 -08:00
Hyunyoung Song
cc651c118e Add launcher.proto to atoms.proto
Test: blank
Bug: 113043444
Bug: 120635548
Change-Id: I7e0e72cdf68dcf195188dbab8fe2567fcbd5964e
Merged-In: I7e0e72cdf68dcf195188dbab8fe2567fcbd5964e
(cherry picked from commit c6d6b77ddc805d6e8f70ed16f0c73177840791e7)
2018-12-15 13:51:39 -08:00
Yao Chen
8b71c74894 Allow atoms to log fields in bytes format.
There are an increasing number of requests to log data in complex format to statsd, while the data
is not expected to be parsed or aggregated by statsd and only to be uploaded as events.

Instead of making an exception for each of these cases in a hard coded way, this CL add a feature to
annotate these field in atoms.proto and the stats-log-api-gen tool will produce byte array
interfaces for them.

Note that log_msg does not have byte array type, and only has string type, when statsd receives the
log, these fields are in string type. Only when the atom is written to proto, we will check if this
field should be bytes field and write it to protobuf in message format.

Change-Id: If53dd95c5826710c76d7fe982bf951a435dfc738
Merged-In: If53dd95c5826710c76d7fe982bf951a435dfc738
Fix: 118386797
Bug: 120635548
Test: unit test & manual test
(cherry picked from commit bbdd67d19f4912fbec00220b22e44c68eff5ab3f)
2018-12-15 13:51:08 -08:00
Misha Wagner
85980756b4 Merge "Fix issue in CpuTimePerUid where microseconds are used as milliseconds" am: 4314aef811
am: f7905eb419

Change-Id: I78470d6cc8e6e42adc50407f04b0294b9b1e159a
2018-11-27 06:42:53 -08:00
Misha Wagner
6bc6c91584 Fix issue in CpuTimePerUid where microseconds are used as milliseconds
KernelUidCpuTimeReader reads microseconds, but they are written to a
millisecond field in atoms.proto. Introduced in ag/3693225.

See google3 change: cl/222044203

Test: build
Bug: 119853118
Change-Id: I170e996aa852e28a246a98226677907bb3560371
2018-11-21 11:13:01 +00:00
Tej Singh
6752e11cdc Merge "Thermal shutdown fix: cool down on writing to disk" into pi-dev
am: 0cc63ef090

Change-Id: Ieb9fe51c3a729413a1aa7f0c044246eb1c7c836c
2018-11-09 14:41:26 -08:00
Tej Singh
42f9e06418 Thermal shutdown fix: cool down on writing to disk
Currently, statsd uses wall clock seconds to write data to disk. This
issue affects both thermal and normal shutdowns, because if two writes
occur in the same second, the more recent write will overwrite the older
write, erasing the actual data that we want.

For thermal shutdowns, we write twice. Once because of termination
signal received, and once because of binder death recipient from
statscompanion service.

For normal clean shutdowns, we write 3 times. In addition to the two
above, we write for the shutdown received signal.

This fix introduces a cool down period of 3 seconds between writing to
disk.

Bug: 112432890
Test: statsd unit tests
Test: statsd cts tests
Test: manually verified normal shutdown had 1 file written to disk
Test: manually verified thermal shutdown had 1 file written to disk
Change-Id: I4cd39de9063935e762ff7d00051ccc915f31e89a
2018-11-09 20:37:42 +00:00
Wei Wang
c2dcd92c33 Merge "Log the thermal throttling event to enable conditional temperature pulling." into pi-dev
am: e905bdb194

Change-Id: Iaa3d1aa70fcf7d1cb00f79986cfe0d6a6279c834
2018-11-07 15:26:53 -08:00
Wei Wang
e905bdb194 Merge "Log the thermal throttling event to enable conditional temperature pulling." into pi-dev 2018-11-07 22:51:12 +00:00
Jia-yi Chen
560055e29d Merge "Persist data to disk when system shuts down" into pi-dev
am: 29226627d0

Change-Id: I18a5f507f0e50d1212ee40573a3a6a687e5d0052
2018-11-06 16:52:37 -08:00
Colin Cross
054b0c0e06 Revert "Adapt to google::protobuf::uint64 type change"
This reverts commit fa6bc27df0820a362e0ceae7f9ea73e8a058fe47.

Change-Id: I9f778e6daa9ae0c6080016ab0bd1e6e414ae6061
2018-11-04 17:24:27 -08:00
Colin Cross
47046b80d2 Revert "Convert statsd_test and statsd_benchmark to proto lite"
This reverts commit e7908d7b624591c4cae55e66f5e603d061addd8f.

Change-Id: I585991ab1d5b35930bee6e32b82714aa11fbcb41
2018-11-04 17:24:26 -08:00
Colin Cross
fa6bc27df0 Adapt to google::protobuf::uint64 type change
Protobuf 3.5.2 redefines google::protobuf::uint64 from unsigned long
long to uint64_t, which is sometimes unsigned long and sometimes
unsigned long long.  Use PRIu64 to print it, and add an implementation
of ProtoOutputStream::write for long.

Bug: 117607748
Test: m checkbuild
Change-Id: I48912f58e2f63f4a98c3aefaa4f78cc2c719bb68
2018-11-02 11:35:48 -07:00
Colin Cross
e7908d7b62 Convert statsd_test and statsd_benchmark to proto lite
libplatformprotos for the device is compiled using proto lite, and
statsd_test and statsd_benchmark have protos that reference the
libplatformprotos.  With protobuf 3.5.2 compiling a full proto
against a lite proto doesn't work.  Convert them to lite.  Requires
adding the protobuf internal protos to the sources,
libprotobuf-cpp-lite does not contain the compiled version of
field_options.proto.

Bug: 117607748
Test: m checkbuild
Change-Id: I6a618c4118972c0e5ffb07a361ac6612b9069c5d
2018-11-02 11:35:48 -07:00
Colin Cross
05c9e5c24a Convert statsd and incidentd to Android.bp
See build/soong/README.md for more information.

Test: m checkbuild
Merged-In: I8c80878cec46c9299234c6f4c1e0e19efc0a221e
Change-Id: I8c80878cec46c9299234c6f4c1e0e19efc0a221e
2018-10-31 08:01:59 -07:00
Gopinath Elanchezhian
f469bd2f68 Merge "Add statsdprotolite in Android.bp" 2018-10-29 17:14:46 +00:00
gopinath
17593b0395 Add statsdprotolite in Android.bp
Bug: b/118482428

Test: make statsdprotolite
Change-Id: I5c27f3017be043b6809699158a94b32155163535
Merged-In: I857957e816506162496192fe0ad1da4dbdfd4efd
2018-10-26 23:16:39 +00:00
gopinath
9d426e141d allow statsd pull based on event trigger.
Bug: b/118482428

Test: make statsdprotolite
Change-Id: I5a40d5e6a409b65ca1639029d5da83c327ed1798
Merged-In: Ia15b1f209945f022edffb9ec5d673317d55d9e4f
2018-10-26 22:22:51 +00:00
Yangster-mac
80c4474a7b Log the thermal throttling event to enable conditional temperature pulling.
Test: statsd test

BUG: b/112432890

Change-Id: Ic0b175053ec6afe497eb67a31d3e1a7633df4c5b
Merged-in: If132bab9690043a9e3e89187dfb1a9ed8fd0c996
(cherry picked from commit e16189afcaa55d8480d658bfb0c6bd304f3c238d)
2018-10-26 20:03:07 +00:00
Yang Lu
658bc0e04f Persist data to disk when system shuts down
This is a cherry-pick from master to pi-dev.

Test: local test

BUG: b/112432890
Change-Id: Ie360f5c8df53d3b5b04f23df43ab8dc14b69ae26
Merged-In: Iaed318671a719cc366d4e6be9f77270147ba6596
2018-10-19 20:45:26 +00:00
Chih-Hung Hsieh
6c5b82f7c5 Fix implicit fallthrough warnings.
Test: make checkbuild
Bug: 112564944
Change-Id: Ia33bf816fb6b179ac0a5a6a20bcb50c11b47431d
2018-10-12 15:05:01 -07:00
Yangster
4ccebeadc7 Phone service state change atom.
Background: BatteryStatsService tracks the phone scanning time metric. In Q,
we are migrating the dumpsys-based collection to the new infra. This CL is to
instrument the new logging mechanism.

Test: statsd test
FIX: b/116748990

Change-Id: I3cf5e0026bfc6f594c5f7b524f14b3a43b702afb
2018-10-10 19:45:10 +00:00
Treehugger Robot
34bd3dfb39 Merge "statsd: Add AID mappings for iorapd" 2018-10-08 20:12:59 +00:00
Igor Murashkin
12bb16c955 statsd: Add AID mappings for iorapd
Bug: 117295673
Change-Id: Ie0c7a7bf823159492259ac1ec6680b45784afb84
2018-10-05 16:25:21 -07:00
Treehugger Robot
4593c78168 Merge "statsd: Add missing AIDs to UidMap" 2018-10-05 16:52:11 +00:00
Igor Murashkin
a1980ae12a statsd: Add missing AIDs to UidMap
Change-Id: I29f52727d344755a0c465105eb3a2c81b2bec700
2018-10-04 14:30:48 -07:00
Treehugger Robot
824f940195 Merge "Statsd atoms: restrict OEM fields 100000-199999" 2018-09-21 03:00:33 +00:00
Bookatz
76aafcfbea Statsd atoms: restrict OEM fields 100000-199999
The current wording seems to suggest allocating an infinite number of
fields, which is not future-proof.

Bug: 72866543
Test: N/A
Change-Id: I88732ea8695521a39f20524348547cfe50cbf776
2018-09-18 10:40:43 -07:00
Bookatz
ae6738ed2a Unifying source of statsd BleScan calls and cleaning it up.
Bug: 80308558
Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases
Change-Id: I0b4a0b56631b4354b73f0fafea2c0dc7dff248d1
2018-09-13 18:48:10 +00:00
Josh Gao
3330d1208f statsd: fix double close.
Previously, fdopen was being called on a file descriptor that was owned
by a unique_fd without releasing. This leads to a double close, since
both fclose and the unique_fd destructor will try to close the fd.

Bug: http://b/113880863
Test: treehugger
Change-Id: I6f6f48d304861b5e4d7efee0d3ad0e30178a95a4
2018-09-04 11:12:04 -07:00
Yao Chen
38b92986df Merge "Disable statsd and make StatsLog no-op if ro.statsd.enable=false" into pi-dev 2018-06-07 21:10:16 +00:00
Yao Chen
cf3829a696 Disable statsd and make StatsLog no-op if ro.statsd.enable=false
Bug: 79324611
Test: manually tested on marlin_svelte
Change-Id: Ic7fbf86d7c295cb6b2f20e7f9a957d1ed74c42c0
2018-06-06 17:25:08 -07:00
Yangster-mac
1c58f04cd3 Add a field in config to disable/enable the string hashing in metric report.
Statsd hashes (using its own hashing function) raw strings to reduce the
upload data size when there are duplicate strings in the report. And in cloud,
the clearcut translator would backfill the strings.

In a few droidfood users, we find the translator was unable to do that. While
debugging the root cause, we first decided to provide an option to disable
the hashing from the cloud.

Test: statsd unit test, CTS test, tested manually

BUG: b/79943763
Change-Id: If0359c8cf3f3cf83a2938db9ebf95ea7906f0b0c
2018-05-18 10:39:50 -07:00