File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,9 +22,12 @@ void example_function() {
2222 printf ("Benchmark executed\n" );
2323}
2424
25- int main () {
26- instrument_hooks_set_feature (FEATURE_DISABLE_CALLGRIND_MARKERS , true);
25+ __attribute__((noinline )) void __codspeed_root_frame__example (
26+ void (* benchmark_fn )(void )) {
27+ benchmark_fn ();
28+ }
2729
30+ int main () {
2831 InstrumentHooks * hooks = instrument_hooks_init ();
2932 if (!hooks ) {
3033 printf ("Failed to initialize instrument hooks\n" );
@@ -37,7 +40,7 @@ int main() {
3740 printf ("Not running under instrumentation\n" );
3841 }
3942
40- instrument_hooks_set_integration (hooks , "example " , "1.0.0" );
43+ instrument_hooks_set_integration (hooks , "custom-integration " , "1.0.0" );
4144
4245 printf ("Starting benchmark...\n" );
4346 if (instrument_hooks_start_benchmark_inline (hooks ) != 0 ) {
@@ -53,7 +56,7 @@ int main() {
5356 expensive_setup ();
5457
5558 uint64_t start_time = instrument_hooks_current_timestamp ();
56- example_function ( );
59+ __codspeed_root_frame__example ( example_function );
5760 uint64_t end_time = instrument_hooks_current_timestamp ();
5861
5962 // Add the markers which mark when the benchmarked function was running
You can’t perform that action at this time.
0 commit comments