Well what OS are you using? You cannot exactly enter a macro but you can use a special function that gets called when ever a function gets called.
In windows this function is called _penter.
Suppose you have a function called void foo();
At the call site it is
foo();
With a special compiler setting you can turn the call to
_penter();
foo();
_pexit();
_penter and _pexit are special functions that the VC++ compiler inserts, if you enable the setting. If you want you can do anything in this _penter(). But be aware of the performance impact.
A Simple Profiler using the Visual Studio C/C++ Compiler and DIA SDK[
^]
This article describes it.
There is a similar functionality for GCC also.