Commit Graph

5812 Commits

Author SHA1 Message Date
Ruchir Rastogi
41fc690e46 Merge "Handle errors within LogEvent" into rvc-dev am: 3360c54cd6 am: 24f5a0dcc8
Change-Id: I18541b9ef7d8ce87c442625d981761b483417e30
2020-04-21 17:25:38 +00:00
Ruchir Rastogi
23b807a864 Merge "Move resetState from FieldValue to LogEvent" into rvc-dev am: b639065e0a am: f57c9ccf95
Change-Id: I6f3927fa4e190236fba7a89a8fa40a2253de672b
2020-04-21 17:24:08 +00:00
Ruchir Rastogi
3360c54cd6 Merge "Handle errors within LogEvent" into rvc-dev 2020-04-21 17:07:18 +00:00
Ruchir Rastogi
b639065e0a Merge "Move resetState from FieldValue to LogEvent" into rvc-dev 2020-04-21 16:53:13 +00:00
Ruchir Rastogi
48dbf835ce Move resetState from FieldValue to LogEvent
This helps save memory because FieldValues are copied around much more
than LogEvents.

+ removed unused variables from LogEvent

Test: bit statsd_test:*
Bug: 154267590
Change-Id: If444ef79c85a45526fce183b67d9d8a2e74fa10d
2020-04-20 17:43:56 -07:00
TreeHugger Robot
5863643d83 Merge "Stop socket listener when terminating by SIGTERM" into rvc-dev am: 386cdc2c44
Change-Id: Id78f130c08c58e5a0fb5500f4b7cb3cd56dd6507
2020-04-21 00:07:30 +00:00
TreeHugger Robot
386cdc2c44 Merge "Stop socket listener when terminating by SIGTERM" into rvc-dev 2020-04-20 23:50:50 +00:00
Martin Stjernholm
0aefbc7347 Merge "Move libsigchain version scripts to app_process, where they are used." am: 73912d5c23 am: 3414cff943
Change-Id: Ib540cba204f53ed5a26a3136b9b957b56cdf4fa9
2020-04-20 20:21:46 +00:00
Martin Stjernholm
3414cff943 Merge "Move libsigchain version scripts to app_process, where they are used." am: 73912d5c23
Change-Id: I0b8323b2794bc0b734f5d1eb395c6013775df55c
2020-04-20 19:59:12 +00:00
TreeHugger Robot
4f56c7df3a Merge "Fixed a typo" into rvc-dev am: 9e48995431
Change-Id: Iee3de991e95e6cf0dacbaa3e7636e8f9a9f6682b
2020-04-20 18:56:35 +00:00
TreeHugger Robot
9e48995431 Merge "Fixed a typo" into rvc-dev 2020-04-20 18:37:32 +00:00
Jiyong Park
fe22da569d Merge "Mark some aidl_interface modules as unstable" into rvc-dev am: 28665792a2
Change-Id: I87f2b5384ad7f82374597a75de4595e380564e55
2020-04-20 05:23:12 +00:00
Jiyong Park
28665792a2 Merge "Mark some aidl_interface modules as unstable" into rvc-dev 2020-04-20 03:23:06 +00:00
Ruchir Rastogi
07f7adb47e Handle errors within LogEvent
Errors are recorded within StatsdStats. The associated CL to change
stats_log.proto within google3 is at cr/306795778.

Test: adb shell dumpsys stats --metadata
Test: bit statsd_test:*
Bug: 144373276
Change-Id: Id80cace9350f77d64a2d401f7fac7b12501e82ee
2020-04-19 14:42:02 -07:00
Muhammad Qureshi
b7cee13a26 Merge "Remove kMaxPushedAtomId from atoms_info." into rvc-dev am: e3ef95cf13
Change-Id: Iff16f161dccbe653331d378660730a268c6c50fb
2020-04-18 00:24:01 +00:00
TreeHugger Robot
bb03100de8 Merge "Fix statsd_test mts build target" into rvc-dev am: 5aef02fd4a
Change-Id: I55277beeae8e2fd22dcf1933e1cd41b0470332cb
2020-04-18 00:23:37 +00:00
Muhammad Qureshi
e3ef95cf13 Merge "Remove kMaxPushedAtomId from atoms_info." into rvc-dev 2020-04-18 00:13:52 +00:00
TreeHugger Robot
5aef02fd4a Merge "Fix statsd_test mts build target" into rvc-dev 2020-04-18 00:11:18 +00:00
Eric Jeong
0963dbd07d Stop socket listener when terminating by SIGTERM
- During the termination, StatsService is stopped while
StatsSocketListener is still running.
- This could cause invalid thread access.

