public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Profiling
@ 2004-08-15 19:54 Rajkishore Barik
  2004-08-16 19:50 ` Profiling James E Wilson
  0 siblings, 1 reply; 14+ messages in thread
From: Rajkishore Barik @ 2004-08-15 19:54 UTC (permalink / raw)
  To: gcc

Hi,
I had been adding a new value profile transformation onto the existing vpt 
framework.,
I wrote a new __gcov_merge_range function in "libgcov.c" file. 
However, every execution of the executable file produces "Overflow 
merging" error. 
Can someone help?
regards,
Raj

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

* Re: Profiling
  2004-08-15 19:54 Profiling Rajkishore Barik
@ 2004-08-16 19:50 ` James E Wilson
  2004-08-17 10:49   ` Profiling Rajkishore Barik
  0 siblings, 1 reply; 14+ messages in thread
From: James E Wilson @ 2004-08-16 19:50 UTC (permalink / raw)
  To: Rajkishore Barik; +Cc: gcc

Rajkishore Barik wrote:
> I wrote a new __gcov_merge_range function in "libgcov.c" file. 
> However, every execution of the executable file produces "Overflow 
> merging" error. 

The code you wrote has a bug.  You will have to try to debug it using 
gdb.  No one else can do this for you.

If you ask specific questions, we may be able to give specific answers. 
  But we can't help with questions like this.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com

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

* Re: Profiling
  2004-08-16 19:50 ` Profiling James E Wilson
@ 2004-08-17 10:49   ` Rajkishore Barik
  0 siblings, 0 replies; 14+ messages in thread
From: Rajkishore Barik @ 2004-08-17 10:49 UTC (permalink / raw)
  To: James E Wilson; +Cc: gcc

> > I wrote a new __gcov_merge_range function in "libgcov.c" file. 
> > However, every execution of the executable file produces "Overflow 
> > merging" error. 

>The code you wrote has a bug.  You will have to try to debug it using 
>gdb.  No one else can do this for you.


After doing a thorough check, I found out that I was using 
"gcov_write_counter" to store negative values. 
The checks for "value < 0" in these functions ("gcov_write_counter" and 
"gcov_read_counter") restrict the counters from generic usage.

--Raj




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

* Re: profiling
  2004-07-09  7:30 profiling kavii ita
@ 2004-07-12 20:00 ` Jim Wilson
  0 siblings, 0 replies; 14+ messages in thread
From: Jim Wilson @ 2004-07-12 20:00 UTC (permalink / raw)
  To: kavii ita; +Cc: gcc

kavii ita wrote:
> I am trying to explore the gcc 's profiling support.It
> is has great support for instrumenting application
> with profiling code.

Gcc supports two kinds of profiling.  The gprof profiling uses timers, 
and requires profil().  The gcov profiling uses counters, and does not 
require profil().  See the -fprofile-arcs and -ftest-coverage options. 
See also the gcov documentation.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com

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

* Re: profiling
  2004-07-09  7:58 ` profiling Zack Weinberg
  2004-07-12  4:12   ` profiling Ben Elliston
@ 2004-07-12 10:23   ` kavii ita
  1 sibling, 0 replies; 14+ messages in thread
From: kavii ita @ 2004-07-12 10:23 UTC (permalink / raw)
  To: gcc

Hello,

> > I am afraid profil() or settimer functional
> support is
> > not there for the targets without any OS sitting
> on
> > it.
> > How does the profiling works on other embedded
> targets
> > in gcc world?
> >
> > I have global counter unit on the hardware. If i
> use
> > this in prologue and epilogue of function . I can
> get
> > the time spend in the function.
> >
> > Can I make a use of this to replace profil()
> > functionality ? I want to  replace native calls
> mcount
> > and monstartup 
> > with my code which will using hardware timer. Can
> I
> > get implement flat profile/call graph profile 
> 
> Suggest you write a little library which provides
> the
> mcount/monstartup/profil interface.  This will be
> *much* easier than hacking prologue generation.

Thanks for the help. getting such library will solve
lot of purpose.

I have no OS on the hardware. but it can go into ISR
as soon as timer interrupt arrives. 

What I understand is that profil() will allocate some
memory area, and in the timer ISR I will need to
update
the respective array slot based on the value of PC and
histogram factor

is it feasible to get profil() similar functionality
using  timer engine? Would it be easy to porting
mcount/monstartup/profil interface functions this way?


Please suggest. 
Or where can I have a look on some reference
implementation?

Regards,
ita


> zw 

________________________________________________________________________
Yahoo! India Careers: Over 50,000 jobs online
Go to: http://yahoo.naukri.com/

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

* Re: profiling
  2004-07-09 10:20 ` profiling Alexander Stante
