Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* [RFC] Skipping final cleanups in quit_target
@ 2008-03-06 16:24 Aleksandar Ristovski
  2008-03-06 16:34 ` Daniel Jacobowitz
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Aleksandar Ristovski @ 2008-03-06 16:24 UTC (permalink / raw)
  To: gdb

Hello,

Does anyone see a problem in skipping "do_final_cleanups (ALL_CLEANUPS)" in 
top.c (quit_target)?

quit_target is called just before we exit gdb.

I have a case where shutdown takes approx. 40sec. With skipping the cleanups, 
time is significantly shorter.

Any thoughts?

Thank you,

Aleksandar Ristovski
QNX Software Systems


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

* Re: [RFC] Skipping final cleanups in quit_target
  2008-03-06 16:24 [RFC] Skipping final cleanups in quit_target Aleksandar Ristovski
@ 2008-03-06 16:34 ` Daniel Jacobowitz
  2008-03-06 16:34   ` Aleksandar Ristovski
  2008-03-06 16:40 ` Pierre Muller
  2008-03-07  3:17 ` Michael Snyder
  2 siblings, 1 reply; 8+ messages in thread
From: Daniel Jacobowitz @ 2008-03-06 16:34 UTC (permalink / raw)
  To: Aleksandar Ristovski; +Cc: gdb

On Thu, Mar 06, 2008 at 11:19:24AM -0500, Aleksandar Ristovski wrote:
> Hello,
>
> Does anyone see a problem in skipping "do_final_cleanups (ALL_CLEANUPS)" 
> in top.c (quit_target)?
>
> quit_target is called just before we exit gdb.
>
> I have a case where shutdown takes approx. 40sec. With skipping the 
> cleanups, time is significantly shorter.

Could you check which cleanups run, and which of them take so long?
Do they deal with letting go of the target system?

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: [RFC] Skipping final cleanups in quit_target
  2008-03-06 16:34 ` Daniel Jacobowitz
@ 2008-03-06 16:34   ` Aleksandar Ristovski
  2008-03-06 16:45     ` Daniel Jacobowitz
  0 siblings, 1 reply; 8+ messages in thread
From: Aleksandar Ristovski @ 2008-03-06 16:34 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb

Daniel Jacobowitz wrote:
> On Thu, Mar 06, 2008 at 11:19:24AM -0500, Aleksandar Ristovski wrote:
>> Hello,
>>
>> Does anyone see a problem in skipping "do_final_cleanups (ALL_CLEANUPS)" 
>> in top.c (quit_target)?
>>
>> quit_target is called just before we exit gdb.
>>
>> I have a case where shutdown takes approx. 40sec. With skipping the 
>> cleanups, time is significantly shorter.
> 
> Could you check which cleanups run, and which of them take so long?
I believe it is cleaning up the symbols and stuff like that (but i have to 
double check to be sure).

> Do they deal with letting go of the target system?
> 
No, that is being done explicitly by calling target_kill/target_detach and 
target_close in quit_target.


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

* RE: [RFC] Skipping final cleanups in quit_target
  2008-03-06 16:24 [RFC] Skipping final cleanups in quit_target Aleksandar Ristovski
  2008-03-06 16:34 ` Daniel Jacobowitz
@ 2008-03-06 16:40 ` Pierre Muller
  2008-03-06 16:51   ` Aleksandar Ristovski
  2008-03-07  3:17 ` Michael Snyder
  2 siblings, 1 reply; 8+ messages in thread
From: Pierre Muller @ 2008-03-06 16:40 UTC (permalink / raw)
  To: 'Aleksandar Ristovski', gdb

This should at least be configurable 
because it is good practice to have 
program that do cleanups...

  An example is that you might want to 
check if gdb is leaking memory, and you 
can do that by simply looking at 
heap allocations remaining at exit.
  Such tests will be harder with your suggestions,
which is the reason why I would suggest
to make this a configurable option.

Pierre Muller

> -----Original Message-----
> From: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.org] On
> Behalf Of Aleksandar Ristovski
> Sent: Thursday, March 06, 2008 5:19 PM
> To: gdb@sourceware.org
> Subject: [RFC] Skipping final cleanups in quit_target
> 
> Hello,
> 
> Does anyone see a problem in skipping "do_final_cleanups
> (ALL_CLEANUPS)" in
> top.c (quit_target)?
> 
> quit_target is called just before we exit gdb.
> 
> I have a case where shutdown takes approx. 40sec. With skipping the
> cleanups,
> time is significantly shorter.
> 
> Any thoughts?
> 
> Thank you,
> 
> Aleksandar Ristovski
> QNX Software Systems




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

* Re: [RFC] Skipping final cleanups in quit_target
  2008-03-06 16:34   ` Aleksandar Ristovski
@ 2008-03-06 16:45     ` Daniel Jacobowitz
  2008-03-06 16:53       ` Aleksandar Ristovski
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Jacobowitz @ 2008-03-06 16:45 UTC (permalink / raw)
  To: Aleksandar Ristovski; +Cc: gdb

On Thu, Mar 06, 2008 at 11:33:55AM -0500, Aleksandar Ristovski wrote:
> I believe it is cleaning up the symbols and stuff like that (but i have to 
> double check to be sure).

If it's just freeing memory, we don't have to, but maybe we shouldn't
be registering the cleanups at all - that shouldn't take nearly so
long though.

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: [RFC] Skipping final cleanups in quit_target
  2008-03-06 16:40 ` Pierre Muller
@ 2008-03-06 16:51   ` Aleksandar Ristovski
  0 siblings, 0 replies; 8+ messages in thread
From: Aleksandar Ristovski @ 2008-03-06 16:51 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb

Pierre Muller wrote:
> This should at least be configurable 
> because it is good practice to have 
> program that do cleanups...
> 
>   An example is that you might want to 
> check if gdb is leaking memory, and you 
> can do that by simply looking at 
> heap allocations remaining at exit.
>   Such tests will be harder with your suggestions,
> which is the reason why I would suggest
> to make this a configurable option.

Yes, I am not against final cleanups in general, I am just looking for ways to 
cut down the time users perceive as useless waiting.

> 
> Pierre Muller
> 
>> -----Original Message-----
>> From: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.org] On
>> Behalf Of Aleksandar Ristovski
>> Sent: Thursday, March 06, 2008 5:19 PM
>> To: gdb@sourceware.org
>> Subject: [RFC] Skipping final cleanups in quit_target
>>
>> Hello,
>>
>> Does anyone see a problem in skipping "do_final_cleanups
>> (ALL_CLEANUPS)" in
>> top.c (quit_target)?
>>
>> quit_target is called just before we exit gdb.
>>
>> I have a case where shutdown takes approx. 40sec. With skipping the
>> cleanups,
>> time is significantly shorter.
>>
>> Any thoughts?
>>
>> Thank you,
>>
>> Aleksandar Ristovski
>> QNX Software Systems
> 
> 
> 


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

* Re: [RFC] Skipping final cleanups in quit_target
  2008-03-06 16:45     ` Daniel Jacobowitz
@ 2008-03-06 16:53       ` Aleksandar Ristovski
  0 siblings, 0 replies; 8+ messages in thread
From: Aleksandar Ristovski @ 2008-03-06 16:53 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb

Daniel Jacobowitz wrote:
> On Thu, Mar 06, 2008 at 11:33:55AM -0500, Aleksandar Ristovski wrote:
>> I believe it is cleaning up the symbols and stuff like that (but i have to 
>> double check to be sure).
> 
> If it's just freeing memory, we don't have to, but maybe we shouldn't
> be registering the cleanups at all - that shouldn't take nearly so
> long though.
> 
Well it is only visible and annoying with very large symbol files, but it will, 
of course, depend on the host system details.


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

* Re: [RFC] Skipping final cleanups in quit_target
  2008-03-06 16:24 [RFC] Skipping final cleanups in quit_target Aleksandar Ristovski
  2008-03-06 16:34 ` Daniel Jacobowitz
  2008-03-06 16:40 ` Pierre Muller
@ 2008-03-07  3:17 ` Michael Snyder
  2 siblings, 0 replies; 8+ messages in thread
From: Michael Snyder @ 2008-03-07  3:17 UTC (permalink / raw)
  To: Aleksandar Ristovski; +Cc: gdb

On Thu, 2008-03-06 at 11:19 -0500, Aleksandar Ristovski wrote:
> Hello,
> 
> Does anyone see a problem in skipping "do_final_cleanups (ALL_CLEANUPS)" in 
> top.c (quit_target)?
> 
> quit_target is called just before we exit gdb.
> 
> I have a case where shutdown takes approx. 40sec. With skipping the cleanups, 
> time is significantly shorter.
> 
> Any thoughts?

Not sure -- what if the shut-down modifies target memory?
For example, removing breakpoints or something?  If we
skip it, we could leave the target in an inconsistant state.

Maybe a user settable option?  Kinda like "trust readonly"?



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

end of thread, other threads:[~2008-03-06 20:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-06 16:24 [RFC] Skipping final cleanups in quit_target Aleksandar Ristovski
2008-03-06 16:34 ` Daniel Jacobowitz
2008-03-06 16:34   ` Aleksandar Ristovski
2008-03-06 16:45     ` Daniel Jacobowitz
2008-03-06 16:53       ` Aleksandar Ristovski
2008-03-06 16:40 ` Pierre Muller
2008-03-06 16:51   ` Aleksandar Ristovski
2008-03-07  3:17 ` Michael Snyder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox