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

Skip to content
Commit 076a3683 authored by Lee Shombert's avatar Lee Shombert
Browse files

Add ANR expiration trace points

This adds a trace point to the AnrTimer track for every expired
ANR. The trace point is the formatted string "%s(%d,%d,%s,%d)":
 * The operation (currently "expired")
 * The Linux pid that expired
 * The Linux uid that expired
 * The ANR category
 * The elapsed time (in ms) since the timer was scheduled

The elapsed time can be used to look backward in a trace to create a
synthetic slice that covers the span from when the timer was scheduled
to when it expired.

The trace point begins a slice, which ends when the client accepts or
discards the ANR.

This tracing is always on.  ANR expiration is uncommon, so there are
no performance issues.

Tested manually by generating an ANR and examining the resulting
perfetto trace.

Test: atest
 * FrameworksServicesTests:com.android.server.am
 * FrameworksMockingServicesTests:com.android.server.am
 * CtsAppTestCases
 * FrameworksServicesTests:AnrTimerTest

Bug: 319454931
Change-Id: Ie8c2ee28bca2b105fafebbbe84930e8f58e90598
parent 2014926d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment