androidx.benchmark.traceprocessor
Interfaces
Classes
PerfettoTrace |
Cmn
|
|
Row |
A Map |
Cmn
|
TraceProcessor |
Kotlin API for Perfetto Trace Processor, which enables SQL querying against the data stored in a Perfetto trace. |
Cmn
|
TraceProcessor.Session |
Handle to query sql data from a |
Cmn
|
TraceProcessor.Tracer |
Cmn
|
Objects
Annotations
ExperimentalTraceProcessorApi |
Annotation indicating experimental API for initializing Trace Processor. |
Cmn
|
Top-level functions summary
String |
processNameLikePkg(pkg: String) Helper for fuzzy matching process name to package |
Cmn
|
Row |
Convenience for constructing a RowResult for given column values. |
Cmn
|
Extension functions summary
Unit |
@RequiresApi(value = 23) Record a Perfetto System Trace for the specified |
android
|
Unit |
@RequiresApi(value = 23) Record a Perfetto System Trace for the specified |
android
|
Top-level functions
processNameLikePkg
fun processNameLikePkg(pkg: String): String
Helper for fuzzy matching process name to package
rowOf
fun rowOf(vararg pairs: Pair<String, Any?>): Row
Convenience for constructing a RowResult for given column values.
Useful when asserting expected query results in tests.
Extension functions
record
@RequiresApi(value = 23)
@ExperimentalPerfettoCaptureApi
fun PerfettoTrace.Companion.record(
fileLabel: String,
appTagPackages: List<String> = listOf(InstrumentationRegistry.getInstrumentation().targetContext.packageName),
userspaceTracingPackage: String? = null,
traceCallback: ((PerfettoTrace) -> Unit)? = null,
block: () -> Unit
): Unit
Record a Perfetto System Trace for the specified block
.
PerfettoTrace.record("myTrace") {
// content in here is traced to myTrace_<timestamp>.perfetto_trace
}
Reentrant Perfetto trace capture is not supported, so this API may not be combined with BenchmarkRule
, MacrobenchmarkRule
, or PerfettoTraceRule
.
If the block throws, the trace is still captured and passed to traceCallback
.
record
@RequiresApi(value = 23)
@ExperimentalPerfettoCaptureApi
fun PerfettoTrace.Companion.record(
fileLabel: String,
config: PerfettoConfig,
highlightPackage: String = InstrumentationRegistry.getInstrumentation().targetContext.packageName,
userspaceTracingPackage: String? = null,
traceCallback: ((PerfettoTrace) -> Unit)? = null,
block: () -> Unit
): Unit
Record a Perfetto System Trace for the specified block
, with a fully custom Perfetto config, either text or binary.
PerfettoTrace.record("myTrace", config = """...""") {
// content in here is traced to myTrace_<timestamp>.perfetto_trace
}
Reentrant Perfetto trace capture is not supported, so this API may not be combined with BenchmarkRule
, MacrobenchmarkRule
, or PerfettoTraceRule
.
If the block throws, the trace is still captured and passed to traceCallback
.