From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5699 invoked by alias); 6 Feb 2003 20:41:35 -0000 Mailing-List: contact insight-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sources.redhat.com Received: (qmail 5691 invoked from network); 6 Feb 2003 20:41:35 -0000 Received: from unknown (HELO mx1.redhat.com) (172.16.49.200) by 172.16.49.205 with SMTP; 6 Feb 2003 20:41:35 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h16KfZf19387 for ; Thu, 6 Feb 2003 15:41:35 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h16KfZa19932; Thu, 6 Feb 2003 15:41:35 -0500 Received: from dragon (romulus-int.sfbay.redhat.com [172.16.27.46]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h16KfWB29180; Thu, 6 Feb 2003 15:41:33 -0500 Subject: Re: Can it calculate instructions From: "Martin M. Hunt" To: kivik@firstlinux.net Cc: "insight@sources.redhat.com" In-Reply-To: <20030206195957.0EA5B3FBE@sitemail.everyone.net> References: <20030206195957.0EA5B3FBE@sitemail.everyone.net> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Thu, 06 Feb 2003 20:41:00 -0000 Message-Id: <1044564095.1176.12.camel@Dragon> Mime-Version: 1.0 X-SW-Source: 2003-q1/txt/msg00083.txt.bz2 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