473,468 Members | 1,323 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

profiling (gprof) problem

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;
}

Nov 14 '05 #1
1 2233

"Pasacco" <pa*****@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
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;
}

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?
Nov 14 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Richard Wallace | last post by:
Hello all, I'm looking for some input on the best tools to use for profiling multithreaded C++ code developed on GNU/Linux and compiled using gcc-3.1. More specifically, the distro in use is RH...
6
by: cournape | last post by:
Hi there, I have some scientific application written in python. There is a good deal of list processing, but also some "simple" computation such as basic linear algebra involved. I would like to...
0
by: Dave | last post by:
Hello, I would like to profile a Python program using gprof. I already rebuilt Python with CC="gcc -pg" ../configure. So, I should be able to use gprof. How do I do that? Should I first run...
1
by: Dave | last post by:
Hello All, I'm trying to profile a Python program using gprof, but I don't understand some of the results, especially what some of the functions do. For example, _moncount, mcount,...
1
by: SSG | last post by:
Hello everybody! can anyone tell me how to profile the c program using Gprof by line by line. I am not using a function. If i declare any function, it work , but without function it couldnt...
18
by: noleander | last post by:
I've got Visual C++ 2003. I'm looking for a profiling tool. I'm from the Unix world where a good profiler comes free and built into the compiler and linker. I tried the Help utility in Visual...
2
by: x3191 | last post by:
I use GCC compile my program with the -pg option under MinGW. Then I get the profiling output , mon.out . But ,how can I show it under Windows? Thanks!
13
by: Jens Theisen | last post by:
Hello, I want to apologise in advance for this being off topic. It's not neither A C nor a C++ question, but to profiling in general, though I my chances are best to find the answer in the C/C++...
7
by: horacius.rex | last post by:
Hi, I want to profile a C program I am writting, so I compile it with -pg options and use gprof to obtain information about call graphs, which I am really interested in. I look at the text files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.