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

Linux: show the CPU scaling governor with $cpugovernor #1223

Merged
merged 3 commits into from
Sep 24, 2022

Conversation

pghvlaans
Copy link
Contributor

Descriptions

  • For Linux, display the CPU scaling governor for any thread with a variable $cpugovernor. This will help users who change their scaling governors on the fly to keep track of what they're doing.
  • No existing behavior is changed.
  • I tested $cpugovernor with various combinations of CPU scheduling governors, as well as the default value (cpu0) and invalid values (which revert to the default).
  • Screenshot:
    cpugovernors

Licenses

  • There are no new files.

@netlify
Copy link

netlify bot commented Sep 24, 2022

Deploy Preview for lambent-marshmallow-4057de failed.

Name Link
🔨 Latest commit fa671d7
🔍 Latest deploy log https://app.netlify.com/sites/lambent-marshmallow-4057de/deploys/632f225bd1effe00094f9376

@su8
Copy link
Collaborator

su8 commented Sep 24, 2022

atoi can introduce undefined behaviour to conky, replace it with strtol

@pghvlaans
Copy link
Contributor Author

It works with strtol. Everything else in core.cc uses atoi, though.

@brndnmtthws
Copy link
Owner

It works with strtol. Everything else in core.cc uses atoi, though.

I understand there's a lot of existing crufty bits in the code, but if you're adding new code it's preferred to use C functions that (at a minimum) reduce the possibility of bugs such as reading past the end of buffers.

@pghvlaans
Copy link
Contributor Author

OK, understood! I'll go ahead and push.

Copy link
Owner

@brndnmtthws brndnmtthws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thank you kindly.

@brndnmtthws brndnmtthws merged commit 37c6831 into brndnmtthws:main Sep 24, 2022
@pghvlaans pghvlaans deleted the linux-cpu-scaling-governor branch September 24, 2022 16:12
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.

3 participants