Commit Graph

5906 Commits

Author SHA1 Message Date
Jonathan Nguyen
2273da927d Merge "Add App Usage atom to atoms.proto" into rvc-dev am: 098e95bb9b
Change-Id: Ic4a2f44a76ad34ec78053a67e2b69cbebc6f6159
2020-05-10 05:13:36 +00:00
Jonathan Nguyen
8d8ff53c41 Add App Usage atom to atoms.proto
Test: m -j
Bug: 156041159
Change-Id: Ie0fd99df5b1d8776b6e3c29f7fb2da4759bb465d
Merged-In: Ie0fd99df5b1d8776b6e3c29f7fb2da4759bb465d
(cherry picked from commit ee7dd8f2b2)
2020-05-08 10:44:20 -07:00
Ruchir Rastogi
0a60d240e5 Merge "Fix ShellSubscriber concurrency issues" into rvc-dev am: ca7fc3be0f
Change-Id: I66e1a0a3500328a037714d8b678081d97c4caaad
2020-05-07 23:36:55 +00:00
Ruchir Rastogi
ca7fc3be0f Merge "Fix ShellSubscriber concurrency issues" into rvc-dev 2020-05-07 23:22:56 +00:00
Hyunyoung Song
70871929f3 Merge "Setup default annotation to reduce byte size for launcher related atoms" into rvc-dev am: a07377d529
Change-Id: I84da63a340df3efc05f46e206e9903d78e9c8775
2020-05-07 09:21:45 +00:00
Hyunyoung Song
a07377d529 Merge "Setup default annotation to reduce byte size for launcher related atoms" into rvc-dev 2020-05-07 09:02:43 +00:00
Ruchir Rastogi
1e24051604 Fix ShellSubscriber concurrency issues
This CL creates a sendHeartbeat thread that ocassionally sends
heartbeats, consisting of a dataSize of 0, to perfd. perfd will discard
those heartbeats, recheck if the user has canceled the subscription, and
if not, wait for more data from statsd. Sending heartbeats solves two
big problems:

(1) Allows statsd to robustly check if writes to the socket fail because
the read end of the pipe has closed. Previously, if no atoms were pushed
or pulled, statsd never attempted to write to perfd, so statsd could
never detect the end of the subscription. However, now, writes are
regularly made regardless of if statsd receives data. Note that even if
atoms were pushed or pulled, there is no guarantee that they would have
matched the atom matchers sent in perfd's config.

(2) Allows perfd to escape a blocking read call and recheck whether the
user has canceled the subscription. If no data is sent to perfd, perfd
will block in this read call and the AndroidStudio UI will freeze up.

Heartbeats are only sent if statsd has not sent any data to perfd within
the last second, so we do not spam perfd with writes.

+ decomposes the startNewSubscription function
+ prevents startPull from holding the lock while sleeping

Test: atest stastd_test
Test: atest CtsStatsdHostTestCases
Test: manually confirm that AndroidStudio is not freezing
Bug: 153595161

Change-Id: I78f0818e8ed29bdadd02c151444ee7c9555623a4
2020-05-06 19:52:16 -07:00
Tej Singh
146263cbf8 Merge "Fix statsd NPE on setPullAtomCallback" into rvc-dev am: 6dfbdb3e2f
Change-Id: I7c6217c1732a0c04003f937102d25295e6d92937
2020-05-06 22:31:27 +00:00
Ruchir Rastogi
6a2d80e165 Merge "Handle race conditions in SCS when statsd dies" into rvc-dev am: 76994e73a7
Change-Id: I63f1bac1c76e0eb4ca0c0a4b6cf79033f95b60f7
2020-05-06 22:30:50 +00:00
Tej Singh
7c0e804554 Merge "Improve statsdstats logging for pulled atoms" into rvc-dev am: c9dad09ad3
Change-Id: Ic4bca19eaaa7e12b24969572bbfc901440035fa3
2020-05-06 22:30:25 +00:00
Tej Singh
6dfbdb3e2f Merge "Fix statsd NPE on setPullAtomCallback" into rvc-dev 2020-05-06 22:11:02 +00:00
Ruchir Rastogi
76994e73a7 Merge "Handle race conditions in SCS when statsd dies" into rvc-dev 2020-05-06 22:10:42 +00:00
Tej Singh
c9dad09ad3 Merge "Improve statsdstats logging for pulled atoms" into rvc-dev 2020-05-06 22:09:26 +00:00
Ruchir Rastogi
e92edbaffc Handle race conditions in SCS when statsd dies
This CL aims to fix two race conditions:

