metrics: Simplify Wattson hierarchy output
Shift from a recursively and generically defined rail and subrail
estimate into one that is explicitly defined. This cleans up the output
to be more readable and simpler. The new format is also easier and more
intuitive to parse with traditional protobuf/JSON parsers.
This requires that the hierarchy be explicitly defined in
wattson_in_time_period.proto, and for the same proto file to maintain a
superset (from all configurations of all possible devices) of all
hierarchies.
Before:
rail {
name: "cpu_subsystem"
estimate_mw: 42.126297
rail {
name: "DSU_SCU"
estimate_mw: 7.404674
}
rail {
name: "policy0"
estimate_mw: 34.721622
rail {
name: "cpu0"
estimate_mw: 10.706565
}
rail {
name: "cpu1"
estimate_mw: 8.314949
}
rail {
name: "cpu2"
estimate_mw: 7.7762628
}
rail {
name: "cpu3"
estimate_mw: 7.9238434
}
}
}
After:
cpu_subsystem {
estimate_mw: 42.126297
policy0 {
estimate_mw: 34.721622
cpu0 {
estimate_mw: 10.706565
}
cpu1 {
estimate_mw: 8.314949
}
cpu2 {
estimate_mw: 7.7762628
}
cpu3 {
estimate_mw: 7.9238434
}
}
dsu_scu {
estimate_mw: 7.404674
}
}
Test: tools/diff_test_trace_processor.py out/linux/trace_processor_shell --name-filter '.*wattson.*'
Bug: 352627297
Change-Id: I58da720a5d8982b5fcd9eb16c24099fe4de3c419
Perfetto is a production-grade open-source stack for performance instrumentation and trace analysis. It offers services and libraries and for recording system-level and app-level traces, native + java heap profiling, a library for analyzing traces using SQL and a web-based UI to visualize and explore multi-GB traces.
See https://perfetto.dev/docs or the /docs/ directory for documentation.