&gt; I don&#x27;t know what you mean exactly by &quot;expensive&quot;, but the time spent in profiling code should obviously not be counted, and it is quite simple to do so.<p>Only for the exceedingly trivial case where you exclude profiling CPU time from overall CPU time.  Profiling to see when exactly you&#x27;re CPU bound, and when you&#x27;re disk bound?  Eh.  Profiling to see if false sharing is eating your lunch?  Eh.  Trying to see when you&#x27;ll fail to make vsync and the framerate will hitch?  Eh.<p>I&#x27;ve had to #ifdef out tracing info that boiled down to &quot;if (happensToBeFalse) {...}&quot; in tight loops because it was throwing off my profiling results too much.  Compiler and debugger injected tracing info isn&#x27;t going to be any cheaper than that.<p>&gt; The real point I&#x27;m trying to make is that tracepoints do not require any changes to the original code. They are entirely opt-in and if you do not choose to use them, your application won&#x27;t have this extra useless code compiled into it.<p>Debugger injected tracing is useful, but hardly a panacea.  You know this or you wouldn&#x27;t have written your own tracers, most likely.  When you have the source code, writing a separate tracer doesn&#x27;t make sense - you just embed your stuff directly into your source code and #ifdef it out when necessary (same result: no &quot;extra useless code&quot;.)  Easier to add data to your events (&quot;what file am I hanging on?&quot;) without performance killing deep copies, or reverse engineering structure offsets.  No need to subvert platform security on e.g. Xbox One to figure out how to inject your own code at runtime.  No need to deal with another process&#x27;s address space.<p>Sometimes tracing info is useful to leave in your release builds.  Which is cheaper:  A few rare if() checks and some dormant code? Or spending hours rebuilding, retesting, redeploying to the production machine that is experiencing some issue you need tracing info to diagnose?  As long as you&#x27;re not shoving it into your inner loops it&#x27;s fine.<p>An event on entry&#x2F;exit of main is about as far away from an inner loop as you can manage.  It&#x27;s fine.