Skip to content

Commit

Permalink
Merge "wattson: Fix estimates when entire CPU track missing" into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Wu authored and Gerrit Code Review committed Nov 18, 2024
2 parents 1bddf1c + 1290ac2 commit 65df182
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
14 changes: 13 additions & 1 deletion src/trace_processor/perfetto_sql/stdlib/wattson/cpu_freq.sql
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,16 @@ SELECT
freq,
cpu,
policy
FROM _cpu_freq;
FROM _cpu_freq
UNION ALL
-- Add empty cpu freq counters for CPUs that are physically present, but did not
-- have a single freq event register. The time region needs to be defined so
-- that interval_intersect doesn't remove the undefined time region.
SELECT
trace_start() as ts,
trace_dur() as dur,
NULL as freq,
cpu,
NULL as policy
FROM _dev_cpu_policy_map
WHERE cpu NOT IN (SELECT cpu FROM first_cpu_freq_slices);
13 changes: 12 additions & 1 deletion src/trace_processor/perfetto_sql/stdlib/wattson/cpu_idle.sql
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,15 @@ SELECT
idle
FROM _cpu_idle
-- Some durations are 0 post-adjustment and won't work with interval intersect
WHERE dur > 0;
WHERE dur > 0
UNION ALL
-- Add empty cpu idle counters for CPUs that are physically present, but did not
-- have a single idle event register. The time region needs to be defined so
-- that interval_intersect doesn't remove the undefined time region.
SELECT
trace_start() as ts,
trace_dur() as dur,
cpu,
NULL as idle
FROM _dev_cpu_policy_map
WHERE cpu NOT IN (SELECT cpu FROM first_cpu_idle_slices);

0 comments on commit 65df182

Please sign in to comment.