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
5da56604
Unverified
Commit
5da56604
authored
Jun 24, 2021
by
Dominic Hamon
Committed by
GitHub
Jun 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move flags inside the `benchmark` namespace (#1185)
This avoids clashes with other libraries that might define the same flags.
parent
62937f91
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
13 deletions
+11
-13
benchmark.cc
src/benchmark.cc
+7
-6
benchmark_runner.h
src/benchmark_runner.h
+2
-6
benchmark_random_interleaving_gtest.cc
test/benchmark_random_interleaving_gtest.cc
+2
-1
No files found.
src/benchmark.cc
View file @
5da56604
...
...
@@ -56,6 +56,7 @@
#include "thread_manager.h"
#include "thread_timer.h"
namespace
benchmark
{
// Print a list of benchmarks. This option overrides all other options.
DEFINE_bool
(
benchmark_list_tests
,
false
);
...
...
@@ -112,20 +113,19 @@ DEFINE_string(benchmark_color, "auto");
// Valid values: 'true'/'yes'/1, 'false'/'no'/0. Defaults to false.
DEFINE_bool
(
benchmark_counters_tabular
,
false
);
// The level of verbose logging to output
DEFINE_int32
(
v
,
0
);
// List of additional perf counters to collect, in libpfm format. For more
// information about libpfm: https://man7.org/linux/man-pages/man3/libpfm.3.html
DEFINE_string
(
benchmark_perf_counters
,
""
);
namespace
benchmark
{
namespace
internal
{
// Extra context to include in the output formatted as comma-separated key-value
// pairs. Kept internal as it's only used for parsing from env/command line.
DEFINE_kvpairs
(
benchmark_context
,
{});
// The level of verbose logging to output
DEFINE_int32
(
v
,
0
);
namespace
internal
{
std
::
map
<
std
::
string
,
std
::
string
>*
global_context
=
nullptr
;
// FIXME: wouldn't LTO mess this up?
...
...
@@ -530,6 +530,7 @@ void PrintUsageAndExit() {
" [--benchmark_out_format=<json|console|csv>]
\n
"
" [--benchmark_color={auto|true|false}]
\n
"
" [--benchmark_counters_tabular={true|false}]
\n
"
" [--benchmark_perf_counters=<counter>,...]
\n
"
" [--benchmark_context=<key>=<value>,...]
\n
"
" [--v=<verbosity>]
\n
"
);
exit
(
0
);
...
...
src/benchmark_runner.h
View file @
5da56604
...
...
@@ -23,18 +23,14 @@
#include "perf_counters.h"
#include "thread_manager.h"
DECLARE_double
(
benchmark_min_time
);
namespace
benchmark
{
DECLARE_double
(
benchmark_min_time
);
DECLARE_int32
(
benchmark_repetitions
);
DECLARE_bool
(
benchmark_report_aggregates_only
);
DECLARE_bool
(
benchmark_display_aggregates_only
);
DECLARE_string
(
benchmark_perf_counters
);
namespace
benchmark
{
namespace
internal
{
extern
MemoryManager
*
memory_manager
;
...
...
test/benchmark_random_interleaving_gtest.cc
View file @
5da56604
...
...
@@ -8,11 +8,12 @@
#include "gmock/gmock.h"
#include "gtest/gtest.h"
namespace
benchmark
{
DECLARE_bool
(
benchmark_enable_random_interleaving
);
DECLARE_string
(
benchmark_filter
);
DECLARE_int32
(
benchmark_repetitions
);
namespace
benchmark
{
namespace
internal
{
namespace
{
...
...
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