public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* profiling question
@ 2000-05-09  5:16 Senti
  0 siblings, 0 replies; 7+ messages in thread
From: Senti @ 2000-05-09  5:16 UTC (permalink / raw)
  To: gcc-help

Hello
I'm building a gcc cross-comiler for an 
processor.
What i wanted was to add some code for 
profiling.
I have written the two macros related to basic 
block profiling :

#define BLOCK_PROFILER(FILE, BLOCKNO)
#define FUNCTION_BLOCK_PROFILER(FILE, 
BLOCK_OR_LABEL)
but when i try compiling a program using -ax 
option gcc is saying :
cc1: warning: '-ax' option (jump profiling) not 
supported
What should i do for enabling -ax option. 
Should i write something else too into gcc ?
Thanks in advance, Adrian.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: profiling question
  2007-12-14 20:40 Juan Carlos Franzoy
@ 2007-12-15  0:27 ` Brian Dessent
  0 siblings, 0 replies; 7+ messages in thread
From: Brian Dessent @ 2007-12-15  0:27 UTC (permalink / raw)
  To: Juan Carlos Franzoy; +Cc: gcc-help

Juan Carlos Franzoy wrote:

> I compiled it with -pg and -g and installed it. After
> 24 hours it took more than 25% and we killed -15 it.
> It generates a gmon.out.
> 
> Out surprise was when we run gprof myapp gmon.out. All
> counters except where in zero. What am I doing wrong?

First note that gprof is part of binutils and not part of gcc so it'd
probably be better to use the binutils mailing list (binutils at
sourceware.org) for this.

The problem with terminating the program with kill -15 is that the
profiling library registers its mcleanup() routine with atexit(), and
this is what writes all the data to the gmon.out file.  So the app must
either return from main() or call exit() in order to get any profile
data, it won't happen for a SIGTERM or any other abnormal termination
sequence.  You might be able to work around this by e.g. installing a
signal handler that explicitly calls exit() or something.  Or perhaps
you could use a different profiling method like oprofile.

Brian

^ permalink raw reply	[flat|nested] 7+ messages in thread

* profiling question
@ 2007-12-14 20:40 Juan Carlos Franzoy
  2007-12-15  0:27 ` Brian Dessent
  0 siblings, 1 reply; 7+ messages in thread
From: Juan Carlos Franzoy @ 2007-12-14 20:40 UTC (permalink / raw)
  To: gcc-help

Hello. I am trying to profile an application that
start running consuming less than 1% of CPU and 10
hours later it takes 20%.

I compiled it with -pg and -g and installed it. After
24 hours it took more than 25% and we killed -15 it.
It generates a gmon.out.

Out surprise was when we run gprof myapp gmon.out. All
counters except where in zero. What am I doing wrong?

thaks in advance.

gcc -v
Reading specs from
/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/specs
Configured with: ../configure --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-shared --enable-threads=posix
--disable-checking --with-system-zlib
--enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-20)

uname -a
Linux aquila.ats-ar.com.ar 2.4.21-4.EL #1 Fri Oct 3
18:13:58 EDT 2003 i686 i686 i386 GNU/Linux



------------------------------------------------------------
                      Juan Carlos Franzoy
                     Analista  Programador
                     Tel: +54-11-4780-2634
                  mailto:JCFranzoy@ats.com.ar
                     http://www.ats.com.ar
------------------------------------------------------------


      Yahoo! Encuentros.

Ahora encontrar pareja es mucho más fácil, probá el nuevo Yahoo! Encuentros http://yahoo.cupidovirtual.com/servlet/NewRegistration

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: profiling question
  2000-06-07 19:50 Dave Klint