Bug: 147316537
Test: Run a test app which keeps sending StatsLog and repeatedly execute
adb shell su root kill `pidof statsd`. statsd should not crash.

Change-Id: Iedd2dcb892f704bdba9adc864afa696de64b8e4c
2020-04-17 16:50:05 -07:00
Jeffrey Huang
9c30a95f5a Fix statsd_test mts build target
The test tried to execute statsd_test when the binary was named
statsd_test32. This fixes the naming issue.

Bug: 153035538
Test: make mts and check the binary name
Change-Id: I13485a95801f9ef71211cd1d36e8ea1fd3bbc0b6
2020-04-17 15:35:33 -07:00
Dichen Zhang
d9aaa5bac4 Fixed a typo
"am broadcast -a" rather than "am broadcast am"
Bug: 123230379
Test: commands #4 and #5 in bug report

Change-Id: I5c23cd86b4da1e03b65c9a68a3a9044466012e89
2020-04-17 17:22:28 +00:00
Muhammad Qureshi
3429cb905d Merge "Remove kAtomsWithAttributionChain from atoms_info" into rvc-dev am: 9a89a81625
Change-Id: Id2b3cef4e6e7575a3ca2bf7fe024981aacdbce3a
2020-04-17 17:22:18 +00:00
Muhammad Qureshi
cdf291d297 Remove kMaxPushedAtomId from atoms_info.
Hardcode kMaxPushedAtomId in StatsdStats.

Bug: 154164020
Test: bit statsd_test:*
Change-Id: Ibca731d9783686a9e3caf0ad580e1d62038d68e2
2020-04-17 10:10:17 -07:00
Muhammad Qureshi
7fee54bb27 Remove kAtomsWithAttributionChain from atoms_info
Use LogEvent::getAttributionChainIndex() to check presence of
attribution chains

Bug: 150414252
Test: bit statsd_test:*
Change-Id: Ic798d3b182c2b5aaf73444f2796d539cd3f7bf40
2020-04-16 21:51:44 -07:00
Martin Stjernholm
c7c462af25 Move libsigchain version scripts to app_process, where they are used.
This is a temporary measure to avoid exporting filegroups in the SDK
snapshots. The version scripts will go away when libsigchain can be a
shared lib.

Test: Build and boot
Bug: 153338107
Bug: 142944043
Change-Id: Id7bff041413569342cc5dcaeff144287b2ae1ef9
2020-04-17 00:03:41 +01:00
Ruchir Rastogi
492edf7bf8 Merge "ShellSubscriber: install SIGPIPE handler" into rvc-dev am: 9d411d7d8e
Change-Id: Ibd8b5dff1f23cf482a41ed943f6a93de2eee77dc
2020-04-16 17:52:22 +00:00
Ruchir Rastogi
9d411d7d8e Merge "ShellSubscriber: install SIGPIPE handler" into rvc-dev 2020-04-16 17:34:16 +00:00
TreeHugger Robot
53b2ec6704 Merge "Add statsd device tests as mts target" into rvc-dev am: 702537c7ab
Change-Id: I95d5180f0c8f315cf31a4f7c228e6f8f217d6e24
2020-04-16 17:13:33 +00:00
TreeHugger Robot
702537c7ab Merge "Add statsd device tests as mts target" into rvc-dev 2020-04-16 16:59:32 +00:00
TreeHugger Robot
d6bf3844aa Merge "Remove kTruncatingTimestampAtomBlackList" into rvc-dev am: cbd9f03e82
Change-Id: If2cf3789d97b582f354a619fedc955f7fe602b5c
2020-04-16 13:17:31 +00:00
Muhammad Qureshi
c5e48b53b3 Merge "Remove kStateAtomsInfo from atoms_info." into rvc-dev am: 1f976bf634
Change-Id: Idcb6b9e407c99d76579ce8184df800f4fd9cb575
2020-04-16 13:16:50 +00:00
TreeHugger Robot
cbd9f03e82 Merge "Remove kTruncatingTimestampAtomBlackList" into rvc-dev 2020-04-16 13:07:00 +00:00
Muhammad Qureshi
1f976bf634 Merge "Remove kStateAtomsInfo from atoms_info." into rvc-dev 2020-04-16 13:01:52 +00:00
Orion Hodson
18f7afccb6 Merge "Add explicit dependencies on jni_headers" am: c0fe0ae29f am: 6963d8e1c8
Change-Id: I2fdf3826653466d65e3d63fa896d1ec23c5716cd
2020-04-16 10:58:50 +00:00
Orion Hodson
6963d8e1c8 Merge "Add explicit dependencies on jni_headers" am: c0fe0ae29f
Change-Id: I8c84a9de389c0f82c307d835344038373d75f61a
2020-04-16 10:45:48 +00:00
Orion Hodson
63f06b738d Add explicit dependencies on jni_headers
Preparation for removing implicit include paths for jni.h from soong.

