tools: add experimental python library/binary for slice breakdowns
This CL adds an experimental Python library and accompanying binary
which breaks down the slices in a trace by various dimensions,
computing the total self time.
It optionally supports passing in a process name to limit the breakdown
to and the start/end timestamps to select the region of the trace to
breakdown
Bug: 196040224
Change-Id: I2ce7555dc1ece4f236da0f2410afff51bbee78f1
diff --git a/BUILD b/BUILD
index c36452f..2d191fd 100644
--- a/BUILD
+++ b/BUILD
@@ -4162,5 +4162,31 @@
":protobuf_descriptor_pb2_noop",
":pyglib_noop",
],
+ imports = [
+ "src/trace_processor/python",
+ ],
visibility = PERFETTO_CONFIG.public_visibility,
)
+
+perfetto_py_library(
+ name = "experimental_slice_breakdown_lib",
+ srcs = glob(["tools/slice_breakdown/perfetto/slice_breakdown/*.py"]),
+ deps = [
+ ":trace_processor_py",
+ ],
+ imports = [
+ "tools/slice_breakdown",
+ ],
+)
+
+perfetto_py_binary(
+ name = "experimental_slice_breakdown_bin",
+ srcs = glob(["tools/slice_breakdown/main.py"]),
+ main = "tools/slice_breakdown/main.py",
+ deps = [
+ ":experimental_slice_breakdown_lib",
+ ":trace_processor_py",
+ ],
+ python_version = "PY3",
+ legacy_create_init = 0,
+)