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

Fix sysinfo CPU brand output #11850

Merged
merged 1 commit into from
Feb 13, 2024
Merged

Conversation

Friz64
Copy link
Contributor

@Friz64 Friz64 commented Feb 13, 2024

Objective

sysinfo was updated to 0.30 in #11071. Ever since then the cpu field of the SystemInfo struct that gets printed every time one starts an bevy app has been empty. This is because the following part of the sysinfo migration guide was overlooked:


Cpu changes

Information like Cpu::brand, Cpu::vendor_id or Cpu::frequency are not set on the "global" CPU.


Solution

  • Get the CPU brand information from a specific CPU instead. In this case, just choose the first one. It's theoretically possible for different CPUs to have different names, but in practice this doesn't really happen I think. Even Intel's newer hybrid processors use a uniform name for all CPUs in my experience.
  • We can use this opportunity to also update our sysinfo::System initialization here to only fetch the information we're interested in.

Copy link
Contributor

@rparrett rparrett left a comment

Choose a reason for hiding this comment

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

Looks good / works for me.

@rparrett rparrett added C-Bug An unexpected or incorrect behavior A-Diagnostics Logging, crash handling, error reporting and performance analysis labels Feb 13, 2024
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

Nice catch!

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Feb 13, 2024
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Feb 13, 2024
Merged via the queue into bevyengine:main with commit 77c26f6 Feb 13, 2024
27 checks passed
@Friz64 Friz64 deleted the cpu-brand-fix branch February 13, 2024 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Diagnostics Logging, crash handling, error reporting and performance analysis C-Bug An unexpected or incorrect behavior S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants