public inbox for sid@sourceware.org
 help / color / mirror / Atom feed
* gprof store and reset pins
@ 2003-10-17 19:41 Nikola Valerjev
  2003-10-18 10:08 ` Frank Ch. Eigler
  0 siblings, 1 reply; 3+ messages in thread
From: Nikola Valerjev @ 2003-10-17 19:41 UTC (permalink / raw)
  To: sid


Hi,

I've been trying to use gdb and gprof components in 'sid' to get the profiling
information out. The problem is that by default (i.e. options --gdb=PORT and
--gprof=FILE) will dump the information to gmon.out only once gdb disconnects
from the target. That happens because of the following default configuration:

connect-pin shutdown-seq output-7 -> mm_A-0/gprof store

What I would like to do is get gmon.out dumped while still being connected.
Also I would like to have some way of reseting the gprof info (driving the
'reset' pin) on demand (presumably using the 'gdb' component or the
'io-socket' component - but not necessarily using the 'gdb' debugger). That
would have the benefit of being able to collect the profiling data only for one
section of the code - not for the entire program.

For the first problem, I changed the configuration file to say

connect-pin yield-net output-0 -> mm_A-0/gprof store

(yield-net input is driven by 'gdb' yield). So that has the effect of dumping
gmon.out whenever the target process stops. It is not demand driven, and it
probably dumps it more often than I want, but it is good enough for now.

However, I can't figure out which output pin to use to drive 'gprof reset'
command. One option was to do

connect-pin shutdown-seq output-7 -> mm_A-0/gprof reset

but then I get a reset only after I disconnect from 'sid'. What I really need
is some way of reseting it while still being connected.

I would appreciate any help with this.

Thanks

Nikola Valerjev
Green Hills Software



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

* Re: gprof store and reset pins
  2003-10-17 19:41 gprof store and reset pins Nikola Valerjev
@ 2003-10-18 10:08 ` Frank Ch. Eigler
  2003-10-21  0:14   ` Nikola Valerjev
  0 siblings, 1 reply; 3+ messages in thread
From: Frank Ch. Eigler @ 2003-10-18 10:08 UTC (permalink / raw)
  To: Nikola Valerjev; +Cc: sid

Hi -


On Fri, Oct 17, 2003 at 12:41:14PM -0700, Nikola Valerjev wrote:
> [...]
> I've been trying to use gdb and gprof components in 'sid' to get the profiling
> information out. [...]

I'm glad to hear it!

> What I would like to do is get gmon.out dumped while still being connected.
> Also I would like to have some way of reseting the gprof info (driving the
> 'reset' pin) on demand [...]

Since both these signals are carried over generic sid pins, any mechanism
at all that can result in pin events at times of your pleasure will work.
Among them:
- time-based scheduler events (host or target)
- hard-wired connection between the "save" and "reset" pins, probably
  through a hw-glue-sequence; hmm, finding a way of automatically changing
  the profiling data file name might be nice
- socket or console input
- memory-mapped I/O (mapping hw-glue-probe-bus components into memory,
  connecting one of its output lines to the pin of your choice)
- using the gdb "monitor set COMPONENT ATTRIBUTE VALUE" command to
  pass the "set ..." configuration line to cfgroot, thence to COMPONENT.
  Consider COMPONENT=gprof, ATTRIBUTE=reset or save, VALUE=1, recalling
  that most pins may be alternately driven using attribute-related calls.
- using the gprof component's own pc-limit-range attributes to automatically
  limit its focus to a certain span of PC values.


- FChE

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

* Re: gprof store and reset pins
  2003-10-18 10:08 ` Frank Ch. Eigler
@ 2003-10-21  0:14   ` Nikola Valerjev
  0 siblings, 0 replies; 3+ messages in thread
From: Nikola Valerjev @ 2003-10-21  0:14 UTC (permalink / raw)
  To: Frank Ch. Eigler; +Cc: sid


Thanks a lot for the tips. I ended up doing the 'monitor' commands - i.e.

	monitor set gprof reset 1
	monitor set gprof store 1

(actually since I'm directly writing through the socket to the gdb component,
I ended up passing a "qRcmd,<hex-coded-command>" string).

- Nikola Valerjev

On Sat, 18 Oct 2003, Frank Ch. Eigler wrote:

> Hi -
> 
> 
> On Fri, Oct 17, 2003 at 12:41:14PM -0700, Nikola Valerjev wrote:
> > [...]
> > I've been trying to use gdb and gprof components in 'sid' to get the profiling
> > information out. [...]
> 
> I'm glad to hear it!
> 
> > What I would like to do is get gmon.out dumped while still being connected.
> > Also I would like to have some way of reseting the gprof info (driving the
> > 'reset' pin) on demand [...]
> 
> Since both these signals are carried over generic sid pins, any mechanism
> at all that can result in pin events at times of your pleasure will work.
> Among them:
> - time-based scheduler events (host or target)
> - hard-wired connection between the "save" and "reset" pins, probably
>   through a hw-glue-sequence; hmm, finding a way of automatically changing
>   the profiling data file name might be nice
> - socket or console input
> - memory-mapped I/O (mapping hw-glue-probe-bus components into memory,
>   connecting one of its output lines to the pin of your choice)
> - using the gdb "monitor set COMPONENT ATTRIBUTE VALUE" command to
>   pass the "set ..." configuration line to cfgroot, thence to COMPONENT.
>   Consider COMPONENT=gprof, ATTRIBUTE=reset or save, VALUE=1, recalling
>   that most pins may be alternately driven using attribute-related calls.
> - using the gprof component's own pc-limit-range attributes to automatically
>   limit its focus to a certain span of PC values.
> 
> 
> - FChE
> 

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

end of thread, other threads:[~2003-10-21  0:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-17 19:41 gprof store and reset pins Nikola Valerjev
2003-10-18 10:08 ` Frank Ch. Eigler
2003-10-21  0:14   ` Nikola Valerjev

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