[sdlib]: Add logical binder breakdowns
Historically, we've reasoned about binder transaction latency in terms
of thread_states (and kernel blocking functions) or monitor contention.
This disjointed view hides the real picture, for instance from a
thread_state perspective, while a binder reply is Sleeping in the
'S' state, it could broadly be doing any of the:
following:
1. Sleeping due to some timer or interrupt.
2. Blocked on a lock (in Java or CPP).
4. Making another binder transaction.
From a monitor contention perspective, a binder txn could be actually
sleeping or contending for CPU. In the later case, waiting on CPU is the
more interesting 'reason'.
Now, we intersect the slice (flattened) and thread_state to deduce
a logical reason in every intersecting partition. This new reason doesn't
suffer from the examples above and we can more accurately identify stall
reasons during a binder txn on the client and server side.
Test: tools/diff_test_trace_processor.py out/android/trace_processor_shell --name-filter '.*binder.*'
Change-Id: I621a6cb7bf761e5148654a73e58dc5d0ae214e37
diff --git a/Android.bp b/Android.bp
index 09e5942..2c1a99e 100644
--- a/Android.bp
+++ b/Android.bp
@@ -13251,6 +13251,7 @@
"src/trace_processor/perfetto_sql/stdlib/android/battery.sql",
"src/trace_processor/perfetto_sql/stdlib/android/battery_stats.sql",
"src/trace_processor/perfetto_sql/stdlib/android/binder.sql",
+ "src/trace_processor/perfetto_sql/stdlib/android/binder_breakdown.sql",
"src/trace_processor/perfetto_sql/stdlib/android/broadcasts.sql",
"src/trace_processor/perfetto_sql/stdlib/android/cpu/cluster_type.sql",
"src/trace_processor/perfetto_sql/stdlib/android/critical_blocking_calls.sql",