Using lazy_static is now discouraged as unmaintained
and once_cell is the recommended replacement.
On top of that a similar implementation found in
once_cell is being tracked for inclusion under the
`lazy_cell` feature gate [0]
[0] https://github.com/rust-lang/rust/issues/109736
Test: m
Change-Id: I21d343a38dbd25bb2d13f239f7fa3a2d7f20323e
The flag has been a default, and now is not accepted.
Test: Treehugger, m rust
Bug: 279198502
Bug: 276464273
Change-Id: Ifdf9968bfcdb278f73cf31ab68bc6b488b39436b
We are now default restricting bindgen visibility to subpackages. This
change is part of a set of changes adding explicit visibility for
bindgen libraries which are already being used elsewhere.
* If these visibility rules are to allow access by the safe bindings
library which lives elsewhere in the codebase, no action is needed.
* If safe bindings do not exist, and you own this library, now is a good
time to think about producing them and transitioning your (now
enumerated) client list.
* If safe bindings exist, but there is a surprise client of the raw
bindings on this list, now is a good time to talk to them about why
they don't want to use your safe bindings.
Bug: 166332519
Test: m
Change-Id: I1320a72d61cf0d760da3e037dec6ad35c8c979f8
The library is required to log the atoms from virt apex. See bug for more details
Test: m succeeded. The whole topic is tested with statsd_testdrive 409
as mentioned in go/westworld-create-atom#step-3-test-your-atom
Change-Id: If8b13c9d1878265bfcb8e09fc1bd8e78e968f71f
Manages binder lifecycle & provides interfaces for the underlying IPCs.
Callers can use StatsBootstrapAtomClient::reportBootstrapAtom. Under the
hood, we use checkService, which will not wait for the service. This is
so we avoid blocking the client. If StatsBootstrapAtomService is not
available, the log will be dropped, and false will be returned.
Test: manually verified atoms could be logged to statsd
Bug: 206644307
Change-Id: I63ae62f1ce4d1dc337f99c9e3b35b2496131c582
Note that this is currently a no-op test that does nothing. But this
makes it future proof in case we add more later.
Test: atest
Change-Id: I23817febd2122f54c40958541fc66363d38b60ca
Added SPDX-license-identifier-Apache-2.0 to:
libstats/pull_rust/Android.bp
Bug: 68860345
Bug: 151177513
Bug: 151953481
Test: m all
Exempt-From-Owner-Approval: janitorial work
Change-Id: I362f72ab99850558ddc7b50108c1ec6a212cb258
Added SPDX-license-identifier-Apache-2.0 to:
libstats/pull_lazy/Android.bp
libstats/socket_lazy/Android.bp
trusty/utils/acvp/Android.bp
Bug: 68860345
Bug: 151177513
Bug: 151953481
Test: m all
Exempt-From-Owner-Approval: janitorial work
Change-Id: I33005150521238b61d1a8c923749b17d36bba693
Add lazy loading support to libstatspull.
There are a few clients (surfaceflinger, bootanimation dependencies)
that run before the statsd apex is mounted and cannot link
libstatspull.so when the process starts. Lazy loading will load the
library when the apis to set/clear callbacks or create PullAtomMetadata
get called.
This change is modeled heavily off of aosp/1570701, which added
libnativehelper_lazy.
Bug: 178480419
Test: atest libstatspull_lazy_test
Change-Id: I9956f5a690aec8c7ff9f0834a3f36387e5d8b23f
Add lazy loading support to libstatssocket.
There are many clients of libstatssocket (lmkd, surfaceflinger,
bootanimation dependencies) that run before the statsd apex is mounted
and cannot link libstatssocket.so when the process starts. Lazy loading
will load the library when the logging apis get called.
This change is modeled heavily off of aosp/1570701, which added
libnativehelper_lazy.
Bug: 178480419
Test: atest libstatssocket_lazy_test
Change-Id: I57e6f698ad43dddc98dc787ba2fe888030c8a282
The //frameworks/base/apex/statsd path is being migrated to
//packages/modules/StatsD/apex.
BUG: 167962588
TEST: TH
Change-Id: Ifa64bd8268f1515597b11376cdf08828983e0c60
android_filesystem_config.h is found since system/core/include is on
the include path for all projects and contains a symlink to the real
android_filesystem_config.h. This is fragile and the below bug seeks
to remove this symlink and have users correctly depend on
libcutils_headers.
Bug: 165825252
Test: build
Change-Id: I1aad6a2e8fbe87635e97b0ac1be3414403353382
Pushed atoms do not need to be truncated because only the bytes added to
the buffer are written to the socket. Pulled atoms do not need to be
truncated because within stats_pull_atom_callback.cpp, we only copy the
valid parts of the buffer to the StatsEventParcel object.
This improves performance by avoiding a needless call to realloc.
+ removed dead benchmarking code
Test: m libstatssocket
Test: atest libstatssocket_test
Test: atest GtsStatsdHostTestCases
Bug: 158717786
Change-Id: I6965f8832758203ca566336ba12d0acaf5f756d5
Increase AStatsEvent max byte size to 50 KB for pulled events.
All AStatsEvent instances are treated as pulled events unless
AStatsEvent_write() is called.
- Set the default max size to 50 KB
- The starting buffer size is still ~4 KB for pushed and pulled events.
- If a write would exceed the buffer bounds, double buffer size until
write fits or 50 KB limit is exceeded in which case the overflow bit is
set to true.
- If AStatsEvent_write() is called, max size is set to ~4 KB. And if
the current payload exceeds this limit, set overflow bit to true.
- Fix error mask checking in stats_event_test.
- Set ERROR_NO_ATOM_ID when atom id is missing.
- Make sure tests don't hit ERROR_TOO_MANY_FIELDS when testing buffer
overflow.
- Rename event->size to event->numBytesWritten
Fixes: 158214941
Test: libstatssocket_test
Change-Id: Ia26aeb775f7e4f2ffe87707bab6d0119e21da10e
If the first call for pullFinished fails, it is likely because the
transaction is too large. Currently, if this happens statsd will just
sleep until the timeout. With this change, the client will retry calling
pullFinish if the first attempt fails, but with an empty payload (and
with success = false) to cause the puller to fail fast, and so statsd
does not wait for the timeout.
Test: atest LibStatsPullTests
Bug: 157768117
Change-Id: I3af991fae47bb7c09bf8a6fc83f28556b836c6e4
and apply mainline module test controller to it so that
the tests will only be run when statsd apex is found on device.
Bug: 154845935
Test: m mts && mts-tradefed run mts-statsd
Change-Id: I8939e68b4d4c3772e248c1960b74c0f1bd6a21a6
statsd should now be enabled on all devices and this check is
unnnecessarily adding a check for each time there's a call into the
socket, which is inefficient.
Bug: 157082130
Test: make, statsd_test
Change-Id: I0bb0ae0c93516c3a02cb971742c3eba602668a09
Modules contributing mainline modules (APK/APEX) should set
min_sdk_version as well as apex_available.
For now setting min_sdk_version doesn't change build outputs.
But build-time checks will be added soon.
Bug: 152655956
Test: m
Merged-In: Icd184c6fe06a688bd79ef6514bb49dffb706a9a1
Change-Id: Icd184c6fe06a688bd79ef6514bb49dffb706a9a1
(cherry picked from commit cc3588afcb)