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 parsing of cpuinfo for s390 platform. #712

Merged
merged 2 commits into from
Oct 21, 2018

Conversation

gladk
Copy link
Contributor

@gladk gladk commented Oct 20, 2018

s390 has another line structure for processor-field.
It should be differently parsed.

Should fix #711

s390 has another line structure for processor-field.
It should be differently parsed.
@coveralls
Copy link

coveralls commented Oct 20, 2018

Coverage Status

Coverage remained the same at 89.224% when pulling e095f44 on gladk:fix/s390_cpuinfo_parser into 507c06e on google:master.

@AppVeyorBot
Copy link

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);
Copy link
Collaborator

@LebedevRI LebedevRI Oct 21, 2018

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?

Copy link
Collaborator

@LebedevRI LebedevRI left a comment

Choose a reason for hiding this comment

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

Also, no sysctl?

@gladk
Copy link
Contributor Author

gladk commented Oct 21, 2018

@LebedevRI thanks for the valuable comment. I improved the line which extracts the processor number. Now it works for any number of CPUs.

Copy link
Collaborator

@LebedevRI LebedevRI left a 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.

@AppVeyorBot
Copy link

Build benchmark 1542 completed (commit 1e3ccc8991 by @gladk)

@LebedevRI LebedevRI merged commit c6193af into google:master Oct 21, 2018
EricWF pushed a commit to efcs/benchmark that referenced this pull request Nov 29, 2018
s390 has another line structure for processor-field.
It should be differently parsed.
JBakamovic pushed a commit to JBakamovic/benchmark that referenced this pull request Dec 6, 2018
s390 has another line structure for processor-field.
It should be differently parsed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

version 1.4.1 is broken on s390x
5 participants