[RELAND] tp: move thread state implementation to trace processor
Thread state is pretty complicated to calculate and has a lot of edge
cases and subtlety that's hard to capture in SQL. The other problem is
that we also want to have thread state available for metrics (currently
some metrics have recreated a cut down version of this class).
For this reason, move the thread state computation as a dynamic table in
C++ which allows sharing it with other places. It also has the advantage
of making startup of the UI much faster as it doesn't need to compute
the thread state table.
This is a reland of aosp/1360559
Bug: 163812686
Change-Id: I48ed30e9b9696890fb8d389b0014d65e609feb3d
diff --git a/BUILD b/BUILD
index 576dc0e..33db149 100644
--- a/BUILD
+++ b/BUILD
@@ -961,6 +961,8 @@
"src/trace_processor/dynamic/experimental_sched_upid_generator.h",
"src/trace_processor/dynamic/experimental_slice_layout_generator.cc",
"src/trace_processor/dynamic/experimental_slice_layout_generator.h",
+ "src/trace_processor/dynamic/thread_state_generator.cc",
+ "src/trace_processor/dynamic/thread_state_generator.h",
"src/trace_processor/iterator_impl.cc",
"src/trace_processor/iterator_impl.h",
"src/trace_processor/read_trace.cc",