Commit Graph

76 Commits

Author SHA1 Message Date
Eric Fiselier
60e26b7022 fix missing newline and header guard name 2015-03-09 16:18:10 -04:00
Eric Fiselier
5cfd6bcc14 update more copyright 2015-03-09 16:15:05 -04:00
Eric Fiselier
8f5cd9760f Merge branch 'upgrade-step2' into upgrade-step3 2015-03-09 16:03:06 -04:00
Eric Fiselier
d20cdf19ca address comments 2015-03-09 15:48:51 -04:00
Eric Fiselier
e60561a779 Force static initialization of walltime. 2015-03-09 14:56:47 -04:00
Eric Fiselier
a187aa0803 Third step in moving towards adopting new timer semantics 2015-03-06 17:01:05 -05:00
Eric Fiselier
f1c398adb4 invert check in GetLogInstanceForLevel() 2015-03-06 14:19:06 -05:00
Eric Fiselier
8ed7d7664b The second step towards merging the timer changes.
This patch does two things:

1. It overhalls the static initialization in Walltime to be simplier. It uses
   a static variable inside WallTime::Now() to initialize the timer.

2. Add a logging mechanism so that the -v flag actually has meaning and
   reimplement the CHECK macros to allow extra messages to be streamed in.
2015-03-06 14:07:24 -05:00
Eric Fiselier
b1f34d3880 address comments 2015-03-06 13:20:47 -05:00
Eric Fiselier
5b41e128b3 Step one towards merging timer changes.
This patch cleans up our use of generic macros and also merges changes in the
build system.

It adds options -DBENCHMARK_ENABLE_TESTING and -DBENCHMARK_ENABLE_SHARED.
2015-03-06 12:35:00 -05:00
Eric
cff940a727 Merge pull request #78 from pdavydov108/master
Fix #77 build on freebsd 10
2015-03-02 20:10:20 +01:00
Eric
5e77de62a1 Merge pull request #76 from google/64-32
One more 64-bit to 32-bit conversion
2015-03-02 17:47:02 +01:00
Pavel Davydov
8e3e78fc3d Fix #77 add comment to headers in wrong order 2015-02-25 10:41:26 +03:00
Pavel Davydov
c8d05fcc96 Fix #77 build on FreeBSD 10 2015-02-21 17:05:13 +03:00
Eric Fiselier
9a11834048 add includes for stdint.h 2015-02-19 16:37:05 -05:00
Dominic Hamon
2789aba1ce One more 64-bit to 32-bit conversion 2015-02-18 22:21:39 -08:00
Dominic Hamon
3968ff45ba Fix #72 by avoiding 64-to-32-bit shortenings 2015-02-18 11:18:40 -08:00
Dominic Hamon
a3b5e44c52 Remove CHECK_* from public API.
CHECK_* are now private and used internally in the library. The test
uses have been replaced with asserts.

Fixes #62.
2014-10-31 21:54:55 -07:00
x.zhou
4a3348ce22 Turn the global mutex into instance variables
To fix #52
2014-10-12 18:01:45 +08:00
Matt Clarkson
f043826542 C++11 regular expressions 2014-08-22 14:55:46 +01:00
Matt Clarkson
fac16a662e CMakeLists.txt comments 2014-08-20 08:42:30 +01:00
Matt Clarkson
373cc41100 C++11 concurrency instead of pthread 2014-08-06 10:50:21 -07:00
Matt Clarkson
57fdf38f74 Allow shared libraries with BUILD_SHARED_LIBS 2014-07-30 18:08:54 +01:00
Lei Xu
3460bf1aa6 Fixed compiling on Mac 10.9.3 with g++-4.8, clang or system c++ 2014-07-24 23:57:09 -07:00
Paul Redmond
b33d1f1d39 fix signed/unsigned comparison warning 2014-07-23 10:35:12 -04:00
pleroy
10dc155372 Fix a bug in the destruction of BenchmarkFamilies. 2014-06-09 13:31:51 +02:00
pleroy
fe1b75b87e Merge branch 'GoogleMaster' into PausePure
Conflicts:
	src/benchmark.cc
2014-06-05 23:02:22 +02:00
pleroy
bcf08705f5 Comment. 2014-06-04 23:17:09 +02:00
pleroy
640dd5a492 Less of a hack: avoid the division/multiplication if the stddev is 0. 2014-06-04 23:13:22 +02:00
pleroy
db4248e21e Merge branch 'TwoBugs' into StatsPure 2014-06-04 22:51:29 +02:00
pleroy
e189ec0283 Print mean/stddev of the # of iterations. 2014-06-04 22:02:28 +02:00
pleroy
0d9a060f5b Two bug fixes in KeepRunning. 2014-06-04 21:21:24 +02:00
pleroy
ec1e09f939 Ignore the CPU time consumed when timing is paused.
Conflicts:
	src/benchmark.cc
