I used to use gcc -fdump-rtl-expand
and -finstrument-functions
to do function call tracing, does armcc has this kind of similar function?
For gcc, I use:
CFLAGS += -finstrument-functions -fdump-rtl-expand
Does armcc have similar compiler options? I tried the same ones, but it seems they do not work:
$ armcc -finstrument-functions test.c
Fatal error: C3900U: Unrecognized option '-finstrument-functions'.
$ armcc -fdump-rtl-expand test.c
Fatal error: C3900U: Unrecognized option '-fdump-rtl-expand'.
It appears that the option which allows gcc
style instrumentation with armcc
is different.
Here is an extract from ARM Compiler Toolchain: Compiler Reference (You can access the reference at http://infocenter.arm.com, if you 'register' on their website):
--gnu_instrument, --no_gnu_instrument
This option inserts GCC-style instrumentation calls for profiling entry and exit to functions.
Usage
After function entry and before function exit, the following profiling functions are called with the address of the current function and its call site:
void __cyg_profile_func_enter(void *current_func, void *callsite);
void __cyg_profile_func_exit(void *current_func, void *callsite);
Restrictions
You must provide definitions of __cyg_profile_func_enter() and __cyg_profile_func_exit().
It is necessary to explicitly mark
__cyg_profile_func_enter()
and__cyg_profile_func_exit()
with__attribute__((no_instrument_function))
.See also
__attribute__((no_instrument_function))
function attribute.
As to the -fdump-rtl-expand
option: I do not know (and do not think) that armcc
uses RTL internally. So I do not think obtaining the logs from the expand pass makes any sense here.