@ 2004-07-12  9:45   ` kavii ita
  0 siblings, 0 replies; 14+ messages in thread
From: kavii ita @ 2004-07-12  9:45 UTC (permalink / raw)
  To: gcc

--- Alexander Stante <mrpac@gmx.de> wrote: > Hello,
> 
> kavii ita wrote:
> > I have global counter unit on the hardware. If i
> use
> > this in prologue and epilogue of function . I can
> get
> > the time spend in the function.
> I use -finstrument-functions with the
> __cyg_profile_func_enter and 
> __cyg_profile_func_exit function to profile my code.
> With the attribute 
> "no_instrument_function" you can exclude certain
> function like irq 
> handlers from beiing instrumented. Maybe that helps.

Thanks for the pointer. gcc seems to support the 
profiling meachanism through the *PROFILE* macros.

Can I get a same amount of profiling data by
instrumenting code at function levels.

please comment.

ita
 
> Bye
> Alex 

________________________________________________________________________
Yahoo! India Careers: Over 50,000 jobs online
Go to: http://yahoo.naukri.com/

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

* Re: profiling
  2004-07-09  7:58 ` profiling Zack Weinberg
@ 2004-07-12  4:12   ` Ben Elliston
  2004-07-12 10:23   ` profiling kavii ita
  1 sibling, 0 replies; 14+ messages in thread
From: Ben Elliston @ 2004-07-12  4:12 UTC (permalink / raw)
  To: gcc

Zack Weinberg <zack@codesourcery.com> writes:

> > Can I make a use of this to replace profil() functionality ? I
> > want to replace native calls mcount and monstartup with my code
> > which will using hardware timer. Can I get implement flat
> > profile/call graph profile
> 
> Suggest you write a little library which provides the
> mcount/monstartup/profil interface.  This will be *much* easier than
> hacking prologue generation.

.. and then you'll need to think about how you'll get the profiling
data out of the embedded hardware.

Ben

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