Also remove unnecessary jni.h includes from PathParser.{h,cpp}.

Bug: 152482542
Test: lunch aosp_x86_64 && m checkbuild
Change-Id: Ib18afa3d2c93ed3ce69204286d5177991100fd7e
Exempt-From-Owner-Approval: build refactoring
2020-04-16 08:26:14 +00:00
Jeffrey Huang
c6b2830e81 Add statsd device tests as mts target
Added multilib to cc_test as a workaround to the build system being
unable to separate 32 and 64bit architectures.

Bug: 153035538
Test: m -j
Change-Id: Ib7f3b01816d7cbd69b3dbf4dbf63ccb22b0c5b6a
2020-04-15 16:06:40 -07:00
Muhammad Qureshi
a7de00022b Remove kTruncatingTimestampAtomBlackList
Use shouldTruncateTimestamp flag in LogEvent instead of the blacklist
to determine whether timestamp should be truncated.

Bug: 150414373
Test: bit statsd_test:*
Change-Id: I4e21ae4909484dd898b9fcd3ce7a018f5e9d982f
2020-04-15 11:34:35 -07:00
TreeHugger Robot
0afed20e84 Merge "Add new atoms to track user journeys, such as user switches." into rvc-dev am: 58df220212
Change-Id: I16ca5df6fd9622134b6558dc57507775c058872b
2020-04-15 17:17:20 +00:00
TreeHugger Robot
76921f8385 Merge "Add NamedLatch to statsd" into rvc-dev am: 259e20acec
Change-Id: I94fed053d5d785413989d532fd7f60a8adde4320
2020-04-15 17:02:05 +00:00
TreeHugger Robot
58df220212 Merge "Add new atoms to track user journeys, such as user switches." into rvc-dev 2020-04-15 03:31:00 +00:00
TreeHugger Robot
259e20acec Merge "Add NamedLatch to statsd" into rvc-dev 2020-04-15 02:15:26 +00:00
Muhammad Qureshi
bfc4bdb594 Remove kStateAtomsInfo from atoms_info.
Use the annotation information in LogEvent/FieldValue instead.

- Initialize nested to true in FieldValue.mAnnotations

- Add filterPrimaryKey function to HashableDimensionKey for populating a
HashableDimensionKey with all FieldValues that have the primary key
annotation set.

