-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 parsing of cpuinfo for s390 platform. #712
Conversation
s390 has another line structure for processor-field. It should be differently parsed.
✅ Build benchmark 1541 completed (commit 5d44fa5500 by @gladk) |
src/sysinfo.cc
Outdated
@@ -404,7 +404,11 @@ int GetNumCPUs() { | |||
if (ln.empty()) continue; | |||
size_t SplitIdx = ln.find(':'); | |||
std::string value; | |||
#if defined(__s390__) | |||
if (SplitIdx != std::string::npos) value = ln.substr(SplitIdx - 1, 2); |
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.
Does this put a limit on the length of cpu number?
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.
Also, no sysctl?
@LebedevRI thanks for the valuable comment. I improved the line which extracts the processor number. Now it works for any number of CPUs. |
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.
Only the s390 should be affected, so LG.
✅ Build benchmark 1542 completed (commit 1e3ccc8991 by @gladk) |
s390 has another line structure for processor-field. It should be differently parsed.
s390 has another line structure for processor-field. It should be differently parsed.
s390 has another line structure for processor-field.
It should be differently parsed.
Should fix #711