File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed
google_benchmark/include/benchmark Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -52,24 +52,30 @@ __attribute__((always_inline)) inline void measurement_start() {
5252 CALLGRIND_START_INSTRUMENTATION;
5353}
5454
55- __attribute__ ((always_inline)) inline void measurement_stop(
56- const std::string& name) {
55+ __attribute__ ((always_inline)) inline void measurement_stop() {
5756 CALLGRIND_STOP_INSTRUMENTATION;
57+
5858 instrument_hooks_stop_benchmark (get_hooks ());
59+ };
5960
61+ __attribute__ ((noinline)) inline void measurement_set_executed(
62+ const std::string& name) {
6063#ifdef _WIN32
6164 auto current_pid = _getpid ();
6265#else
6366 auto current_pid = getpid ();
6467#endif
68+
6569 instrument_hooks_executed_benchmark (get_hooks (), current_pid, name.c_str ());
66- };
70+ }
71+
6772#else
6873// Stub implementations for non-instrumentation builds
6974inline bool measurement_is_instrumented () { return false ; }
7075inline void measurement_set_metadata () {}
7176inline void measurement_start () {}
72- inline void measurement_stop (const std::string& name) { (void )name; }
77+ inline void measurement_stop () {}
78+ inline void measurement_set_executed (const std::string& name) { (void )name; }
7379#endif
7480
7581#endif // MEASUREMENT_H
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ void CodSpeed::start_benchmark(const std::string &name) {
8585}
8686
8787void CodSpeed::end_benchmark () {
88- measurement_stop (current_benchmark);
88+ measurement_set_executed (current_benchmark);
8989 benchmarked.push_back (current_benchmark);
9090 std::string action_str = is_instrumented ? " Measured" : " Checked" ;
9191 std::string group_str =
Original file line number Diff line number Diff line change @@ -1066,6 +1066,7 @@ struct State::StateIterator {
10661066 if (BENCHMARK_BUILTIN_EXPECT (cached_ != 0 , true )) return true ;
10671067#ifdef CODSPEED_INSTRUMENTATION
10681068 if (parent_->codspeed_ != NULL ) {
1069+ measurement_stop ();
10691070 parent_->codspeed_ ->end_benchmark ();
10701071 }
10711072#endif
You can’t perform that action at this time.
0 commit comments