base: nest "receiver scheduled" slices under "process running" slices

As noted in b/259535570 and updated documentation for ag/20519869, we
now support nesting async slices. Since "receiver scheduled" slices
perfectly nest until "process running slices", it makes sense to use
the same cookie to allow parent <-> child relationships between
the two.

This does *not* change the UI/UX of traces in the Perfetto UI: it just
makes these slices much easier to query using SQL.

Bug: 259535570
Change-Id: Ie3a0f493ccd3a7f69e946e55486b2991b69c5ee3
This commit is contained in:
Lalit Maganti
2022-12-01 17:30:03 +00:00
parent 5a282451d2
commit f05d13b00f

View File

@@ -506,15 +506,13 @@ class BroadcastProcessQueue {
}
public void traceActiveBegin() {
final int cookie = mActive.receivers.get(mActiveIndex).hashCode();
Trace.asyncTraceForTrackBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER,
runningTraceTrackName, mActive.toShortString() + " scheduled", cookie);
runningTraceTrackName, mActive.toShortString() + " scheduled", hashCode());
}
public void traceActiveEnd() {
final int cookie = mActive.receivers.get(mActiveIndex).hashCode();
Trace.asyncTraceForTrackEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER,
runningTraceTrackName, cookie);
runningTraceTrackName, hashCode());
}
/**