Add a Java Perfetto SDK API
Utilizing Ibb08e8b6cab7d86ac2c1d57c621c9074a4cb4077 we add a JNI layer to create and reuse Perfetto tracing objects. To avoid GC churn, we reuse these objects from an LRUCache. The API is something like: PerfettoTraceExtras = PerfettoTraceExtras.addArg(..).addFlow(..); PerfettoTrace.instant(category, extras); There is support for the following Perfetto constructs: 1. Categories 2. DebugArgs (k,v pairs) 3. Flows 4. DynamicTracks (NamedTracks) 5. RegisteredTracks (for async slice and counters) 6. Counters (int and double) Arbitrary protos are not supported yet. If we go that far, we should perhaps serialize the protos directly into the shmem (or via an intermediate ring buffer) without going through JNI. Test: atest PerfettoTraceTest Change-Id: Icd23eed60d97cd2e9b65679d2aee0190aa7476b0 Bug: 303199244 Flag: android.os.perfetto_sdk_tracing_v2
Loading
Please register or sign in to comment
