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.
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.