Commit graph

17 commits

Author SHA1 Message Date
Vy Nguyen 91ed7eea68
Disable clang-tidy (unused-using-decls) (#1287)
The NOLINTBEGIN block only covers warnings on `long` types and other styling issues but not clang-tidies.
2021-11-19 11:12:59 +00:00
Vy Nguyen 8722d6f014
disable lint check where we know it'd fail (#1286)
* disable lint check where we know it'd fail

one less noisy presubmit

* clang format

* remove ws
2021-11-17 17:57:36 +00:00
Dominic Hamon fcef4fb669
clang-format Google on {src/,include/} (#1280) 2021-11-10 16:04:32 +00:00
Mircea Trofin 376ebc2635
Support optional, user-directed collection of performance counters (#1114)
* Support optional, user-directed collection of performance counters

The patch allows an engineer wishing to drill into the root causes
of a regression, for example. Currently, only single threaded runs
are supported. The feature is a build-time opt in, and then a runtime
opt in.

The engineer may run the benchmark executable, passing a list of
performance counter names (using libpfm's naming scheme) at the
command line. The counter values will then be collected and reported
back as UserCounters.

This is different from #240 in that it is a benchmark user opt-in, and
the counter collection is transparent to the benchmark.

Currently, this is only supported on platforms where libpfm is
supported.

libpfm: http://perfmon2.sourceforge.net/

* 'Use' values param in Snapshot when BENCHMARK_OS_WINDOWS

This is to avoid unused parameter warning-as-error

* Added missing include for <vector> in perf_counters.cc

* Moved doc to docs

* Added license blurbs
2021-04-28 09:25:29 +01:00
Michael Tesch 588be0446a escape special chars in csv and json output. (#802)
* escape special chars in csv and json output.

- escape \b,\f,\n,\r,\t,\," from strings before dumping
  them to json or csv.
- also faithfully reproduce the sign of nan in json.
this fixes github issue #745.

* functionalize.

* split string escape functions between csv and json

* Update src/csv_reporter.cc

Co-Authored-By: tesch1 <tesch1@gmail.com>

* Update src/json_reporter.cc

Co-Authored-By: tesch1 <tesch1@gmail.com>
2019-04-19 18:47:25 +01:00
Daniel Harvey e3666568a9 Negative ranges #762 (#787)
* Add FIXME in multiple_ranges_test.cc

* Improve handling of large bounds in AddRange.

Due to breaking the loop too early, AddRange
would miss a final multplier of 'mult' that
was within the numeric range of T.

* Enable negative values for Range argument

Fixes #762.

* Try to fix build of benchmark_gtest

* Try some more to fix build

* Attempt to fix format macros

* Attempt to resolve format errors for mingw32

* Review feedback

Put unit tests in benchmark::internal namespace

Fix error reporting in multiple_ranges_test.cc
2019-03-26 10:50:53 +00:00
Roman Lebedev c9f2693ea9 StrFormat() is a printf-like function, mark it as such, fix fallout. (#727)
Fixes #714.
2018-11-26 19:55:05 -05:00
Marat Dukhan 7fb3c564e5 Fix compilation on Android with GNU STL (#596)
* Fix compilation on Android with GNU STL

GNU STL in Android NDK lacks string conversion functions from C++11, including std::stoul, std::stoi, and std::stod.
This patch reimplements these functions in benchmark:: namespace using C-style equivalents from C++03.

* Avoid use of log2 which doesn't exist in Android GNU STL

GNU STL in Android NDK lacks log2 function from C99/C++11.
This patch replaces their use in the code with double log(double) function.
2018-06-05 11:36:26 +01:00
BaaMeow 4c2af07889 (clang-)format all the things (#610)
* format all documents according to contributor guidelines and specifications
use clang-format on/off to stop formatting when it makes excessively poor decisions

* format all tests as well, and mark blocks which change too much
2018-06-01 11:14:19 +01:00
Wink Saville 61497236dd Make string_util naming more consistent (#547)
* Rename StringXxx to StrXxx in string_util.h and its users

This makes the naming consistent within string_util and moves is the
Abseil convention.

* Style guide is 2 spaces before end of line "//" comments

* Rename StrPrintF/StringPrintF to StrFormat for absl compatibility.
2018-03-07 11:20:06 +00:00
Dominic Hamon d70417994a Allow the definition of 1k to be flexible. (#438)
When generating a human-readable number for user counters, we don't
generally expect 1k to be 1024. This is the default due to the more
general purpose string utility.

Fixes #437
2017-08-21 16:05:24 -07:00
Dominic Hamon 332f677b8b Apply clang-format to all headers and source (#303) 2016-10-07 11:35:03 -07:00
Jean-Louis Leroy d49516bc99 Make it compile with Visual Studio 2013. 2015-09-03 15:11:09 -04:00
Dominic Hamon 680a399a93 Add double-quotes where necessary 2015-03-27 14:07:23 -07:00
Eric Fiselier 75686a8f22 remove forward declarations 2015-03-09 18:00:04 -04:00
Eric Fiselier 60e26b7022 fix missing newline and header guard name 2015-03-09 16:18:10 -04:00
Eric Fiselier a187aa0803 Third step in moving towards adopting new timer semantics 2015-03-06 17:01:05 -05:00