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

CNF-13015: Add helper function to run lscpu and parse result using regex parameters #638

Conversation

fontivan
Copy link
Contributor

  • This is similar to the cpuinfo function that reads from /proc/cpuinfo
  • Unfortunately that function was insufficient for our needs as we need to identify both the Vendor and Architecture reliably

fontivan added 2 commits June 10, 2024 11:35
…regex parameters

- This is similar to the cpuinfo function that reads from /proc/cpuinfo
- Unfortunately that function was insufficient for our needs as we need to identify both the Vendor and Architecture reliably
@fontivan fontivan changed the title CNF-13015: Add helper function to run lscpu and parse result using egex parameters CNF-13015: Add helper function to run lscpu and parse result using regex parameters Jun 12, 2024
@fontivan fontivan marked this pull request as ready for review June 12, 2024 18:41
if not super(lscpu_check, self).execute(args):
return None
# Stdout is the 2nd result from the execute call
_, lscpu = self._cmd.execute("lscpu")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could also check the return code here and potentially raise an exception though I'm not sure if its required

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it maybe OK as it is. You should see the error output in the TuneD log and in case of error it will substitute empty string.

@yarda
Copy link
Contributor

yarda commented Jun 14, 2024

Thanks, I think we can have this function. I am now @ DevConf, I will handle this during next week.

@fontivan
Copy link
Contributor Author

fontivan commented Jul 3, 2024

@yarda any update for this?

if not super(lscpu_check, self).execute(args):
return None
# Stdout is the 2nd result from the execute call
_, lscpu = self._cmd.execute("lscpu")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it maybe OK as it is. You should see the error output in the TuneD log and in case of error it will substitute empty string.

@yarda yarda merged commit 3ea853b into redhat-performance:master Jul 15, 2024
14 checks passed
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.

2 participants