Commit graph

21 commits

Author SHA1 Message Date
Chen Zhu
c724fb670f Add test config to libstatspull_test and libstatssocket_test
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
2020-05-21 14:51:59 -07:00
Jeffrey Huang
18d239c5c5 Add require root to libstats tests
root is required for coverage tests

Bug: 154652564
Test: m -j
Change-Id: I3325565818a275a069aed35a34bf3a58ee4b5bfc
2020-04-24 10:44:25 -07:00
Jeffrey Huang
2f51ad7b86 Tag libstatspull and libstatssocket tests as MTS
create both 32 and 64 bit variants
fixes libstatssocket_test for 32 bit devices

Bug: 154652564
Test: make mts, adb push, adb shell all 4 tests
Change-Id: Ia6b51686c06e786b38cb3713315977533f1bb819
2020-04-22 17:13:24 -07:00
Tej Singh
5d8f770b1c Link libc++ statically
Test: bit statsd_test:*
Test: bit libstatssocket_test:*
Test: bit libstatspull_test:*
Bug: 153349659
Change-Id: Ief3d0e062ed3e5cabf5b8b6198510caf3f64eefd
2020-04-06 19:52:03 -07:00
Tej Singh
0d7fb3d260 libstatspull documentation for puller guardrails
Test: atest LibStatsPullTests
Bug: 152543610
Change-Id: Ia5caad7c9307c02fef7d3dfe70998601e7ffeb55
2020-03-30 18:15:05 -07:00
Hsin-Yi Chen
e3bdbfa46c Disable ABI check for libstatspull
The ABI dump for libstatspull can't be built due to the link error.

Test: development/vndk/tools/header-checker/utils/create_reference_dumps.py
Bug: 151102177
Bug: 151694054
Change-Id: Id324890235679b9593995b6e12a60ef055b4c825
2020-03-23 03:45:07 +00:00
Tej Singh
47e5ae49c2 Minor followups from api feedback
Bug: 150788562
Test: m
Change-Id: I3473e49bc3f3682300b036ddeb032c3776d8d830
2020-03-20 12:16:28 -07:00
Tej Singh
c06f147566 Native API feedback for puller API
1. Rename registerPullAtomCallback to setPullAtomCallback
2. Rename unregisterPullAtomCallback to clearPullAtomCallback
3. Change Ns to Millis for consistency with java
4. Swap metadata and callback params in setPullAtomCallback to match
java
5. Added getters for PullAtomMetadata
6. Added libstatspull_test to test PullAtomMetadata
7. Changed the types on setAdditiveFields from int to int32_t

Test: make
Test: atest LibStatsPullTests
Test: bit libstatspull_test:*
Bug: 1507885621
Bug: 151875223
Change-Id: I5cb07bfe71b1002180403828d5e8e6a5b88ce6fe
2020-03-20 11:10:56 -07:00
Tej Singh
8196687d39 Enforce permission in native puller API.
Test: m
Test: No security exceptions on boot
Bug: 148955001
Change-Id: If196a82bf5a54ee15557825e16f70b5f64f45412
2020-03-17 11:26:00 -07:00
Tej Singh
d78f4dab02 Make libstatssocket a shared_lib
Make libstatssocket unable to be linked as a static lib on the platform.

Test: bit libstatssocket_test:*
Test: bit statsd_test:*
Test: atest LibStatsPullTests
Bug: 149340100

Change-Id: I5889dd718536f5f2c693b4c2e7331c9cc2eb2ac9
2020-02-27 11:37:33 -08:00
Jeffrey Huang
b0a85dc46d Add apex_available to libs
Bug: 145922701
Test: m -j
Change-Id: If5cbe5651e47878520bdc5b943b17a4f72a2a2f3
2020-02-12 18:30:26 -08:00
Ruchir Rastogi
223dadb830 Migrate libstatspull to libbinder_ndk
Since libstatspull will be placed within the APEX, we need to move to
libbinder_ndk.

Test: m -j libstatspull
Test: atest LibStatsPullTests
Bug: 145213327
Change-Id: I86dd6e759efa5eb20bffc76492d5fa72cf279872
2020-02-10 16:07:18 -08:00
Jeffrey Huang
8095e4eef1 Update libstatspull lib
statsd_aidl was updated, so this is the matching change.

Test: m -j
Bug: 148682447
Change-Id: Iec0459cec9f649eb23c6d04b205075fff9b6e911
2020-02-07 12:17:40 -08:00
Tej Singh
a8fd39d83f Expose libstatspull as a stable C API
Libstatspull will ship as a part of the statsd apex in R.

Also update libstatssocket to have version 30 to align with api level,
as per native api council feedback.

Change both libraries to use NDK style naming conventions (AStatsEvent,
AStatsManager), and remove unneeded APIs in libstatssocket.

Remove KeyValuePairs from libstatssocket. KeyValuePairs will not be
supported in native code.

Bug: 147499386
Test: make libstatspull
Test: make libstatssocket
Test: atest libstatssocket_test
Change-Id: Ie79771461215a057529aaac91db95e4334c3960e
2020-02-04 14:07:35 -08:00
Tej Singh
518d77d208 Register pullers in separate thread
This cl modifies getStatsService to use the blocking getService, but
also makes the binder call in a separate thread to not block the client
thread. This is needed because it is possible for pullers to be
registered before statsd starts, and calling checkService before statsd
is up will fail. We also would never receive the binderDied to register
it, because we would never have a binder object to linkToDeath on.

Bug: 147682855
Test: atest LibStatsPullTests
Change-Id: I68c04bc24c7fe066eca88cab4f6a76885581c1ee
2020-01-15 21:15:26 +00:00
Tej Singh
dab324f6e0 Unregistration of native pullers
Changes the API to return an int instead of a bool.
Creates API to unregister pullers.

Test: atest LibStatsPullTests
Bug: 144373250
Change-Id: I6d395237082337a22f37190343a1fc59703d39bf
2020-01-14 14:37:58 -08:00
Tej Singh
7e1b190832 Remove extra indirection in native puller API
The indirection is unneeded since we already take a function pointer.

Test: builds
Change-Id: Ice426d7dcb090aaf87a377ede233a4eb18f5eb30
2020-01-09 11:53:53 -08:00
Stan Iliev
5dc56738bf Change register_stats_pull_atom_callback cookie parameter to non-const
Test: Ran GRAPHICS_STATS puller
Bug: 146052586
Bug: 142665516
Change-Id: I98b4cbb99e35eda50fa9dc3069b3f0ddf16f5ff9
2019-12-16 12:14:08 -05:00
Jeffrey Huang
666510a0d4 Rename IStatsManager to IStatsd
Bug: 146075178
Test: CTS/GTS tests
Change-Id: I08f1b5c6f67c9e510dfaa7b50737c2720e177ad9
2019-12-12 11:32:41 -08:00
Ruchir Rastogi
9ecc986bb7 Use StatEventParcel in libstatspull
Test: m -j128 libstatspull
Change-Id: Ice031f38cdde8a505a887359f6c0cb3312046929
2019-12-06 13:57:42 -08:00
Tej Singh
c03d009697 Native puller API: libstatspulled
Create a new library for the native puller callback API. The library has
2 main interfaces: register_stats_pull_atom_callback, which is used to
register a callback, and stats_pull_atom_callback_t, which is the
callback for the puller. It also exposes pulled_stats_event_list, which
is a struct wrapper around a vector of stats_event.

Test: make libstatspull
Bug: 142969725

Change-Id: I14fe4dc523d6f81fdeaa3fe6fad3e95aeecfe92e
2019-12-04 15:56:21 -08:00