Your combination of Profiler and Macros is really clever. I tried to do something with macros before coming to the Profiler solution, but i didn't work out. This solution is elegant because it integrates well with the other program-wide macros ( __LOCATION__ and __FILE__ ), and more powerful than the ad-hoc __LOG__ handling. The idea of directly modifying the decorate_this_expr declaration seemed a little awkward at first, but it actually is as useful as the functor solution (because all we can get anyway is the function name), while a lot simpler. I think you could even suggest it for inclusion in the main Camlp4 distribution (it should be doable to rebuild the old Camlp4Profiler features on top of that).