Code Profilers suitable for asm applications



Hi Guys,

Long time no see, anyway I'm still around lurking (not posting) and
it's good to see some things have improved around here. (Pity, Annie,
Beth, et al. aren't around anymore).

Anyway I'm still working on my compiler ( http://chewy509.110mb.com/b0.html
), and have had some performance issues on certain OS platforms,
however I haven't been able to track down the offending component
within the compiler to find where the problems lay (or where the
bottlenecks are).

Now the performance problems are more apparent on certain OSs (namely
Windows Vista), eg on Vista, for the compiler to compiler itself takes
around 15secs, on Windows XP x64 it takes 6secs, and on Solaris (SXDE
01/08) it takes a whole 0.5secs. (Linux and FreeBSD ports both take
around 2-3secs). Yes, the same code (except linked to the appropriate
OS syscalls) on the same hardware.

What I have been trying to find is a decent profiling tool that can
take a raw EXE (or a *.asm file), profile it, and let me know where
the bottlenecks are so I can either, a, try to clean up the current
algorithm being used, or b, find a better algorithm. eg, the number of
times function x is called, and the duration in which that function
takes.

Since the compiler is written in itself, which in turn produces FASM
compatible assembly file (I use FASM as the backend assembler), all I
have to work with in the *.asm file as source with conventional tools.
The raw *.asm output file for the compiler is roughly 60K lines (or
1.3MB).

If I search for "assembly language profile tool" on the Internet, all
I get are tools for either .NET or Java languages. Nothing that works
for raw exe's.

I have downloaded AMD's Code Analyst, however for raw EXEs, it can
only handle time based sampling (eg record the EIP/RIP register at x
Hz intervals), it can't tell me the number of times a function is
called or how long it's in use (which should be easy to gather based
on the stack frame).

Does anyone else have any suggestions for a good profiling tool? The
only requirements, it must support 64bit x86 Assembly or raw EXEs and
work on either Windows XP x64 or Solaris 10+.

PS. I have looked at using dtrace on Solaris for this, but am still
trying to get my head around how to profile internal functions calls
within your own application, not just those made to the OS. Any
pointers on how to use dtrace for this would be extremely welcome.
(Most how-to's for dtrace assume you're writing in C/C++ and are using
Sun's C compiler for additionally debugging options).

--
Darran (aka Chewy509) brought to you by Google Groups!
.



Relevant Pages

  • Re: Code Profilers suitable for asm applications
    ... Anyway I'm still working on my compiler (http://chewy509.110mb.com/b0.html ... What I have been trying to find is a decent profiling tool that can ... compatible assembly file (I use FASM as the backend assembler), ... I have downloaded AMD's Code Analyst, however for raw EXEs, it can ...
    (alt.lang.asm)
  • Re: What micros do you actually hate to work with?
    ... with less than tiny asm ... hassle to work with 32 bit longs in assembler for an 8 bit uP, ... Microchip's C compiler tools and their assembly under MPLAB. ... is that other programmers for C are easier to find. ...
    (comp.arch.embedded)
  • Re: The Promise of Forth
    ... Declare variables, declare locals, let the compiler do the work ... Forth could be considered the assembler for a simplified virtual ... If you use locals then you have to initialise them each time. ... there are likely to be libraries that could be profitably used within ...
    (comp.lang.forth)
  • The never ending assembly vs. HLL war
    ... > branch instruction excluded is not particularly effective optimization. ... > CPU, chances are pretty good it *won't* be optimal on a different CPU. ... > discussing the futility of optimizing it in *assembler* when the ... careful and consider the code the compiler is emitting (and adjust your ...
    (comp.lang.asm.x86)
  • Re: the quality of assembly language code
    ... Intel's compiler is supposed to ... I have found that I prefer 'C' and assembler roughly in inverse ... >> code than human beings writing raw assembly language. ... > assembly programmers and compilers. ...
    (comp.lang.asm.x86)