02/07/2009 10:23 PM
post21705
|
hmmm - I am trying gprof against a very basic C program, on native neutrino...I need to use a number of packages that
build a *whole* lot easier using GNU autoconf, than trying to shoe-horn them into the IDE's make. This works fine under
Linux, Solaris, etc. etc.
thanks in advance!
Chris
----------------------------------------------------------------------
$ uname -a
QNX localhost 6.4.0 2008/10/21-11:10:24EDT x86pc x86
$ which gcc
/usr/qnx640/host/qnx6/x86/usr/bin/gcc
$ cat foo.c
#include <stdio.h>
void waste_cpu() {
int i;
double j, k, q;
for (i = 0, j = 1.0, k = 2.0; i < 10000000; i++, j += 1.0, k += 1.0) {
q = j / k;
}
}
main() {
int m;
for (m = 1; m < 10; m++) {
waste_cpu();
printf(".");
}
printf("\n");
}
$ gcc -pg foo.c
$./a.out
$..........
$gprof ./a.out | more
Flat profile:
Each sample counts as 0.001 seconds.
no time accumulated
% cumulative self self total
time seconds seconds calls Ts/call Ts/call name
0.00 0.00 0.00 9 0.00 0.00 main
0.00 0.00 0.00 1 0.00 0.00 _start
|
|
|