Re: [suse-programming-e] Profile assembly instructions of a program
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? Regards, Cindy
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
Jerry Feldman wrote:
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).
Intel's Linux compilers have some of the profiling you are asking for, I *think*. I haven't used that facility firsthand, but they describe it on their website & it sounds like what you are asking for. I have used (& like) the rest of the Intel compiler suite, under SuSE 8.2. They are normally commercial, but are available as unsupported, free downloads as well ....
On Sun, 09 Jan 2005 10:06:53 -0600 "William A. Mahaffey III" <wam@HiWAAY.net> wrote:
Intel's Linux compilers have some of the profiling you are asking for, I *think*. I haven't used that facility firsthand, but they describe it on their website & it sounds like what you are asking for. I have used (&
like) the rest of the Intel compiler suite, under SuSE 8.2. They are normally commercial, but are available as unsupported, free downloads as well .... I can check this. I have been benchmarking the Intel compiler suite vs. the GCC suite on the Itanium and I am seeing a very unofficial 40% improvement using the Intel suite over GCC. I copied myself on this and I'll try to answer this on Monday. They certainly have more sophisticated profiling. Another member of my team is doing some work on profiling.
However, there are some tools that use counters on chips and in the OS to provide additional information. -- 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
Jerry Feldman wrote:
On Sun, 09 Jan 2005 10:06:53 -0600 "William A. Mahaffey III" <wam@HiWAAY.net> wrote:
Intel's Linux compilers have some of the profiling you are asking for,
I
*think*. I haven't used that facility firsthand, but they describe it
on
their website & it sounds like what you are asking for. I have used (&
like) the rest of the Intel compiler suite, under SuSE 8.2. They are normally commercial, but are available as unsupported, free downloads
as
well ....
I can check this. I have been benchmarking the Intel compiler suite vs. the GCC suite on the Itanium and I am seeing a very unofficial 40% improvement using the Intel suite over GCC. I copied myself on this and I'll try to answer this on Monday. They certainly have more sophisticated profiling. Another member of my team is doing some work on profiling.
However, there are some tools that use counters on chips and in the OS to provide additional information.
I roger that on the speed-ups, I have seen *VERY* impressive speed-ups w/ the Intel Compilers ....
I was checking on the Intel compiler suite. There is a sophisticated profiler that allows the user to use the profile information to dynamically update the code (eg. Profile Guided Optimizations). In addition there is a code coverage tool that provides a visual presentation such as the execution count of a basic block. Note that a "basic block" is a small number of instructions with a single entry and exit point. I suggest that you download the compiler user manual from: http://www.intel.com/support/performancetools/c/linux/sb/CS-007729.htm#v8_us... I think you will find that the Intel compiler and tools may meet or come close to your needs. However, it is a commercial product. -- 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
participants (3)
-
Cindy Evelyn
-
Jerry Feldman
-
William A. Mahaffey III