* Re: profiling
  2004-07-09  7:38 profiling kavii ita
  2004-07-09  7:58 ` profiling Zack Weinberg
@ 2004-07-09 10:20 ` Alexander Stante
  2004-07-12  9:45   ` profiling kavii ita
  1 sibling, 1 reply; 14+ messages in thread
From: Alexander Stante @ 2004-07-09 10:20 UTC (permalink / raw)
  To: kavii ita; +Cc: gcc

Hello,

kavii ita wrote:
> I have global counter unit on the hardware. If i use
> this in prologue and epilogue of function . I can get
> the time spend in the function.
I use -finstrument-functions with the __cyg_profile_func_enter and 
__cyg_profile_func_exit function to profile my code. With the attribute 
"no_instrument_function" you can exclude certain function like irq 
handlers from beiing instrumented. Maybe that helps.

Bye
Alex

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

* Re: profiling
  2004-07-09  7:38 profiling kavii ita
@ 2004-07-09  7:58 ` Zack Weinberg
  2004-07-12  4:12   ` profiling Ben Elliston
  2004-07-12 10:23   ` profiling kavii ita
  2004-07-09 10:20 ` profiling Alexander Stante
  1 sibling, 2 replies; 14+ messages in thread
From: Zack Weinberg @ 2004-07-09  7:58 UTC (permalink / raw)
  To: kavii ita; +Cc: gcc

kavii ita <systemonchip2000@yahoo.co.in> writes:

> Hello,

One message is enough, you know.

> I am afraid profil() or settimer functional support is
> not there for the targets without any OS sitting on
> it.
> How does the profiling works on other embedded targets
> in gcc world?
>
> I have global counter unit on the hardware. If i use
> this in prologue and epilogue of function . I can get
> the time spend in the function.
>
> Can I make a use of this to replace profil()
> functionality ? I want to  replace native calls mcount
> and monstartup 
> with my code which will using hardware timer. Can I
> get implement flat profile/call graph profile 

Suggest you write a little library which provides the
mcount/monstartup/profil interface.  This will be
*much* easier than hacking prologue generation.

zw

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

* profiling
@ 2004-07-09  7:38 kavii ita
  2004-07-09  7:58 ` profiling Zack Weinberg
  2004-07-09 10:20 ` profiling Alexander Stante
  0 siblings, 2 replies; 14+ messages in thread
From: kavii ita @ 2004-07-09  7:38 UTC (permalink / raw)
  To: gcc

Hello,

I am trying to explore the gcc 's profiling support.It
is has great support for instrumenting application
with profiling code.

It is quiet useful for me.  but it uses profil()/
settimer functionality to generate the time signal in
native gcc.

I am afraid profil() or settimer functional support is
not there for the targets without any OS sitting on
it.
How does the profiling works on other embedded targets
in gcc world?

I have global counter unit on the hardware. If i use
this in prologue and epilogue of function . I can get
the time spend in the function.

Can I make a use of this to replace profil()
functionality ? I want to  replace native calls mcount
and monstartup 
with my code which will using hardware timer. Can I
get implement flat profile/call graph profile 

Any pointers regarding this would be useful.

-regards,
ita



________________________________________________________________________
Yahoo! India Careers: Over 50,000 jobs online
Go to: http://yahoo.naukri.com/

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

* profiling
@ 2004-07-09  7:30 kavii ita
  2004-07-12 20:00 ` profiling Jim Wilson
  0 siblings, 1 reply; 14+ messages in thread
From: kavii ita @ 2004-07-09  7:30 UTC (permalink / raw)
  To: gcc

Hello,

I am trying to explore the gcc 's profiling support.It
is has great support for instrumenting application
with profiling code.

It is quiet useful for me. but it uses profil()/
settimer functionality to generate the time signal in
native gcc.

I am afraid profil() or settimer functional support is
not there for the targets without any OS sitting on
it.
How does the profiling works on other embedded targets
in gcc world?

I have global counter unit on the hardware. If i use
this in prologue and epilogue of function . I can get
the time spend in the function. Can I implement flat
profile/call graph profile using this approach ?

Can I make a use of this to replace profil() 
functionality ? I want to  replace native calls mcount
and monstartup with my code which will be using
hardware timer. 

Once i can get a data run time on target. i can xfer
to host.

Any pointers regarding this would be useful.

Regards
ita


________________________________________________________________________
Yahoo! India Careers: Over 50,000 jobs online
Go to: http://yahoo.naukri.com/

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

* Re: profiling
  2002-06-14  2:59 profiling Zdenka Safarzik
