androidx.tracing
Objects
Trace |
Writes trace events to the system trace buffer. |
Top-level functions summary
inline T |
Wrap the specified |
inline T |
Wrap the specified |
inline T |
<T : Any?> traceAsync(Wrap the specified |
suspend inline T |
<T : Any?> traceAsync(Wrap the specified |
Top-level functions
trace
inline fun <T : Any?> trace(label: String, block: () -> T): T
Wrap the specified block in calls to Trace.beginSection (with the supplied label) and Trace.endSection.
| Parameters | |
|---|---|
label: String |
A name of the code section to appear in the trace. |
block: () -> T |
A block of code which is being traced. |
trace
inline fun <T : Any?> trace(lazyLabel: () -> String, block: () -> T): T
Wrap the specified block in calls to Trace.beginSection (with a lazy-computed lazyLabel, only if tracing is enabled - Trace.isEnabled) and Trace.endSection.
This variant allows you to build a dynamic label, but only when tracing is enabled, avoiding the cost of String construction otherwise.
| Parameters | |
|---|---|
lazyLabel: () -> String |
A name of the code section to appear in the trace, computed lazily if needed. |
block: () -> T |
A block of code which is being traced. |
traceAsync
inline fun <T : Any?> traceAsync(
lazyMethodName: () -> String,
lazyCookie: () -> Int,
block: () -> T
): T
Wrap the specified block in calls to Trace.beginAsyncSection and Trace.endAsyncSection, with a lazy-computed lazyMethodName and lazyCookie, only if tracing is enabled - Trace.isEnabled.
| Parameters | |
|---|---|
lazyMethodName: () -> String |
The method name to appear in the trace, computed lazily if needed. |
lazyCookie: () -> Int |
Unique identifier for distinguishing simultaneous events, computed lazily if needed. |
block: () -> T |
a code block to be wrapped between |
traceAsync
suspend inline fun <T : Any?> traceAsync(
methodName: String,
cookie: Int,
crossinline block: suspend () -> T
): T
Wrap the specified block in calls to Trace.beginAsyncSection (with the supplied methodName and cookie) and Trace.endAsyncSection.
| Parameters | |
|---|---|
methodName: String |
The method name to appear in the trace. |
cookie: Int |
Unique identifier for distinguishing simultaneous events |
crossinline block: suspend () -> T |
A code block to be wrapped between |