|
From: Pering, T. <tre...@in...> - 2008-06-15 11:21:47
|
This is something you would need to do at the kernel level, since you need to account for context switches. Unless you need high-detailed accuracy, I would consider using something already built into the kernel -- I'm not exactly sure of the mechanisms, but I know they exist (since programs like "ps" can give you a measure of how much CPU a program is consuming). The "time" command will also do much of this -- although maybe not at the granularity that you require.
Cheers,
Trevor
-----Original Message-----
From: pla...@li... [mailto:pla...@li...] On Behalf Of Junaid Jamil
Sent: Saturday, June 14, 2008 6:47 AM
To: pla...@li...; pla...@li...
Subject: [platformx-ps-devel] Fwd: CPU Cycles Consumed by C program on PXA255
Hi,
I have run my C program on a board which have Intel PXA255 ARM
processor. Now I want to know how much CPU cycles it consumed during
its execution. So I think I can do this by capturing the CPU clocks at
start of my program and capture again at the end of my program. The
difference in the cpu clocks is the total CPU cycles consumed by my
program. But how can I do this using some C or inline (ARM)assembly
code?
I seen some of members are discussing this on this forum that they
count the CPU cycles consumed by C programs. But I want you to help me
writing this code. I do not have much idea about ARM Assembly but can
understand easily as I worked in Assembly for x86.
By the way, I am using arm-linux-gcc 3.3.2 toolchain to build
executables that I run on my stargate mote.
Thanks
Junaid
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
platformx-ps-devel mailing list
pla...@li...
https://lists.sourceforge.net/lists/listinfo/platformx-ps-devel
|