@ 2002-06-14  6:42 ` Will Cohen
  0 siblings, 0 replies; 14+ messages in thread
From: Will Cohen @ 2002-06-14  6:42 UTC (permalink / raw)
  To: zsafarzi; +Cc: gcc

Zdenka Safarzik wrote:
> Hello,
> 
> I want to made hardware profiling. For that purposes I need to have
> instrumented source code that has to be profiled. At every beginning and end
> of function and program loops writing to one register must be inserted. Each
> faction write different value in that register. My hardware detects access
> to that register, which function had access and time when that access was
> happen.
> 
> For source code instrumentation I want to use gcc. As gcc is very complex
> software, I hope that you can help me.
> 
> I read gecko documentation, and it seems to me that -pg or -test-coverage
> options can be used for this purpose. Can you please tell me what exactly
> these options do? Do they insert some code before compiling or before
> linking? Where is it in gcc source code? Can I easy change that code with
> writing to some register?  Is it possible to set profiling hierarchy level
> (for example: to add extra code only on "main" function instead of whole
> source)?

The -pg option puts a function call at the beginning of each function to 
mcount. The -pg option doesn't put anything at the end of the function. 
This is probably not going to be very useful for what you are interested 
in doing.

You might look at the "-finstrument-functions" option. This option puts 
a call to __cyg_profile_func_enter at the beginning of each function and 
a call to __cyg_profile_func_exit at the end of each function. The 
programmer needs to supply the instrumentation functions. It can be 
turned off with the "no_instrument_function" attribute on a 
function-by-function basis.

As far as finding how the options are implementing code, use the "-dap" 
on simple test programs to see what the RTL looks like. You can also use 
"-save-temps" to keep around the assembly language files.

The source code for gcc is available from a number of places:

http://www.gnu.org/software/gcc/mirrors.html

It may take some time to figure out how to make the changes. GCC is a 
relatively complicated program. However, the GCC Internals Manual 
available from http://www.gnu.org/software/gcc/onlinedocs/ will help.

Good luck.

-Will Cohen

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

* profiling
@ 2002-06-14  2:59 Zdenka Safarzik
  2002-06-14  6:42 ` profiling Will Cohen
  0 siblings, 1 reply; 14+ messages in thread
From: Zdenka Safarzik @ 2002-06-14  2:59 UTC (permalink / raw)
  To: gcc

Hello,

I want to made hardware profiling. For that purposes I need to have
instrumented source code that has to be profiled. At every beginning and end

of function and program loops writing to one register must be inserted. Each

faction write different value in that register. My hardware detects access
to that register, which function had access and time when that access was
happen.

For source code instrumentation I want to use gcc. As gcc is very complex
software, I hope that you can help me.

I read gecko documentation, and it seems to me that -pg or -test-coverage
options can be used for this purpose. Can you please tell me what exactly
these options do? Do they insert some code before compiling or before
linking? Where is it in gcc source code? Can I easy change that code with
writing to some register?  Is it possible to set profiling hierarchy level
(for example: to add extra code only on "main" function instead of whole
source)?

Thank you for your time

Regards
Zdenka Safarzik

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

* Profiling
@ 2000-12-01 12:30 Davy Durham
  0 siblings, 0 replies; 14+ messages in thread
From: Davy Durham @ 2000-12-01 12:30 UTC (permalink / raw)
  To: gcc

Uh... I'm not sure if this is the correct mailing list to ask this
question but:

    I'm trying to profile an application "-p" flag...    I'd really like
to be able to call a function in the code that would say, start or stop
the profiling..

   See, the processing in my app is broken into several phases, and one
of the phases is taking a bit too long and I want to try to optimize
it.... Hence, I don't want the other phases' information to be included
in gprof's output...

    Perhaps this is a gprof issue?


Thanks,
    Davy

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

end of thread, other threads:[~2004-08-17 10:09 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-15 19:54 Profiling Rajkishore Barik
2004-08-16 19:50 ` Profiling James E Wilson
2004-08-17 10:49   ` Profiling Rajkishore Barik
  -- strict thread matches above, loose matches on Subject: below --
2004-07-09  7:38 profiling kavii ita
2004-07-09  7:58 ` profiling Zack Weinberg
2004-07-12  4:12   ` profiling Ben Elliston
2004-07-12 10:23   ` profiling kavii ita
2004-07-09 10:20 ` profiling Alexander Stante
2004-07-12  9:45   ` profiling kavii ita
2004-07-09  7:30 profiling kavii ita
2004-07-12 20:00 ` profiling Jim Wilson
2002-06-14  2:59 profiling Zdenka Safarzik
2002-06-14  6:42 ` profiling Will Cohen
2000-12-01 12:30 Profiling Davy Durham

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).