This prevents subtle bugs from being introduced when more member
variables, such as annotations, are added to LogEvent.
Test: m statsd
Test: atest statsd_test
Test: atest GtsStatsdHostTestCases
Bug: 156312371
Change-Id: Ibb5366e8658d6c99e5730b4bc301190655bbd245
This change adds EvsUsageStatsReported that contains various usage
statistics collected by EVS service.
Bug: 153236752
Test: $ANDROID_HOST_OUT/bin/statsd_testdrive 274 after allowing
AID_AUTOMOTIVE_EVS to log
Change-Id: I99fe24d7679678e8bb3fa779f299f253a9e703f0
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
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
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>
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
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
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
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
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
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
- 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
This change attempts to reduce the amount of time initializing the
OMS. The change:
1) Reduces the amount of time between subsequent attempts to connect
to the idmap2d service when it is not alive.
2) Caches package infos retrieved from getOverlayPackages
3) Caches the crc of the android package to preventing having to
retrieve it for every overlay package targeting the framework
This chance reduced OMS start up time from ~500ms to ~100ms on a
Pixel 3. If the idmap2d service is running when system sever starts
then start up time will be around ~70ms.
Bug: 151481016
Test: adb shell stop && adb shell start && [capture trace]
Change-Id: I6137c385baf099413b62e98557419fffb9fd2d93
This reduces the memory footprint by 16 bytes per LogEvent.
Test: atest statsd_test
Test: atest CtsStatsdHostTestCases
Bug: 154857643
Change-Id: I1e541816377ae8b14d789dc4d1f0a4ec91eef998
The enum NotificationSection, used in the NotificationPanelReported atom
(245), needs to be updated to reflect the current
NotificationsSectionManager.PriorityBucket possibilities.
Bug: 155004478
Test: make statsd_testdrive && $ANDROID_HOST_OUT/bin/statsd_testdrive 245
Change-Id: I4194a1e304f4498fa0ddbb2c385296864eb19cfc
Finish annotating state atoms with exclusive state, primary fields, and
default/trigger reset states. These annotations are based off of
ag/4639668.
Some "StateChanged" atoms require more research before annotating them
as state atoms. This includes new atoms that have been added after
ag/4639668 and are potential state atoms.
Test: bit statsd_test:*
Bug: 145838040
Change-Id: I7b43c50d61d93c96b16d69e2fdc3683031f2e22c
Now allows capturing multiple events under the same event metric.
Added unit tests for configuration generation and command-line
interpretation. Refactored configuration into an inner class and
added functionality using TDD.
Also updated TestDrive & LocalDrive tools to check ANDROID_SERIAL as well as
the -s parameter when multiple devices are connected, and improved error messages.
Bug: 149914234
Test: atest --host test/com/android/statsd/shelltools/testdrive/*.java
Test: out/host/linux-x86/bin/statsd_testdrive -s <SERIAL> 90
Test: out/host/linux-x86/bin/statsd_localdrive -s <SERIAL> get-data 90
Change-Id: I4e756c2b132a22d66ccaf7b3346fe4fbf1f6f1fb