2014-05-29 16:01:11 +02:00
pleroy
291ff1faed Fix the stddev/mean computations which had be garbled since commit e5f5a0d30e, leading to a mean that was not in the min/max range and to zero-divide in the stddev computation, among others. 2014-05-29 15:25:24 +02:00
Dominic Hamon
e5a431998d Merge pull request #23 from ckennelly/clock_initialization
Resolve race on approx_time_ in FastClock.
2014-05-05 10:03:11 -07:00
Dominic Hamon
46507cb276 Merge pull request #22 from ckennelly/mutex_initialization
Statically initialize benchmark_mutex and extend its lifetime.
2014-05-05 10:02:50 -07:00
Chris Kennelly
2c9b29c9ff Resolve race on approx_time_ in FastClock.
InitType should hold a lock before storing to approx_time_, which is later
read by the background worker.  When the worker is actively running (i.e., not
blocked on bg_cond_) it holds bg_mutex_.

InitType is called during benchmark setup only, so any contention induced for
the mutex should not have performance/accuracy consequences.
2014-05-05 09:45:27 -07:00
Chris Kennelly
77106c1f68 Statically initialize benchmark_mutex and extend its lifetime.
RunSpecifiedBenchmarks destroys benchmark_mutex before its last usage,
typically in RemoveBenchmark during cleanup of the BenchmarkFamilies singleton.
2014-05-05 09:42:13 -07:00
Chris Kennelly
54e18b8992 Resolve benchmark cleanup race condition in issue #20.
The multithreaded API for benchmarks provides that teardown can happen in
thread 0.  For this to be safe, all other threads executing the benchmark
function need to have exited.  Otherwise, thread 0 may begin to teardown shared
resources before the other threads have stopped using these resources as they
are in their last loop of while (KeepRunning()) { ... }.

This change creates a single exit point for KeepRunning() to return false.
When running a multithreaded benchmark, thread 0 blocks on KeepRunning() until
all other threads have exited.  This approach allows for there to be no change
to the user-facing API exemplified in the BM_MultiThreaded example.
2014-05-05 09:38:08 -07:00
Chris Kennelly
9f27edbb16 Resolve memory leak from benchmark instances in google/benchmark#17.
This shifts registration from a global vector to a singleton that manages
benchmark destruction during shutdown.
2014-04-23 01:17:47 -07:00
Chris Kennelly
fa908926c7 Partially resolve google/benchmark#17 by fixing regular expression leak.
This adds a unit test to validate the wrapper without running the entirety of
benchmark_test.
2014-04-23 00:56:17 -07:00
Chris Kennelly
e38fde6450 Setup targets from each directory, rather than the top-level. 2014-04-23 00:47:07 -07:00
Arne Beer
feea2f022f Compile warning removed, adding myself to contributors 2014-04-06 22:03:51 +02:00
Arne Beer
50f459d2c0 Unable to compile because of unused parameter
There is a unused parameter at benchmark:866 Benchmark::MeasurePeakHeapMemory .
The function is marked as TODO and the code that uses the parameter is commented out.
I just removed the parameter so it can compile again without editing the CMake compile flags.
2014-04-06 16:42:24 +02:00
Felix Homann
a7c57939c8 Fix cycleclock.h for gcc/ARM.
Currently there are tests for ARMV3 and ARMV6 in cycleclock.h which are not
defined using gcc on ARM. Since there is also a cast to the unknown type
int64 I assume that the ARM code has not been tested. Therefore this patch
replaces the checks for ARMV3 and ARMV6 by checks for __ARM_ARCH. Also, the
cast to int64 is fixed by casting to int64_t.
2014-03-18 17:04:40 +01:00
Yusuke Suzuki
45b79c3e01 Check families is not nullptr before using it
When there's no benchmarks, families becomes nullptr. So before touching
it, we need to ensure families is not nullptr.
2014-02-23 20:19:07 +09:00
Dominic Hamon
be84ed0373 Remove old NOTEs 2014-01-21 19:27:04 -08:00
Eugene Zhuk
772ff6f1f1 [#4] Cleaned up FastClock background thread. 2014-01-20 23:18:25 -08:00
Eugene Zhuk
ceea4cb380 [#4] A few minor changes. 2014-01-20 22:32:16 -08:00
Eugene Zhuk
4ed4ff9574 Fix shutting down FastClock's thread on OSX. 2014-01-18 00:50:45 -08:00