Skip to content

Commit

Permalink
stdlib: Refactor Wattson s/ungrouped.sql/estimates.sql
Browse files Browse the repository at this point in the history
Clean up file name to be more immediately understandable for what the
module's intended to do.

Bug: 370829192
Test: tools/diff_test_trace_processor.py out/linux/trace_processor_shell --name-filter '.*wattson.*'
Change-Id: If285ae881e27c862df2ea5082b81ec3d292fe477
Signed-off-by: Samuel Wu <[email protected]>
Samuel Wu committed Oct 14, 2024
1 parent a753766 commit 24764a1
Showing 15 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Android.bp
Original file line number Diff line number Diff line change
@@ -13667,8 +13667,8 @@ genrule {
"src/trace_processor/perfetto_sql/stdlib/wattson/cpu_idle.sql",
"src/trace_processor/perfetto_sql/stdlib/wattson/cpu_split.sql",
"src/trace_processor/perfetto_sql/stdlib/wattson/curves/device.sql",
"src/trace_processor/perfetto_sql/stdlib/wattson/curves/estimates.sql",
"src/trace_processor/perfetto_sql/stdlib/wattson/curves/idle_attribution.sql",
"src/trace_processor/perfetto_sql/stdlib/wattson/curves/ungrouped.sql",
"src/trace_processor/perfetto_sql/stdlib/wattson/curves/utils.sql",
"src/trace_processor/perfetto_sql/stdlib/wattson/device_infos.sql",
"src/trace_processor/perfetto_sql/stdlib/wattson/system_state.sql",
2 changes: 1 addition & 1 deletion BUILD
Original file line number Diff line number Diff line change
@@ -3078,8 +3078,8 @@ perfetto_filegroup(
"src/trace_processor/perfetto_sql/stdlib/wattson/cpu_idle.sql",
"src/trace_processor/perfetto_sql/stdlib/wattson/cpu_split.sql",
"src/trace_processor/perfetto_sql/stdlib/wattson/curves/device.sql",
"src/trace_processor/perfetto_sql/stdlib/wattson/curves/estimates.sql",
"src/trace_processor/perfetto_sql/stdlib/wattson/curves/idle_attribution.sql",
"src/trace_processor/perfetto_sql/stdlib/wattson/curves/ungrouped.sql",
"src/trace_processor/perfetto_sql/stdlib/wattson/curves/utils.sql",
"src/trace_processor/perfetto_sql/stdlib/wattson/device_infos.sql",
"src/trace_processor/perfetto_sql/stdlib/wattson/system_state.sql",
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
-- See the License for the specific language governing permissions and
-- limitations under the License.

INCLUDE PERFETTO MODULE wattson.curves.ungrouped;
INCLUDE PERFETTO MODULE wattson.curves.estimates;

DROP VIEW IF EXISTS _wattson_period_windows;
CREATE PERFETTO VIEW _wattson_period_windows AS
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
-- See the License for the specific language governing permissions and
-- limitations under the License.

INCLUDE PERFETTO MODULE wattson.curves.ungrouped;
INCLUDE PERFETTO MODULE wattson.curves.estimates;
INCLUDE PERFETTO MODULE viz.summary.threads_w_processes;

DROP VIEW IF EXISTS _wattson_period_windows;
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
-- This file established the tables that define the relationships between rails
-- and subrails as well as the hierarchical power estimates of each rail

INCLUDE PERFETTO MODULE wattson.curves.ungrouped;
INCLUDE PERFETTO MODULE wattson.curves.estimates;

-- Take only the Wattson estimations that are in the window of interest
DROP TABLE IF EXISTS _windowed_wattson;
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
-- See the License for the specific language governing permissions and
-- limitations under the License.

INCLUDE PERFETTO MODULE wattson.curves.ungrouped;
INCLUDE PERFETTO MODULE wattson.curves.estimates;
INCLUDE PERFETTO MODULE viz.summary.threads_w_processes;

-- Take only the Wattson estimations that are in the window of interest
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
-- See the License for the specific language governing permissions and
-- limitations under the License.

INCLUDE PERFETTO MODULE wattson.curves.ungrouped;
INCLUDE PERFETTO MODULE wattson.curves.estimates;

-- The power calculations need to use the same time period in which energy
-- calculations were made for consistency
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
-- See the License for the specific language governing permissions and
-- limitations under the License.

INCLUDE PERFETTO MODULE wattson.curves.ungrouped;
INCLUDE PERFETTO MODULE wattson.curves.estimates;
INCLUDE PERFETTO MODULE viz.summary.threads_w_processes;

DROP VIEW IF EXISTS _wattson_period_windows;
2 changes: 1 addition & 1 deletion src/trace_processor/perfetto_sql/stdlib/wattson/BUILD.gn
Original file line number Diff line number Diff line change
@@ -22,8 +22,8 @@ perfetto_sql_source_set("wattson") {
"cpu_idle.sql",
"cpu_split.sql",
"curves/device.sql",
"curves/estimates.sql",
"curves/idle_attribution.sql",
"curves/ungrouped.sql",
"curves/utils.sql",
"device_infos.sql",
"system_state.sql",
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
-- limitations under the License.

INCLUDE PERFETTO MODULE intervals.intersect;
INCLUDE PERFETTO MODULE wattson.curves.ungrouped;
INCLUDE PERFETTO MODULE wattson.curves.estimates;

-- Get slice info of threads/processes
CREATE PERFETTO TABLE _thread_process_slices AS
10 changes: 5 additions & 5 deletions test/trace_processor/diff_tests/stdlib/wattson/tests.py
Original file line number Diff line number Diff line change
@@ -200,7 +200,7 @@ def test_wattson_intermediate_table(self):
return DiffTestBlueprint(
trace=DataPath('wattson_dsu_pmu.pb'),
query=("""
INCLUDE PERFETTO MODULE wattson.curves.ungrouped;
INCLUDE PERFETTO MODULE wattson.curves.estimates;
select * from _w_independent_cpus_calc
WHERE ts > 359661672577
ORDER by ts ASC
@@ -225,7 +225,7 @@ def test_wattson_static_curve_selection(self):
return DiffTestBlueprint(
trace=DataPath('wattson_dsu_pmu.pb'),
query=("""
INCLUDE PERFETTO MODULE wattson.curves.ungrouped;
INCLUDE PERFETTO MODULE wattson.curves.estimates;
select * from _system_state_curves
ORDER by ts ASC
LIMIT 5
@@ -244,7 +244,7 @@ def test_wattson_l3_calculations(self):
return DiffTestBlueprint(
trace=DataPath('wattson_dsu_pmu.pb'),
query=("""
INCLUDE PERFETTO MODULE wattson.curves.ungrouped;
INCLUDE PERFETTO MODULE wattson.curves.estimates;
select * from _system_state_curves
WHERE ts > 359661672577
ORDER by ts ASC
@@ -264,7 +264,7 @@ def test_wattson_system_state_mw_calculations(self):
return DiffTestBlueprint(
trace=DataPath('wattson_dsu_pmu.pb'),
query=("""
INCLUDE PERFETTO MODULE wattson.curves.ungrouped;
INCLUDE PERFETTO MODULE wattson.curves.estimates;
select * from _system_state_mw
WHERE ts > 359661672577
ORDER by ts ASC
@@ -289,7 +289,7 @@ def test_wattson_suspend_calculations(self):
return DiffTestBlueprint(
trace=DataPath('wattson_eos_suspend.pb'),
query=("""
INCLUDE PERFETTO MODULE wattson.curves.ungrouped;
INCLUDE PERFETTO MODULE wattson.curves.estimates;
select * from _system_state_curves
WHERE ts > 24790009884888
ORDER by ts ASC
2 changes: 1 addition & 1 deletion ui/src/plugins/wattson/estimate_aggregator.ts
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ export class WattsonEstimateSelectionAggregator
): string {
const duration = area.end - area.start;
let query = `
INCLUDE PERFETTO MODULE wattson.curves.ungrouped;
INCLUDE PERFETTO MODULE wattson.curves.estimates;
CREATE OR REPLACE PERFETTO TABLE _ui_selection_window AS
SELECT
2 changes: 1 addition & 1 deletion ui/src/plugins/wattson/index.ts
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ class Wattson implements PerfettoPlugin {
// Short circuit if Wattson is not supported for this Perfetto trace
if (!(await hasWattsonSupport(ctx.engine))) return;

ctx.engine.query(`INCLUDE PERFETTO MODULE wattson.curves.ungrouped;`);
ctx.engine.query(`INCLUDE PERFETTO MODULE wattson.curves.estimates;`);

const group = new TrackNode({title: 'Wattson', isSummary: true});
ctx.workspace.addChildInOrder(group);
2 changes: 1 addition & 1 deletion ui/src/plugins/wattson/thread_aggregator.ts
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ export class WattsonThreadSelectionAggregator
engine.query(`
INCLUDE PERFETTO MODULE viz.summary.threads_w_processes;
INCLUDE PERFETTO MODULE wattson.curves.idle_attribution;
INCLUDE PERFETTO MODULE wattson.curves.ungrouped;
INCLUDE PERFETTO MODULE wattson.curves.estimates;
CREATE OR REPLACE PERFETTO TABLE _ui_selection_window AS
SELECT

0 comments on commit 24764a1

Please sign in to comment.