3

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

Idan Reed
  • 53
  • 4
  • "this compiler feels quite old" it definitely is - IIRC ADS 1.2 release was in 2001 – solidpixel Jun 19 '19 at 07:46
  • I believe it isn't used for new projects, but unfortunately there is far too much dependent on it and too little reason to switch old projects from it (where I work) – Idan Reed Jun 19 '19 at 15:35
  • ads 1.2 produced much tighter code than gcc back then and gcc really has not improved much, isnt really a compiler for performance but more of a generic many targets compiler. if ADS 1.2 is free and doesnt need a license its probably a good compiler for 32 bit arm instruction development. thumb mode? well its the original which is very portable. no thumb2 extensions. as far as your question I dont work that way so wouldnt know how to do that on any compiler much less this one... – old_timer Jun 19 '19 at 20:01
  • granted back then I was using dhrystone, and benchmarks are BS in general because they are so easy to manipulate the results. so I would have to spend time again, against llvm/clang and gnu to see how they stack up... – old_timer Jun 19 '19 at 20:02

1 Answers1

1

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.

Sean Houlihane
  • 1,698
  • 16
  • 22
  • It does look like some of the processors I'm working with do have the ability for ETM tracing. I do worry that using it would end up requiring a lot of work when (ideally) the profiling needs work across quite a few different processors. That's definitely something I will look into more and thanks for the help – Idan Reed Jun 19 '19 at 15:40