Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 4424d490 authored by Zimuzo Ezeozue's avatar Zimuzo Ezeozue
Browse files

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
parent 41ef600b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment