summaryrefslogtreecommitdiff
path: root/tools/stats_log_api_gen/utils.cpp
AgeCommit message (Collapse)Author
2020-12-12Migrate to frameworks/proto_logging/statsBaligh Uddin
BUG: 175318992 Test: TH Merged-In: Ia6463c8f6a801cd9db54afa30df0aa3f16b09891 Change-Id: I81324b83802dc2b06081600282bb73491f29473b Exempt-From-Owner-Approval: cleanup CL
2020-07-31Update stats-log-api-gen source based off of google3 presubmit checksSalud Lemus
Bug: 161812407 Test: `m statslog-framework-java-gen` Test: `m statslog-telephony-java-gen` Test: `m stats-log-api-gen-test && out/host/linux-x86/nativetest/stats-log-api-gen-test/stats-log-api-gen-test` Change-Id: Id68982e306fbc379ed8e90b33a38b8a6604e66ad
2020-07-22Revert "Revert "Add pulled atoms support for native clients in s..."Salud Lemus
Revert submission 12182663-revert-12111163-native pulled atoms support-NYTWIBBAKX Reason for revert: Uploaded CL that guards the use of the symbol "AStatsEvent_getBuffer" Reverted Changes: Ib6cc99e9b:Revert "Make libstatspull host supported" I665448247:Revert "Add pulled atoms support for native client... Change-Id: I59d861fc9ffc6f03cc0dbd34e82a4df4f51f0cb9
2020-07-18Revert "Add pulled atoms support for native clients in stats-log..."Salud Lemus
Revert submission 12111163-native pulled atoms support Reason for revert: ld.lld: error: undefined symbol: AStatsEvent_getBuffer Bug link: https://b.corp.google.com/issues/151102177 Reverted Changes: I57911864c:Add pulled atoms support for native clients in sta... I069792c0e:Make libstatspull host supported Change-Id: I665448247d3bf7d05251d302a38b2a7f61a7c071
2020-07-15Add pulled atoms support for native clients in stats-log-api-genSalud Lemus
Similar to adding pulled atoms support for Java clients, now also add pulled atoms support for native clients. Bug: 160367907 Test: Ran `m` and completed successfully Test: Ran `atest statsd_test` and all CTS tests passed Test: Ran `atest HostAtomTests` and all CTS tests passed Test: Ran `atest stats-log-api-gen-test` and all CTS tests passed Change-Id: I57911864cc3fc5569322333a934dfc10aa78ddca
2020-03-26Group annotations for the same atom idMuhammad Qureshi
Group annotations for the same atom id inside one if-block in generated code. Use shared_ptr to store AtomDecls in multiple data structures. Store a mapping of field numbers to atoms that have annotations at corresponding field numbers in Collation.h Bug: 151744250 Test: stats-log-api-gen-test Test: m stats-log-api-gen Test: m libstatsmetadata Test: m statslog-framework-java-gen Test: m libstatslog Change-Id: I874696cfb5c27141017b4293bec809ab510ceb98
2020-03-24Run clang-format in stats_log_api_genMuhammad Qureshi
Bug: 152253223 Test: m stats-log-api-gen Test: stats-log-api-gen-test Change-Id: Iad76baea8cc9ae7b3978f1133ab94d8e96bbbafe
2020-03-17StatsEvent annotations java autogenJeffrey Huang
Autogenerate annotations for atoms logged in java. generated FrameworkStatsLog.java: https://paste.googleplex.com/4789132691767296 Bug: 151102209 Test: m stats-log-api-gen Test: m statslog-framework-java-gen Change-Id: I50b01feaacfcb8ad5d0236432ceb0e97c8c907ab
2020-03-17Store annotation during collationMuhammad Qureshi
- Only collate atoms in the specified module. - Replace signature_to_modules with signatureInfoMap. This maps each signature to another map keyed by field number and whose values are vector of annotations. Bug: 151102006 Test: stats-log-api-gen-test Change-Id: I25bbe4883c8f7f86a06d04d27cd425367b6d65a0
2020-03-06Merge "Support multiple module annotations per atom" into rvc-devMuhammad Qureshi
2020-03-05Support multiple module annotations per atomMuhammad Qureshi
Bug: 150864291 Test: m stats-log-api-gen-test && out/host/linux-x86/nativetest/stats-log-api-gen-test/stats-log-api-gen-test Change-Id: Ibf8869078c6f1eae13e687f0196d6ed91ec35c64
2020-03-05Delete unused code in stats-log-api-genMuhammad Qureshi
Bug: 145100015 Test: m Change-Id: Idbbe35fbce0d751a5973128406596678e1ead5d3
2020-01-17Add flag to stats-log-api-gen for WorkSource.Muhammad Qureshi
As part of getting rid of StatsLogInternal and moving every atom to be logged from a module, this CL addresses 2 issues: 1. Add WorkSource logging to modules. 2. Gate WorkSource logging via a CLI flag to prevent WorkSource methods from being included in modules that are Mainline modules and can't have @hide calls. Bug: 147541828 Test: m Test: atest android.cts.statsd.atom.UidAtomTests Change-Id: Icce2f6ed7298be5e5ceebfb05d87e6fa7cd6bdbb
2020-01-02Support new socket schema in native codegenMuhammad Qureshi
New code generation implementation is flag guarded by STATS_SCHEMA_LEGACY Support for Q schema can be added by passing --supportQ flag in stats_log_api_gen. (Only needed for statslog_resolv.cpp) Q schema is supported through StatsEventCompat. Generated R schema statslog.h: https://paste.googleplex.com/4986214782337024 Generated R schema statslog.cpp: https://paste.googleplex.com/4856851575341056 Generated R schema statslog_resolv.h: https://paste.googleplex.com/6062978921136128 Generated R schema statslog_resolv.cpp: https://paste.googleplex.com/4752329251225600 Generated Q schema statslog.h: https://paste.googleplex.com/4766729873915904 Generated Q schema statslog.cpp: https://paste.googleplex.com/5018563779756032 Generated Q schema statslog_resolv.h: https://paste.googleplex.com/5338897498243072 Generated Q schema statslog_resolv.cpp: https://paste.googleplex.com/5191011011657728 Test: m -j Test: flashes successfully Test: adb logcat inspection Change-Id: I5675a80c03ca3fbd5cd4a02c04a4b9cb89ec32ab
2019-12-17Move statsd metadata from statslog to atoms_infoMuhammad Qureshi
Clients don't need to know about statsd metadata. Extract out metadata from statslog.h/cpp into atoms_info.h/cpp which is only used by statsd. Generated atoms_info.h: https://paste.googleplex.com/6303016724463616 Generated atoms_info.cpp: https://paste.googleplex.com/5717940978581504 Test: m -j Test: old metadata in statslog matches the metadata in atoms_info Test: Flashes successfully Test: adb logcat "*:S statsd:*" Change-Id: I56ef3cc4ea1fbd2cd0130d4e9576b242efb9f627
2019-11-25Use StatsEvent in Java autogenerated codeMuhammad Qureshi
The change is guarded by STATS_SCHEMA_LEGACY flag in the autogenerator Android.bp. The flag can only be removed once rest of statsd switches over to the new socket schema. The new autogeneration uses StatsEvent for both Mainline module clients and the default platform client. For Mainline modules, the autogenerated code uses a runtime dessert version check to use new socket schema on R+ platforms and the legacy schema on the older platforms. The legacy schema is encapsulated in a separate autogenerated inner class called QLogger. generated DocumentsStatsLog.java: https://paste.googleplex.com/4665805503463424 generated StatsLogInternal.java: https://paste.googleplex.com/5955095055302656 generated android_util_StatsLogInternal.cpp: https://paste.googleplex.com/6737331711115264 Bug: 142811546 Test: m -j && m -j DocumentsUIGoogle Test: Flashes successfully and events are logged to statsd Change-Id: I4c804eaf4d5ae78001146c89ebe46dfb0a453853