This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: Can it calculate instructions
- From: "Martin M. Hunt" <hunt at redhat dot com>
- To: kivik at firstlinux dot net
- Cc: "insight at sources dot redhat dot com" <insight at sources dot redhat dot com>
- Date: 06 Feb 2003 12:41:31 -0800
- Subject: Re: Can it calculate instructions
- References: <20030206195957.0EA5B3FBE@sitemail.everyone.net>
On Thu, 2003-02-06 at 11:59, Matts wrote:
> I am considering starting a project for the arm7 or arm9 processor,
> and I am considering using gcc as compiler and insight as debugger.
> I have one question on this, is it possible to count instructions with insight ?
Insight can show any function disassembled so you can see how many
instructions there are. You can do the same with the objdump utility.
Remember you really don't want to try to use a source debugger on highly
optimized code.
> I would really need to calculate processor cycles, but I guess that
> is not possible with insight ?
There are better ways to do what you want.
> What I need is the possibility to see how many instructions or processor
> cykles a certain c function takes.
Counting instructions is easy. Counting CPU cycles requires a CPU
simulator. However I don't believe the GNU arm simulator does that. Even
with a perfect simulator, real world results can vary greatly due to
memory and cache interactions, etc. It is usually much easier and more
accurate to just measure the CPU time your function takes on a working
system.
Martin