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
42a34570
Commit
42a34570
authored
Jun 24, 2021
by
Dominic Hamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prefix VLOG
parent
6a5bf081
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
11 deletions
+12
-11
benchmark_runner.cc
src/benchmark_runner.cc
+4
-4
log.h
src/log.h
+1
-1
output_test_helper.cc
test/output_test_helper.cc
+7
-6
No files found.
src/benchmark_runner.cc
View file @
42a34570
...
...
@@ -175,7 +175,7 @@ BenchmarkRunner::BenchmarkRunner(
}
BenchmarkRunner
::
IterationResults
BenchmarkRunner
::
DoNIterations
()
{
VLOG
(
2
)
<<
"Running "
<<
b
.
name
().
str
()
<<
" for "
<<
iters
<<
"
\n
"
;
BM_
VLOG
(
2
)
<<
"Running "
<<
b
.
name
().
str
()
<<
" for "
<<
iters
<<
"
\n
"
;
std
::
unique_ptr
<
internal
::
ThreadManager
>
manager
;
manager
.
reset
(
new
internal
::
ThreadManager
(
b
.
threads
()));
...
...
@@ -210,8 +210,8 @@ BenchmarkRunner::IterationResults BenchmarkRunner::DoNIterations() {
// If we were measuring whole-process CPU usage, adjust the CPU time too.
if
(
b
.
measure_process_cpu_time
())
i
.
results
.
cpu_time_used
/=
b
.
threads
();
VLOG
(
2
)
<<
"Ran in "
<<
i
.
results
.
cpu_time_used
<<
"/"
<<
i
.
results
.
real_time_used
<<
"
\n
"
;
BM_
VLOG
(
2
)
<<
"Ran in "
<<
i
.
results
.
cpu_time_used
<<
"/"
<<
i
.
results
.
real_time_used
<<
"
\n
"
;
// By using KeepRunningBatch a benchmark can iterate more times than
// requested, so take the iteration count from i.results.
...
...
@@ -249,7 +249,7 @@ IterationCount BenchmarkRunner::PredictNumItersNeeded(
// But we do have *some* sanity limits though..
const
IterationCount
next_iters
=
std
::
min
(
max_next_iters
,
kMaxIterations
);
VLOG
(
3
)
<<
"Next iters: "
<<
next_iters
<<
", "
<<
multiplier
<<
"
\n
"
;
BM_
VLOG
(
3
)
<<
"Next iters: "
<<
next_iters
<<
", "
<<
multiplier
<<
"
\n
"
;
return
next_iters
;
// round up before conversion to integer.
}
...
...
src/log.h
View file @
42a34570
...
...
@@ -67,7 +67,7 @@ inline LogType& GetLogInstanceForLevel(int level) {
}
// end namespace benchmark
// clang-format off
#define VLOG(x) \
#define
BM_
VLOG(x) \
(::benchmark::internal::GetLogInstanceForLevel(x) << "-- LOG(" << x << "):" \
" ")
// clang-format on
...
...
test/output_test_helper.cc
View file @
42a34570
...
...
@@ -10,6 +10,7 @@
#include "../src/benchmark_api_internal.h"
#include "../src/check.h" // NOTE: check.h is for internal use only!
#include "../src/log.h" // NOTE: log.h is for internal use only
#include "../src/re.h" // NOTE: re.h is for internal use only
#include "output_test.h"
...
...
@@ -237,18 +238,18 @@ void ResultsChecker::CheckResults(std::stringstream& output) {
}
// finally we can call the subscribed check functions
for
(
const
auto
&
p
:
check_patterns
)
{
VLOG
(
2
)
<<
"--------------------------------
\n
"
;
VLOG
(
2
)
<<
"checking for benchmarks matching "
<<
p
.
regex_str
<<
"...
\n
"
;
BM_
VLOG
(
2
)
<<
"--------------------------------
\n
"
;
BM_
VLOG
(
2
)
<<
"checking for benchmarks matching "
<<
p
.
regex_str
<<
"...
\n
"
;
for
(
const
auto
&
r
:
results
)
{
if
(
!
p
.
regex
->
Match
(
r
.
name
))
{
VLOG
(
2
)
<<
p
.
regex_str
<<
" is not matched by "
<<
r
.
name
<<
"
\n
"
;
BM_
VLOG
(
2
)
<<
p
.
regex_str
<<
" is not matched by "
<<
r
.
name
<<
"
\n
"
;
continue
;
}
else
{
VLOG
(
2
)
<<
p
.
regex_str
<<
" is matched by "
<<
r
.
name
<<
"
\n
"
;
BM_
VLOG
(
2
)
<<
p
.
regex_str
<<
" is matched by "
<<
r
.
name
<<
"
\n
"
;
}
VLOG
(
1
)
<<
"Checking results of "
<<
r
.
name
<<
": ...
\n
"
;
BM_
VLOG
(
1
)
<<
"Checking results of "
<<
r
.
name
<<
": ...
\n
"
;
p
.
fn
(
r
);
VLOG
(
1
)
<<
"Checking results of "
<<
r
.
name
<<
": OK.
\n
"
;
BM_
VLOG
(
1
)
<<
"Checking results of "
<<
r
.
name
<<
": OK.
\n
"
;
}
}
}
...
...
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