Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
benchmark
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
benchmark
Commits
c6193afe
Commit
c6193afe
authored
Oct 21, 2018
by
Anton Gladky
Committed by
Roman Lebedev
Oct 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix parsing of cpuinfo for s390 platform. (#712)
s390 has another line structure for processor-field. It should be differently parsed.
parent
507c06e6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
sysinfo.cc
src/sysinfo.cc
+6
-0
No files found.
src/sysinfo.cc
View file @
c6193afe
...
...
@@ -404,7 +404,13 @@ int GetNumCPUs() {
if
(
ln
.
empty
())
continue
;
size_t
SplitIdx
=
ln
.
find
(
':'
);
std
::
string
value
;
#if defined(__s390__)
// s390 has another format in /proc/cpuinfo
// it needs to be parsed differently
if
(
SplitIdx
!=
std
::
string
::
npos
)
value
=
ln
.
substr
(
Key
.
size
()
+
1
,
SplitIdx
-
Key
.
size
()
-
1
);
#else
if
(
SplitIdx
!=
std
::
string
::
npos
)
value
=
ln
.
substr
(
SplitIdx
+
1
);
#endif
if
(
ln
.
size
()
>=
Key
.
size
()
&&
ln
.
compare
(
0
,
Key
.
size
(),
Key
)
==
0
)
{
NumCPUs
++
;
if
(
!
value
.
empty
())
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment