This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

RVDS profiler for arm and exceptions, broken?

Note: This was originally posted on 24th March 2011 at http://forums.arm.com

Hello all,
I was advised by a co-worker to try arm's RVDS for profiling my code. I followed tutorial to load profiler sample project for xvid that comes with RVDS. Then, I created my own project that uses my code and I compile it and run to be able to see which functions needs optimization on ARM cpu.
However, I have impression that this entire thing is very buggy and doesn't work properly. The moment I try to enable optimiations (-O3 -Otime) it doesn't work at all. This code works properly on real device, so I know it works, but in RVDS emulator it does not work.
In short, when I compile with -O3 for example, then when I run profiler it works properly:
here's the output I get:
Attaching the profiler trace to component RTSM_EB_Cortex_A8.coretile.core.
Simulation is started
Loading symbols from amr-wb-fixed-test.axf...
Finished loading symbols.
Transferring target image
Enabled streaming trace.
ARM Profiler WARNING: Call chain max depth (511) exceeded. Call chain will be incorrect.
200 frames processed, time: 4.930
...

It runs fine, but at some point the green instruction graph drops and the exception graph goes up and the progress bar starts to increase fast with orange color.
and this is the pic when the instruction graph drops and the exception graph goes up [removed].

That same build runs without any issues with the debugger, but from profiler it has this problem.
Overall, it looks quite broken: I use limited amount of std libc: malloc, free, string.h functions and mem* functions. All of them resulted in exactly the same problem with exception coutner, so eventually I had to rewrite (provide my own implementations) of memcmp, memcpy etc, otherwise I wasn't able to use profiler at all! I have handcoded neon code and I wanted to profile the code to see what kind of improvement it gives me, but simply by including that asm file into the build makes the same problem with exception graph and it take TOO much time to run anything and profiler shows nonexistent functions at the end. The asm file uses gas for compilation, I changed it to arm's syntax, but it didn't help: the problem happens even if I do not call that asm optimized function, simply by including the object file into linker's list generated broken build.

Anybody can explain me what I do wrong, or the armcc is so broken and unusable. That's the impression I got.


PS> I downloaded latest compiler update, in release notes it mentions that there is a problem fixed that -O3 -Otime could result in invalid code... I was enthusiastic, thinking that I finally will be able to run my code, but it didn't help all. This code works on real devices, I build it with GCC and with MS's compiler for WinCE.
Here's the options that I pass to the compiler: CFG = --arm --cpu=6K -Otime -g, i tried also amt7-a, cortex-a8 etc, all have the same problem.
Parents
  • Note: This was originally posted on 25th March 2011 at http://forums.arm.com

    Neon totally does not work for me.
    I created simple test code, then took fft sample that comes with RVDS and modified files. I can run sample, but I change compilation to Cortex-A8 then I have this problem with exceptions.
    I took a screenshot after I tried to profile my sample. On this screenshot you can my makefile and results of the profiler. As you see I have alternative --cpu=5te build which works, but the build for Cortex-A8 does not and generates this weird result with profiler: after running for a few seconds it shows that 160 instructions were executed (16ins/sec) and all these mysterious functions like __scater_load that took all cpu for this time ... WTF is this RVDS is all about? No message, no way to see exceptions, no message boxes to tell me what's wrong...
Reply
  • Note: This was originally posted on 25th March 2011 at http://forums.arm.com

    Neon totally does not work for me.
    I created simple test code, then took fft sample that comes with RVDS and modified files. I can run sample, but I change compilation to Cortex-A8 then I have this problem with exceptions.
    I took a screenshot after I tried to profile my sample. On this screenshot you can my makefile and results of the profiler. As you see I have alternative --cpu=5te build which works, but the build for Cortex-A8 does not and generates this weird result with profiler: after running for a few seconds it shows that 160 instructions were executed (16ins/sec) and all these mysterious functions like __scater_load that took all cpu for this time ... WTF is this RVDS is all about? No message, no way to see exceptions, no message boxes to tell me what's wrong...
Children
No data