Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ADS 1.2 C compiler instrumentation option

Tags:

c

arm

armcc

I'm attempting to add instrumenting/profiling calls to C source. Many compilers I have found have flags that let you do this (--gnu_instrument, -finsturment-functions, etc). Then you provide the definitions for the inserted function calls. From there you can do cool stuff with the resulting call graph and whatever metrics you decide to pull from the profiling calls.

I'm however needing to instrument code compiled with ADS 1.2

Installer here

(source is built with \ARM\ADSv1_2\Bin\armcc.exe)

Docs

To be honest this compiler feels quite old to me and I'm having trouble finding much useful information. What I really want is just an entirely complete list of compiler options to check through, but I must be missing it. (The linked docs feels incomplete as far as options go)

I did stumble upon using -instrument as an option which, while giving no errors (when an obviously bad flags does, -asdf), has no effect on the generated assembly when using -S. But I haven't been able to find -instrument in any docs or help menus so I could just be using it incorrectly. Or I suppose it could be a feature that was dropped but still lets you compile without errors, I really have no idea.

If anyone has experience with this compiler or is just a better Google-er any help would be appreciated

like image 608
Idan Reed Avatar asked Nov 06 '22 16:11

Idan Reed


1 Answers

I don't think there is any better documentation (but legacy toolchains is not my area).

Yes, the compiler is 2001 vintage. I think you're more likely to have success looking at ETM trace for non-intrusive profiling. At the time of this toolchain, there was not the spare CPU capacity in the target application areas to be able to afford software instrumentation. This use case is one of the target applications of ETM, and you ought to be able to build up the right sort of analysis using modern tools (since the architecture for this is reasonably standardised).

It does rely on your hardware having ETM in the silicon, and a suitable trace capture port or embedded trace buffer.

like image 176
Sean Houlihane Avatar answered Nov 11 '22 09:11

Sean Houlihane