File tree Expand file tree Collapse file tree 4 files changed +17
-12
lines changed
Expand file tree Collapse file tree 4 files changed +17
-12
lines changed Original file line number Diff line number Diff line change 11{
2- "cmake.sourceDirectory" : " /workspaces/codspeed-cpp/picobench"
3- }
2+ "cmake.sourceDirectory" : " /workspaces/codspeed-cpp/picobench" ,
3+ "files.associations" : {
4+ "*.ejs" : " html" ,
5+ "string" : " cpp" ,
6+ "chrono" : " cpp" ,
7+ "text_encoding" : " cpp" ,
8+ "typeinfo" : " cpp"
9+ }
10+ }
Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ class CodSpeed {
1818 // Member functions
1919 void push_group (const std::string &group);
2020 void pop_group ();
21- void start_benchmark (const std::string &name);
22- void end_benchmark ();
21+ void start_benchmark (const std::string &name) __attribute__((noinline)) ;
22+ void end_benchmark () __attribute__((noinline)) ;
2323
2424 private:
2525 // Private constructor to prevent direct instantiation
Original file line number Diff line number Diff line change @@ -46,20 +46,15 @@ inline void measurement_set_metadata() {
4646}
4747
4848__attribute__ ((always_inline)) inline void measurement_start() {
49- instrument_hooks_start_benchmark (get_hooks ());
50-
5149 CALLGRIND_ZERO_STATS;
5250 CALLGRIND_START_INSTRUMENTATION;
5351}
5452
5553__attribute__ ((always_inline)) inline void measurement_stop() {
5654 CALLGRIND_STOP_INSTRUMENTATION;
57-
58- instrument_hooks_stop_benchmark (get_hooks ());
5955};
6056
61- __attribute__ ((noinline)) inline void measurement_set_executed(
62- const std::string& name) {
57+ inline void measurement_set_executed (const std::string& name) {
6358#ifdef _WIN32
6459 auto current_pid = _getpid ();
6560#else
Original file line number Diff line number Diff line change @@ -69,7 +69,8 @@ void CodSpeed::pop_group() {
6969 }
7070}
7171
72- void CodSpeed::start_benchmark (const std::string &name) {
72+ __attribute__ ((noinline)) void CodSpeed::start_benchmark (
73+ const std::string &name) {
7374 std::string uri = name;
7475
7576 uri = sanitize_bench_args (uri);
@@ -82,9 +83,11 @@ void CodSpeed::start_benchmark(const std::string &name) {
8283 }
8384
8485 current_benchmark = uri;
86+ instrument_hooks_start_benchmark (get_hooks ());
8587}
8688
87- void CodSpeed::end_benchmark () {
89+ __attribute__ ((noinline)) void CodSpeed::end_benchmark () {
90+ instrument_hooks_stop_benchmark (get_hooks ());
8891 measurement_set_executed (current_benchmark);
8992 benchmarked.push_back (current_benchmark);
9093 std::string action_str = is_instrumented ? " Measured" : " Checked" ;
You can’t perform that action at this time.
0 commit comments