views:

73

answers:

2

hi all,

I am doing a project on an Embedded Device which has ARM926Ej-S processor.I need to performance analysis of the algorithm on the device. I am new to embedded environment and don't have much idea of what is performance analysis for embedded devices.

Can some one tell what parameters should i consider for analysis? How to go about implementation too?

Thank you all

+1  A: 

My approach to these would be to read the reference manual ( http://www.arm.com/miscPDFs/5499.pdf ) which should cover everything you need. This will show you if there is a floating-point unit, which drawbacks there are in the FPU, what you have to keep in mind when using DMA's, cache and memory layout as well as the memory bus speeds and a lot other things that are crucial if you want to program this device correctly and efficient.

Unfortunatly, I have never worked with this specific device, so I can not point at anything specific, but you will sure find all you need in the RefManual. If you know the hardware, you can analyse the performance impact of specific parts of the algorithm. But you have to know the hardwares internals.

DarthCoder
thanks darthcoder. I will go through the reference manual. Can you please go through my reply for comment of Mike in the above answer and respond accordingly.thanks again
sravan
If you're already using gdb for debugging, you could use gprof for profiling. Profiling comes in two ways, the one mike prefers (sample-profile) and a timing-profile. Instead of manually inspecting the callstack you can use gprof, which supports sample-profiling already. gprof just takes the callstack-samples automaticly and gives you a list with the called functions and how much percentage of the execution time they took. There are cases were a timing-profile would be more usefull, but I do not know if gprof supports this at all. For the overall perf-overview the sample-prof should suffice.
DarthCoder
hi Darthcoder,I had never used gprog other any other profiling techniques. But, i will learn about them by googling for it. Can you refer me some docs regarding this if you had done the profiling before.In the mean time i will read about sample profiling and how to implement these using gdb. I would like to do the time profiling too.
sravan
Everything you need to know to start working with gprof should be here: http://www.cs.utah.edu/dept/old/texinfo/as/gprof.html#SEC6.This shows you how to compile, run and gather data.
DarthCoder
+2  A: 

What kind of debugging environment do you have? Do you have an in-circuit-emulator (ICE)? What I recommend is that you have a debugging environment such that you can manually halt execution at a random time and examine the state of the program, including the call stack (stackshots). Manually sampling the call stack in this way will reveal places in the code that are responsible for significant fractions of time, so that you can optimize them. Here is a longer explanation.

This may be a little different from what you were considering. Many people think that to find things to optimize you need to time the code, but that is not so. Timing is a good way to find out if what you did made a difference, but stack sampling is, some feel, the best way to find out what to do to make the difference.

Mike Dunlavey
hi Mike,I don't have Debugging environment. I am planning to by JTAG for the device. I don't know whether it can be used for this device or not. Right now, i am communicating to the device using Serial port. I forgot to inform that Linux 2.6.20 kernel is running with minimal GUI applications on the device. So, i use the gdb for debugging my programs. Please let me know if i can do the same things using gdb.thanks
sravan
@sravan: Yes, if you can run your program under gdb, control-C is a way to interrupt it so you can examine the call stack. Another way is to get the program running, and while it is running, use the pstack or lsstack program. You may have to wrap a loop around your program to make it "run" long enough to take your samples.
Mike Dunlavey