- Create StateTrackers without checking if atom is a state atom. (We
  can't do this check anymore)

- Remove mAtomId, mStateField, mNested, mPrimaryFields, mDefaultState,
    mResetState members from StateTracker. Use the information passed in
    LogEvent in onLogEvent instead.

- Update tests to log annotations when logging events.

- Remote kStateAtomsFieldOptions from atoms_info.

- Make MetricProducer::mStateGroupMap const

- Rename handlePartialReset to clearStateForPrimaryKey

- Store "default" states in mStateMap. An entry in mStateMap means the
state is not kStateUnknown. Before, an entry in mStateMap meant the
state is not the "default" state.

- Consolidate all state change logic in updateStateForPrimaryKey()
    - remote StateTracker::updateState
    - handleReset and clearStateForPrimaryKey call
    updateStateForPrimaryKey for resetting and clearing of states
    respectively.

- Create a helper method for notifying StateTracker listeners

- Make StateManager::registerListener void

Bug: 151110842
Test: bit statsd_test:*
Change-Id: Ifb8371b213a178fcccaa484086fbdd283dbaec49
2020-04-14 17:22:15 -07:00
Tej Singh
769f35fc0f Add NamedLatch to statsd
This is a sychronizing primitive that is similar to a latch, but a
thread must count down with an identifier. It will be used to make sure
the boot complete, uid map, and all pullers signals are received before
triggering the bucket split.

The latch's countDown operation takes in a string identifier, so that if
the same operation happens twice, it is only counted once.

Bug: 144099206
Test: atest statsd_test

Change-Id: I261a3e50eabbc4998ca30ddf2d67a9a1e788911e
2020-04-14 16:50:12 -07:00
Varun Shah
acb5634dc4 Add new atoms to track user journeys, such as user switches.
Define new atoms to better log and understand various user journeys,
such as user switches, user starts, and user creation.

The UserLifecycleJourneyReported atom defines a user's journey and
holds a user's information such as their user id, user type, and flags
associated with the user. This atom includes a session-id which is used
to link to the UserLifecycleEventOccurred atom which keeps track of
lifycycle events that occur throughout a user's journey. As more user
journeys are defined, there could be more Events added in the future.

Note: the JourneyReported atom can currently be logged more than once
per user journey since there is no record of the user's ongoing journey.
This will be updated in a future CL.

Bug: 146505521
Bug: 150788910
Test: statsd_testdrive 264 265
Change-Id: Iff3847be64d718fb2ec17e58c33d47f7fa4b627a
2020-04-14 11:25:07 -07:00
Susi Kharraz-Post
714d0434d3 Merge "Rename sharesheet started atom proto fields." into rvc-dev am: 1faa960005
Change-Id: Ibe864e6a59b447418d7b2e537677e65a84d78f2f
2020-04-14 11:08:23 +00:00
Ruchir Rastogi
04d75c37ba ShellSubscriber: install SIGPIPE handler
Install a handler that ignores SIGPIPE. Before this, SIGPIPE was not
being handled, which caused a SIGKILL to be sent to statsd. Note that
even if SIGPIPE is handled, writes to closed pipes will return EPIPE.

Bug: 153595161
Test: procedure specified in b/153595161
    1. cat statsd config | adb shell cmd stats data-subscribe
    2. Terminate the shell command
    3. cat statsd config | adb shell cmd stats data-subscribe
Change-Id: Ib5e679ccd7cdf7182452466b316488439871db99
2020-04-13 17:46:09 -07:00
Susi Kharraz-Post
3ddadd8f3c Rename sharesheet started atom proto fields.
When copying over the fields into Google3 the linter failed on two field
names that are camel case rather than snake case. Changing here so the
two match. In addition, one of the enum fields didn't have a default
value.

Bug: 147508495
Test: compiles + ChooserActivityTest runs
Change-Id: Iacec9654350763e691a4a10087f693839fd5ea83
2020-04-13 10:05:29 -04:00
Jiyong Park
db589dded4 Mark some aidl_interface modules as unstable
With b/152655547, all aidl_interface modules are considered as stable
unless it is explicitly with "unstable: true". This change marks the
aidl_interface that are not used across updatable module bounraries
as unstable, so that the build system does not run the API
dumping/checking on them.

Bug: 152655547
Test: m
Change-Id: I1257c66de6dd42b2d32d47ed74cb2878f79d14fb
2020-04-13 13:00:47 +09:00
Tej Singh
87ec853fc5 Merge "Statsd test mapping" into rvc-dev am: e715d2f0e7
Change-Id: Ifc878609b5c2af658014e6391434b7c0e8c0c02b
2020-04-11 04:08:55 +00:00