1. When statsd restarts after a crash, the ordering of sayHiToStatsd and
binderDied is not guaranteed. However, previously, we assumed that
binderDied would get called first and reset sStatsd to null. To solve,
we don't assume a function ordering and don't throw an error message in
sayHiToStatsd if sStatsd is not null.

2. When statsd was linked to death, the death recipient was not informed
about all broadcast receivers. Thus, the death recipient might have
known only a partial list of receivers when #binderDied was triggered. To
solve, we make sure that the death recipient knows about all receivers
before we link to death.

Test: atest statsd_test
Test: atest CtsStatsdHostTestCases
Bug: 154275510

Change-Id: I11be65ca2135cde200ab8ecb611a363d8f7c2eb6
2020-05-06 11:06:55 -07:00
Hyunyoung Song
e742ae7f37 Setup default annotation to reduce byte size for launcher related atoms
Bug: 137777105
Bug: 144953948

- Add one more field (cardinality) to Launcher related atoms
- Change the name of two existing fields (span_x, span_y)

Test: builds, locally tested against launcher logging

Change-Id: I243711023c1ed981126b50575cdfbf51490a2c57
Signed-off-by: Hyunyoung Song <hyunyoungs@google.com>
2020-05-06 00:04:37 -07:00
Tej Singh
873e91a117 Improve statsdstats logging for pulled atoms
1. remove old statscompanion counters
2. add outgoing binder call fail counts
3. Add additional pull failure cases
 a. No pull uid provider (If a config doesn't register properly)
 b. Puller not found - either because it was not registered or because
the client did not specify the correct uids
4. Make metrics own logging pull delays - these were getting overcounted
since both the PullerManager and ValueMetricProducer were logging pull
delays.
5. Move noteEmptyPull to StatsPuller for more uniform logging, instead
of it just being logged in value metric producer.

Test: m statsd
Bug: 154056912
Change-Id: Ia373003905ee44d3b7b37b2bfa1e1d6268250070
2020-05-05 19:03:52 -07:00
Tej Singh
baed5257ad Fix statsd NPE on setPullAtomCallback
Suspected root cause: if a process crashes right after calling
setPullAtomCallback, it's possible that oneway binder calls can queue
but do not execute before the process crashes. Then, when the process
crashes, nothing has a strong reference to the IPullAtomCallback, so
it gets deallocated. Then, when the oneway call actually executes, the
callback is null. This is being followed up in b/155793159

Regardless, statsd should handle null input properly.

Test: GTS test in ag/11348719 now passes
Test: atest GtsStatsdHostTestCases
Bug: 153822941
Change-Id: Ic6d415e10eca8d133290de80cb61e1634590ca6a
2020-05-05 14:51:57 -07:00
Chi Zhang
a72eb44c7e Merge "Add dimension to VOICE_CALL_SESSION atom." into rvc-dev am: a8added053
Change-Id: I76fd9523e4e00e347ba37bc2e8b45bebc5bfb534
2020-05-05 19:08:39 +00:00
Chi Zhang
a8added053 Merge "Add dimension to VOICE_CALL_SESSION atom." into rvc-dev 2020-05-05 18:56:57 +00:00
Will Brockman
4e9db995c9 Merge "Statsd testdrive: remove debug line." into rvc-dev am: 4a0fe52131
Change-Id: I6938ac3b1fd28c40b148bce3ef61920a956f5520
2020-05-05 15:31:20 +00:00
Will Brockman
4a0fe52131 Merge "Statsd testdrive: remove debug line." into rvc-dev 2020-05-05 15:28:25 +00:00
Junyu Lai
ec23e71aa4 Merge "[SM17] Remove ratType field in MobileBytesTransfer(ByFgBg)" into rvc-dev am: 73d7775f76
Change-Id: Ie72494f55734947ed11babe6f0ee3cfbece8bf59
2020-05-05 03:29:44 +00:00
Junyu Lai
73d7775f76 Merge "[SM17] Remove ratType field in MobileBytesTransfer(ByFgBg)" into rvc-dev 2020-05-05 03:06:49 +00:00
Jing Ji
6cadc218fe Merge "Support to pull aggregated procstats associations" into rvc-dev am: e9fbacf6c5
Change-Id: I4c5a3f889c99337c9462104d1a0b880d1ba12a6f
2020-05-05 01:10:49 +00:00
Jing Ji
060d68630d Support to pull aggregated procstats associations
Bug: 145203981
Test: b/152397079#comment12
Test: atest CtsStatsdHostTestCases
Change-Id: If5b9723a41a9d2eefc2cb132b3a3bf16f57872e9
2020-05-04 14:33:06 -07:00
Chi Zhang
8bf81dffa9 Add dimension to VOICE_CALL_SESSION atom.
Bug: 142026991
Bug: 141631489

Test: build
Change-Id: I320611ee871c7feae53e3e67fcdf8cbab0be241b
2020-05-03 20:17:34 -07:00
Suren Baghdasaryan
aeae048088 Replace direct pid writes with setting task profiles
For easy transition from SchedTune to UtilClamp, direct access to these
cgroups should be abstracted by using task profiles. Replace writepid
commands with new task_profiles command.

Bug: 155419956
Test: change .rc file and confirm task profile is applied
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I05f5a082c7e6f43ab94330aede29967e91d1aef9
Merged-In: I05f5a082c7e6f43ab94330aede29967e91d1aef9
2020-05-03 08:12:10 +00:00
Songchun Fan
6516d8e010 Merge changes from topics "v2_metrics_add_size", "v2_metrics_optional_package_name" into rvc-dev am: ec60726cb4
Change-Id: I6e379f6e6e60471ec8de5f9410b02a355b602ef6
2020-05-01 22:33:09 +00:00
Songchun Fan
ec60726cb4 Merge changes from topics "v2_metrics_add_size", "v2_metrics_optional_package_name" into rvc-dev
* changes:
  [pm/metrics] add apk size in the log
  [pm/metrics] do not log package name for adb installations
2020-05-01 22:27:59 +00:00
Will Brockman
7fb4030829 Statsd testdrive: remove debug line.
Oops, left the old output in the submitted CL that changed to a new
output approach.

Bug: 149914234
Test: atest --host frameworks/base/cmds/statsd/tools/localtools/test/com/android/statsd/shelltools/testdrive/*.java
Test: statsd_testdrive 90 > /tmp/testdrive
Change-Id: Ib9542e478a57ad56d9fe2a0e97cb18a05d5d2535
2020-05-01 16:37:36 -04:00
Suren Baghdasaryan
610345984d Merge "Replace direct pid writes with setting task profiles" am: 1e4b31dd5d am: 172a573b4b
Change-Id: I4fd59733c8a25f2f138e1735c87eb5c101236001
2020-05-01 17:04:10 +00:00
Suren Baghdasaryan
172a573b4b Merge "Replace direct pid writes with setting task profiles" am: 1e4b31dd5d
Change-Id: I200239325e06aa7beac9f857ffa382836a885923
2020-05-01 16:50:07 +00:00
Suren Baghdasaryan
6acfa351a2 Replace direct pid writes with setting task profiles
For easy transition from SchedTune to UtilClamp, direct access to these
cgroups should be abstracted by using task profiles. Replace writepid
commands with new task_profiles command.

Bug: 155419956
Test: change .rc file and confirm task profile is applied
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I05f5a082c7e6f43ab94330aede29967e91d1aef9
2020-05-01 16:12:36 +00:00
Diksha Gohlyan
13064e29e5 Merge "Add logs for drag and drop in documentsui" into rvc-dev am: 9975ac4156
Change-Id: Idabaf5bf86e31b908150cd91abbf07875604dddd
2020-05-01 15:14:26 +00:00
Songchun Fan
aff0dce172 [pm/metrics] add apk size in the log
Sum up all apk sizes in the code path and record in the log.

Test: atest android.content.pm.cts.PackageManagerShellCommandTest#testSplitsInstallStdIn
Test: out/host/linux-x86/bin/statsd_testdrive 263
event_metrics {
  data {
    elapsed_timestamp_nanos: 1543983836620
    atom {
      package_installer_v2_reported {
        is_incremental: true
        package_name: ""
        duration_millis: 327
        return_code: 1
        size: 2512345
      }
    }
  }
}
BUG: 152913040
Change-Id: Idde0adb6b639163627c092ed248631edfba2e952

Change-Id: I0eaf226513ee5a1b5f73726f4480c6ee73210b0d
2020-04-30 09:57:36 -07:00
Diksha Gohlyan
b96b2f486a Add logs for drag and drop in documentsui
Test: not tested
Bug: 155134389

Change-Id: Iab4dc6973284de5bbad4c79e0641d7316f74e6ec
2020-04-30 09:20:48 -07:00
Jason Hsu
6266b41e07 Merge "Change AccessibilityServiceReported atoms to log from settings module." into rvc-dev am: 04ffadbc86
Change-Id: Ic678b6a20999f5367ffa4b3f96106e2118068a52
2020-04-30 12:32:04 +00:00
Jason Hsu
04ffadbc86 Merge "Change AccessibilityServiceReported atoms to log from settings module." into rvc-dev 2020-04-30 12:21:16 +00:00
junyulai
592c605596 [SM17] Remove ratType field in MobileBytesTransfer(ByFgBg)
Currently, ratType field has been added into
MobileBytesTransfer(ByFgBg) atoms. However, add such dimension
is not backward compatible since callers might expect a complete
NetworkStats for specific uid in the metrics, but actually
the NetworkStats were distributed into metrics with
different ratType.

This change provide minimum modification that reverts the
behavior of MobileBytesTransfer, but related APIs will be needed
in subsequent changes.

Test: adb shell cmd stats pull-source 10000~10003
Test: atest android.cts.statsd.atom.UidAtomTests#testMobileBytesTransfer
Test: atest android.cts.statsd.atom.UidAtomTests#testMobileBytesTransferByFgBg
Bug: 129082217
Change-Id: I591f9fff2322c343479eb8587f14e48f878080b4
2020-04-30 12:17:24 +08:00
TreeHugger Robot
9ea0c17a4f Merge "Add tests for mapIsolatedUidToHostUid methods" into rvc-dev am: a8ba45dd80
Change-Id: Ic6442cce133a6d0dc1ed0c85c817c136ee3cf5eb
2020-04-29 19:28:58 +00:00
TreeHugger Robot
a8ba45dd80 Merge "Add tests for mapIsolatedUidToHostUid methods" into rvc-dev 2020-04-29 19:14:26 +00:00
Muhammad Qureshi
b635b3a2eb Add tests for mapIsolatedUidToHostUid methods
- Remove unneeded dependency on atoms.proto
- Remove extractIntoVector function. Assert on actual output directly.
- Use a helper method for creating UidMap mock for all tests.
- Add AttributionChain variants of existing tests in puller_util_tests.
- Add tests in StatsLogProcessor_test to test mapIsolatedUidToHostUid()
    in StatsLogProcessor.

Bug: 154285085
Test: bit statsd_test:*

Change-Id: I6d0822be9f0fbca23bd2f441dc63b97110567307
2020-04-29 09:58:03 -07:00
Ruchir Rastogi
f9b4e812bb Merge "Reduce memory footprint of LogEvent" into rvc-dev am: 272cae6e10
Change-Id: I6ecdc1fa1e0cb008f2f20156e1b4be85091798ac
2020-04-29 16:35:29 +00:00
Ruchir Rastogi
272cae6e10 Merge "Reduce memory footprint of LogEvent" into rvc-dev 2020-04-29 16:21:46 +00:00
Will Brockman
f42b59b335 Merge "Statsd TestDrive tool: Write output to stdout. Also: Option for less verbose output." into rvc-dev am: 0f309dc04a
Change-Id: I285f93ec144bd1efdb3ed2d5a991010f69789785
2020-04-29 14:55:51 +00:00
Will Brockman
0f309dc04a Merge "Statsd TestDrive tool: Write output to stdout. Also: Option for less verbose output." into rvc-dev 2020-04-29 14:49:49 +00:00
jasonwshsu
7b1be3e68d Change AccessibilityServiceReported atoms to log from settings module.
* Lower cost to log from accessibility settings

Metrics council review bug: 153342192
Bug: 151285965
Test: build pass

Change-Id: Ia1b479ff5e7ece46da734212a747739b9de3ba90
2020-04-29 19:24:03 +08:00
Ryan Mitchell
04fa9c9f57 Merge "Reduce OMS start time" into rvc-dev am: 84a84ac62a
Change-Id: I9a419e6be7cc950693e39c5d474e3c60161c4b69
2020-04-28 23:47:58 +00:00
Ryan Mitchell
84a84ac62a Merge "Reduce OMS start time" into rvc-dev 2020-04-28 23:44:03 +00:00
TreeHugger Robot
86430f4416 Merge "Update NotificationSection enum." into rvc-dev am: 34b9c0614b
Change-Id: Ic7ad3eb77948b6f4def6ae0c9d91ee5af7bd636d
2020-04-28 20:26:10 +00:00