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
cff1541b
Commit
cff1541b
authored
Feb 13, 2016
by
Dominic Hamon
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #177 from enh/cpuinfo-arm
Fix ARM /proc/cpuinfo parsing.
parents
1c4df750
930d3af0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
+12
-8
console_reporter.cc
src/console_reporter.cc
+1
-1
csv_reporter.cc
src/csv_reporter.cc
+1
-1
sysinfo.cc
src/sysinfo.cc
+10
-6
No files found.
src/console_reporter.cc
View file @
cff1541b
...
...
@@ -37,7 +37,7 @@ bool ConsoleReporter::ReportContext(const Context& context) {
if
(
context
.
cpu_scaling_enabled
)
{
std
::
cerr
<<
"***WARNING*** CPU scaling is enabled, the benchmark "
"real time measurements may be noisy and will incur
e
extra "
"real time measurements may be noisy and will incur extra "
"overhead.
\n
"
;
}
...
...
src/csv_reporter.cc
View file @
cff1541b
...
...
@@ -34,7 +34,7 @@ bool CSVReporter::ReportContext(const Context& context) {
if
(
context
.
cpu_scaling_enabled
)
{
std
::
cerr
<<
"***WARNING*** CPU scaling is enabled, the benchmark "
"real time measurements may be noisy and will incur
e
extra "
"real time measurements may be noisy and will incur extra "
"overhead.
\n
"
;
}
...
...
src/sysinfo.cc
View file @
cff1541b
...
...
@@ -174,12 +174,16 @@ void InitializeSystemInfo() {
if
(
freqstr
[
1
]
!=
'\0'
&&
*
err
==
'\0'
&&
bogo_clock
>
0
)
saw_bogo
=
true
;
}
}
else
if
(
strncasecmp
(
line
,
"processor"
,
sizeof
(
"processor"
)
-
1
)
==
0
)
{
}
else
if
(
strncmp
(
line
,
"processor"
,
sizeof
(
"processor"
)
-
1
)
==
0
)
{
// The above comparison is case-sensitive because ARM kernels often
// include a "Processor" line that tells you about the CPU, distinct
// from the usual "processor" lines that give you CPU ids. No current
// Linux architecture is using "Processor" for CPU ids.
num_cpus
++
;
// count up every time we see an "processor :" entry
const
char
*
freq
str
=
strchr
(
line
,
':'
);
if
(
freq
str
)
{
const
long
cpu_id
=
strtol
(
freq
str
+
1
,
&
err
,
10
);
if
(
freq
str
[
1
]
!=
'\0'
&&
*
err
==
'\0'
&&
max_cpu_id
<
cpu_id
)
const
char
*
id_
str
=
strchr
(
line
,
':'
);
if
(
id_
str
)
{
const
long
cpu_id
=
strtol
(
id_
str
+
1
,
&
err
,
10
);
if
(
id_
str
[
1
]
!=
'\0'
&&
*
err
==
'\0'
&&
max_cpu_id
<
cpu_id
)
max_cpu_id
=
cpu_id
;
}
}
...
...
@@ -201,7 +205,7 @@ void InitializeSystemInfo() {
}
else
{
if
((
max_cpu_id
+
1
)
!=
num_cpus
)
{
fprintf
(
stderr
,
"CPU ID assignments in /proc/cpuinfo seem
s
messed up."
"CPU ID assignments in /proc/cpuinfo seem messed up."
" This is usually caused by a bad BIOS.
\n
"
);
}
cpuinfo_num_cpus
=
num_cpus
;
...
...
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