On Thu, 6 Jan 2005 16:22:31 +0800 Cindy Evelyn <cevlyn@gmail.com> wrote:
Hi,
I'm looking for a tool or compiler options if any that can profile the machine instructions of a dynamic C program to see the behaviour of program given a parameter. Since the program is dynamic depending on the parameter given, i'd like to know the number of instructions (memory and non-memory) each in exact counts to know which instructions are executed the most.
I have tried gprof, but gprof only counts the number of function calls. While gcc -S gives the assembly of the source code only (static). So, is there a way to profile during execution since the C program is dynamic in order to get a complete profile of the machine instructions of the program? The only one that I can thing of is Quantify from the Purify-Plus suite from IBM/Rational. This is a commercial product. However, I don't know if it actually counts instructions. This also contains code to test the coverage.
BTW: gcc -S gives you the assembly code of whichever optimization level you select. Your statement about static and dynamic does not make sense to me. In compiler terms, static means that the program incorporates all of its libraries into the load module at compile time, where dynamic means that the program uses shared objects (shared libraries and other shared objects). -- Jerry Feldman <gaf@blu.org> Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9