Connecting Tech Pros Worldwide Forums | Help | Site Map

profiling (gprof) problem

Pasacco
Guest
 
Posts: n/a
#1: Nov 14 '05
dear

I need to know the execution time of the program. Below is just an
example. I used to use gprof. But in this case, the error messsage says
"gprof : gmon.out file is missing call-graph data".
Is it possible to 'gprof' with this ? Or it will be nice if someone
introduce how to measure execution time......
Thankyou for comment.


-------------------------------------------------------
/* http://www.cplusplus.com/ref/cstdlib/qsort.html */
/* qsort example */
#include <stdio.h>
#include <stdlib.h>

int values[] = { 40, 10, 100, 90, 20, 25 };

int compare (const void * a, const void * b)
{
return ( *(int*)a - *(int*)b );
}

int main ()
{
int * pItem;
int n;
qsort (values, 6, sizeof(int), compare);
for (n=0; n<6; n++)
{
printf ("%d ",values[n]);
}
return 0;
}

Tim Prince
Guest
 
Posts: n/a
#2: Nov 14 '05

re: profiling (gprof) problem



"Pasacco" <pasacco@gmail.com> wrote in message
news:1111252414.797465.29260@g14g2000cwa.googlegro ups.com...[color=blue]
> dear
>
> I need to know the execution time of the program. Below is just an
> example. I used to use gprof. But in this case, the error messsage says
> "gprof : gmon.out file is missing call-graph data".
> Is it possible to 'gprof' with this ? Or it will be nice if someone
> introduce how to measure execution time......
> Thankyou for comment.
>
>
> -------------------------------------------------------
> /* http://www.cplusplus.com/ref/cstdlib/qsort.html */
> /* qsort example */
> #include <stdio.h>
> #include <stdlib.h>
>
> int values[] = { 40, 10, 100, 90, 20, 25 };
>
> int compare (const void * a, const void * b)
> {
> return ( *(int*)a - *(int*)b );
> }
>
> int main ()
> {
> int * pItem;
> int n;
> qsort (values, 6, sizeof(int), compare);
> for (n=0; n<6; n++)
> {
> printf ("%d ",values[n]);
> }
> return 0;
> }
>[/color]
I don't think you have asked any on-topic questions, perhaps a forum
associated with your OS or compiler would be more helpful. But, it doesn't
appear that your program should run long enough to generate useful profiling
data. If you want only execution time, don't worry about the call graph.
If you want only over-all execution time, most OS provide a timer program,
either stand alone or as a shell command. Is your Google broken?


Closed Thread