macro code

G

Guest

Hi,
I want to find out how much time is spent in macro-code, without having to
change all macro-definitions to include some tracking code.
Thus when compiling a file, the preprocessor would (during macro-expansion),
add some extra code, to make it easier to see at runtime (using some
profiling tool) how often certain macro's were used.

For example this macro:
#define P(a,b,c) \
a=1;\
b=2;\
c=3;

would be changed by the preprocessor to this:

#define P(a,b,c) \
P_counter++; \
func_P_macro_begin() ; \
a=1; \
b=2; \
c=3; \
func_P_macro_end() ;

and then used during preprocessing.

Is there a preprocessor option (preferably Linux) or preprocessor-like
tool available that would achieve that ?

Thanks and regards,
Marco.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,150
Latest member
MakersCBDReviews
Top