@ 2000-06-07 23:42 ` Martin v. Loewis
  0 siblings, 0 replies; 7+ messages in thread
From: Martin v. Loewis @ 2000-06-07 23:42 UTC (permalink / raw)
  To: davek; +Cc: gcc-help

> Is there something magical that has to be done in order to get
> gprof to profile a multi-threaded application correctly?  Is
> there a command flag I'm missing?

I believe magic is required, but I don't think a command line option
helps.

> I know this isn't really the place to ask this question, but 
> I'm very frustrated with this.  Everyplace I look says that gprof
> supports threads, but I sure can't verify that.  

Which place have you been looking at? AFAICT, gprof is not
thread-safe; at least I could not find any kind of locking in the
mcount function, nor do I think it is inherently atomic in its
operation.

Regards,
Martin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* profiling question
@ 2000-06-07 19:50 Dave Klint
  2000-06-07 23:42 ` Martin v. Loewis
  0 siblings, 1 reply; 7+ messages in thread
From: Dave Klint @ 2000-06-07 19:50 UTC (permalink / raw)
  To: gcc-help

Is there something magical that has to be done in order to get
gprof to profile a multi-threaded application correctly?  Is
there a command flag I'm missing?  I compile with "-g -a -pg" and 
I have the pthreads library with profiling in it, but it refuses
to give me timing information once the first thread starts.

I know this isn't really the place to ask this question, but 
I'm very frustrated with this.  Everyplace I look says that gprof
supports threads, but I sure can't verify that.  

-dave

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: profiling question
  2000-05-29  2:48 Senti
@ 2000-05-29  9:50 ` Mike Corbeil
  0 siblings, 0 replies; 7+ messages in thread
From: Mike Corbeil @ 2000-05-29  9:50 UTC (permalink / raw)
  To: Senti; +Cc: gcc-help

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1965 bytes --]

Senti wrote:
 
Hi 1.
Does anyone know how -ax option of gcc works ? 2.
If yes, what -ax expects from me and what it gives back (in terms of output)
? 3. I remember i found some
3 sentences about that once, but i don't remember where .If anyone knows
where i can find something about that please reply.   Thanks
in advance Adrian


The gcc man page should describe all related  options.  If
you're working on either a Unix or Linux platform, then it's easy to access
man pages and in case you don't know how, then it's

        % man gcc

% represents the prompt symbol on the command line and could be % or
$ or something else, what ever it's been defined as.

If the gcc man page doesn't contain the information you're looking for,
then check through the gnu gcc web site, where there should be documentation
covering your question.  www.gnu.org is the correct url, I believe. 
You might want or need to do this if you're not working on Unix or Linux.

I just checked the man page for gcc 2.7.2.3 on my Linux system, and
this is an older gcc than the one you're working with, but the man page
explains the -a and -x options.  -a is a debug option, takes no arguments,
and is used to generate extra code for profiling.  -x is a language
specification option and can take an argument, but one isn't required if
you want the language to default based on the filename extensions or suffixes,
such as .c for example.

See the man page for more information on these options, because I didn't
include all of it.

If the man page has been maintained and these options are the same across
these versions of gcc, then I believe that you should find all you need
to know about these options from the man page.  Then, it's a question
of whether the man page description is entirely consistent with the implementation
of gcc being used, and if it's not, then produce a bug report explaining
your findings.

mike
 
 
 



^ permalink raw reply	[flat|nested] 7+ messages in thread

* profiling question
@ 2000-05-29  2:48 Senti
  2000-05-29  9:50 ` Mike Corbeil
  0 siblings, 1 reply; 7+ messages in thread
From: Senti @ 2000-05-29  2:48 UTC (permalink / raw)
  To: gcc-help

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 330 bytes --]

Hi
1. Does anyone know how -ax option of gcc works 
?
2. If yes, what -ax expects from me and what it 
gives back (in terms of output) ?
3. I remember i found some 3 sentences about that 
once, but i don't remember where .If anyone knows where i can find 
something about that please reply.
 
Thanks in advance 
Adrian  

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-12-15  0:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-09  5:16 profiling question Senti
2000-05-29  2:48 Senti
2000-05-29  9:50 ` Mike Corbeil
2000-06-07 19:50 Dave Klint
2000-06-07 23:42 ` Martin v. Loewis
2007-12-14 20:40 Juan Carlos Franzoy
2007-12-15  0:27 ` Brian Dessent

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).