-
Notifications
You must be signed in to change notification settings - Fork 617
Dev/chengxli/cpu uptime calculator #3528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add method to calculate the CPU uptime based on the expected cost to enter into respective C-states
| -- Table which groups scheduling information along with the CPU idle state | ||
| -- information. This is meant to be used in conjunciton with the android_cpu_uptime_cost | ||
| -- calculation macro. | ||
| CREATE PERFETTO TABLE android_active_sched_joined ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really don't like this table name. Please be more descriptive and consistent with the style of the stdlib instead of just calling it "joined"
| -- Calculation: | ||
| -- * Uptime1 (First Process): Sched1_dur + C2_cost + C3_cost | ||
| -- * UptimeN (Subsequent Processes, N > 1): SchedN_dur | ||
| CREATE PERFETTO MACRO android_cpu_uptime_cost( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both uptime and cost are a bit vague here. Uptime means to me device uptime (i.e. time since boot). Now usually I think that word also includes time in suspend (tho I'm not 100% on that).
Can we use better words?
LalitMaganti
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the
| @@ -0,0 +1,195 @@ | |||
| -- | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of this code needs tests.
Adding CPU uptime calculation to the stdlib.
Adding a table and macro which calculates the theoretical CPU uptime cost attributed to each thread/process.
It works by assigning the "cost" (idle duration required) to enter deeper C-states (C2, C3, etc.) to the thread that kept the CPU active during that time, preventing the C-state entry.