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
930d3af0
Commit
930d3af0
authored
Feb 10, 2016
by
Elliott Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ARM /proc/cpuinfo parsing.
Also fix related warning message typos.
parent
cd525ae8
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 @
930d3af0
...
@@ -37,7 +37,7 @@ bool ConsoleReporter::ReportContext(const Context& context) {
...
@@ -37,7 +37,7 @@ bool ConsoleReporter::ReportContext(const Context& context) {
if
(
context
.
cpu_scaling_enabled
)
{
if
(
context
.
cpu_scaling_enabled
)
{
std
::
cerr
<<
"***WARNING*** CPU scaling is enabled, the benchmark "
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
"
;
"overhead.
\n
"
;
}
}
...
...
src/csv_reporter.cc
View file @
930d3af0
...
@@ -34,7 +34,7 @@ bool CSVReporter::ReportContext(const Context& context) {
...
@@ -34,7 +34,7 @@ bool CSVReporter::ReportContext(const Context& context) {
if
(
context
.
cpu_scaling_enabled
)
{
if
(
context
.
cpu_scaling_enabled
)
{
std
::
cerr
<<
"***WARNING*** CPU scaling is enabled, the benchmark "
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
"
;
"overhead.
\n
"
;
}
}
...
...
src/sysinfo.cc
View file @
930d3af0
...
@@ -174,12 +174,16 @@ void InitializeSystemInfo() {
...
@@ -174,12 +174,16 @@ void InitializeSystemInfo() {
if
(
freqstr
[
1
]
!=
'\0'
&&
*
err
==
'\0'
&&
bogo_clock
>
0
)
if
(
freqstr
[
1
]
!=
'\0'
&&
*
err
==
'\0'
&&
bogo_clock
>
0
)
saw_bogo
=
true
;
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
num_cpus
++
;
// count up every time we see an "processor :" entry
const
char
*
freq
str
=
strchr
(
line
,
':'
);
const
char
*
id_
str
=
strchr
(
line
,
':'
);
if
(
freq
str
)
{
if
(
id_
str
)
{
const
long
cpu_id
=
strtol
(
freq
str
+
1
,
&
err
,
10
);
const
long
cpu_id
=
strtol
(
id_
str
+
1
,
&
err
,
10
);
if
(
freq
str
[
1
]
!=
'\0'
&&
*
err
==
'\0'
&&
max_cpu_id
<
cpu_id
)
if
(
id_
str
[
1
]
!=
'\0'
&&
*
err
==
'\0'
&&
max_cpu_id
<
cpu_id
)
max_cpu_id
=
cpu_id
;
max_cpu_id
=
cpu_id
;
}
}
}
}
...
@@ -201,7 +205,7 @@ void InitializeSystemInfo() {
...
@@ -201,7 +205,7 @@ void InitializeSystemInfo() {
}
else
{
}
else
{
if
((
max_cpu_id
+
1
)
!=
num_cpus
)
{
if
((
max_cpu_id
+
1
)
!=
num_cpus
)
{
fprintf
(
stderr
,
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
"
);
" This is usually caused by a bad BIOS.
\n
"
);
}
}
cpuinfo_num_cpus
=
num_cpus
;
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