Instruction level tracing and profiling

  • Follow


Hello,

There is a certain algorithm that I need to try different
implementations for. What I need is a way of tracing execution at
runtime, so that I know how many times a particular instruction was
hit, similar to benchmarking tools that computer architects use. My
program runs in protected mode under Linux on x86 machine, and it
doesn't call any system call.

I searched a lot for a similar tool with no gain. All the experimental
and research tools I found do not run for the x86. I tried Bochs
tracing, but since it's running under Linux, it's probably disassembly
every operating system, and device driver code along with my program
which lend me gettnig a huge amoung of output. Then I looked in GDB
docs, I found a tracing mechanism that can be used but it's only
available for remote targets. I thought of writing a set of macros one
for each instruction and replace my code with those macros with each
one calling the target instruction along with the required bookkeeping
instructions, but this method is tedious and i'm sure there's
something better. Also it looks like gprof works on a much higher
level. I ran out of ideas and internet search.

I wish somebody has some experience with this.

Thanks,

0
Reply mhelshou 3/1/2004 3:46:25 AM

Mohammed Hamed wrote:

> There is a certain algorithm that I need to try different
> implementations for. What I need is a way of tracing execution at
> runtime, so that I know how many times a particular instruction was
> hit, similar to benchmarking tools that computer architects use. My
> program runs in protected mode under Linux on x86 machine, and it
> doesn't call any system call.
> 
> I searched a lot for a similar tool with no gain. All the experimental
> and research tools I found do not run for the x86. I tried Bochs
> tracing, but since it's running under Linux, it's probably disassembly
> every operating system, and device driver code along with my program
> which lend me gettnig a huge amoung of output. Then I looked in GDB
> docs, I found a tracing mechanism that can be used but it's only
> available for remote targets. I thought of writing a set of macros one
> for each instruction and replace my code with those macros with each
> one calling the target instruction along with the required bookkeeping
> instructions, but this method is tedious and i'm sure there's
> something better. Also it looks like gprof works on a much higher
> level. I ran out of ideas and internet search.

Your CPU's performance-monitoring counters might prove useful.

Have you looked into Intel's VTune or AMD's CodeAnalyst?

http://intel.com/software/products/vtune/vlin/
http://www.amd.com/us-en/Processors/DevelopWithAMD/0,,30_2252_3604_9713,00.html

Regards,

Grumble

0
Reply Grumble 3/1/2004 7:10:55 PM


Grumble <invalid@kma.eu.org> wrote in message news:<c1v054$pd$1@news-rocq.inria.fr>...
> Mohammed Hamed wrote:
> 
> 
> Your CPU's performance-monitoring counters might prove useful.
> 
> Have you looked into Intel's VTune or AMD's CodeAnalyst?
> 
> http://intel.com/software/products/vtune/vlin/
> http://www.amd.com/us-en/Processors/DevelopWithAMD/0,,30_2252_3604_9713,00.html
> 
> Regards,
> 
> Grumble

Thanks, I'll take a look at those tools. The price tag however looks
higher than my need. I wished if there were open source tools. I'll
try some tricks with bochs, possibly trying to filter the whole bunch
of instructions disassembeled.

Regards,


0
Reply mhelshou 3/7/2004 2:45:20 AM

2 Replies
238 Views

(page loaded in 0.058 seconds)

Similiar Articles:













7/21/2012 5:13:08 PM


Reply: