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

Commit 1fc3eac3 authored by Peter Kalauskas's avatar Peter Kalauskas
Browse files

Enable stack-walking for default coroutine names

If coroutine does not have a trace name, walk the stack to infer a name
for it.

Test: Capture trace, look for coroutine IDs
Flag: com.android.systemui.coroutine_tracing
Bug: 289353932
Change-Id: I9e04098e69d12cc06b4c1dd29528f760ffeb26f8
parent df1450c5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ import com.android.app.tracing.coroutines.createCoroutineTracingContext
import kotlin.coroutines.CoroutineContext

fun newTracingContext(name: String): CoroutineContext {
    return createCoroutineTracingContext(name) { className ->
    return createCoroutineTracingContext(name, walkStackForDefaultNames = true) { className ->
        className.startsWith("com.android.systemui.util.kotlin.JavaAdapter") ||
            className.startsWith("com.android.systemui.lifecycle.RepeatWhenAttached")
    }