Skip to content
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

Show total CPU usage by all processes, instead of LVGL alone #2

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jsuhaas22
Copy link
Collaborator

Currently, LVGL calculates only the CPU utilization done by itself. This PR changes this to return the total CPU usage by all processes running on the SoC.

@jsuhaas22 jsuhaas22 marked this pull request as draft January 23, 2025 10:33
@jsuhaas22
Copy link
Collaborator Author

Will push DDR stuff to this PR too.

Presently, it *seems* like the demo shows CPU utilization. However, it
actually only shows the percentage of the CPU utilized by the demo
alone, instead of the total CPU usage by all running processes. This
functionality was built for MCU devices, wherein there's usually only a
single thread running at a given time, but it fails in
application-level processors that run Linux.

Therefore implement functions that show full CPU usage. These functions
read /proc/stat, and maintain the results of the previous read. They use
the values read in the current invocation with those stored by the
previous to determine the total CPU usage.

Signed-off-by: Suhaas Joshi <[email protected]>
The macro LV_SYSMON_GET_IDLE, defined in /lv_port_linux/lv_conf.h,
defines the function responsible for returning CPU usage. Presently, it
specifies lv_timer_get_idle() as the function for the job.

Therefore edit this function to return ti_get_cpu_load()'s value. This
returns the total CPU usage across all cores, instead of returning the
usage by the demo alone. See d3a3f97 for details.

Signed-off-by: Suhaas Joshi <[email protected]>
@jsuhaas22 jsuhaas22 force-pushed the ti-correct-cpu-util branch from 7732204 to 4b00931 Compare February 3, 2025 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant