public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] A safe way to print debug output in DSRs ?
@ 2000-08-29 11:43 Fabrice Gautier
  2000-08-29 11:58 ` Jonathan Larmour
  0 siblings, 1 reply; 5+ messages in thread
From: Fabrice Gautier @ 2000-08-29 11:43 UTC (permalink / raw)
  To: Ecos-List (E-mail)

Hi,

I'm looking for a safeway to print debug ouput while in a DSR.

Printf is not safe for it locks a mutex.

The weird thing is that AFAICS it uses this mutex only when using the
thread-safe printf option. Could this mean that the not thread safe printf
call is more safe for DSRs? 
Or is there another call that is safe? What about diag_printf?

Thanks

-- 
Fabrice Gautier
fabrice_gautier@sdesigns.com 

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

* Re: [ECOS] A safe way to print debug output in DSRs ?
  2000-08-29 11:43 [ECOS] A safe way to print debug output in DSRs ? Fabrice Gautier
@ 2000-08-29 11:58 ` Jonathan Larmour
  2000-08-29 12:17   ` Grant Edwards
  0 siblings, 1 reply; 5+ messages in thread
From: Jonathan Larmour @ 2000-08-29 11:58 UTC (permalink / raw)
  To: Fabrice Gautier; +Cc: Ecos-List (E-mail)

Fabrice Gautier wrote:
> 
> I'm looking for a safeway to print debug ouput while in a DSR.
> 
> Printf is not safe for it locks a mutex.
> 
> The weird thing is that AFAICS it uses this mutex only when using the
> thread-safe printf option. Could this mean that the not thread safe printf
> call is more safe for DSRs?

Yes, but any threads that used printf wouldn't be using it in a thread-safe
way. If this isn't going to happen, then go ahead and disable the option.

> Or is there another call that is safe? What about diag_printf?

diag_printf is probably a better option since it's only simple debug output
you want. Just include <cyg/infra/diag.h> and go from there.

Jifl
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

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

* Re: [ECOS] A safe way to print debug output in DSRs ?
  2000-08-29 11:58 ` Jonathan Larmour
@ 2000-08-29 12:17   ` Grant Edwards
  0 siblings, 0 replies; 5+ messages in thread
From: Grant Edwards @ 2000-08-29 12:17 UTC (permalink / raw)
  To: Jonathan Larmour; +Cc: Fabrice Gautier, Ecos-List (E-mail)

On Tue, Aug 29, 2000 at 07:58:52PM +0100, Jonathan Larmour wrote:

> > I'm looking for a safeway to print debug ouput while in a DSR.
> > 
> > Printf is not safe for it locks a mutex.
> > 
> > The weird thing is that AFAICS it uses this mutex only when using the
> > thread-safe printf option. Could this mean that the not thread safe printf
> > call is more safe for DSRs?
> 
> Yes, but any threads that used printf wouldn't be using it in a thread-safe
> way. If this isn't going to happen, then go ahead and disable the option.
> 
> > Or is there another call that is safe? What about diag_printf?
> 
> diag_printf is probably a better option since it's only simple debug output
> you want. Just include <cyg/infra/diag.h> and go from there.

If diag_printf does a busy-wait on a UART (as it does on my
system in hal_diag_write_char()), it can have a pretty big
timing impact on the DSR.  If it doesn't get called too often
and the messages fit into the UART FIFO, then this isn't too
much of a problem -- but it's important to keep in mind as you
sprinkle diag_printf() around in the code.

-- 
Grant Edwards
grante@visi.com

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

* RE: [ECOS] A safe way to print debug output in DSRs ?
@ 2000-08-29 19:38 Fabrice Gautier
  2000-08-29 13:57 ` Grant Edwards
  0 siblings, 1 reply; 5+ messages in thread
From: Fabrice Gautier @ 2000-08-29 19:38 UTC (permalink / raw)
  To: 'Grant Edwards', Jonathan Larmour; +Cc: Ecos-List (E-mail)

> -----Original Message-----
> From: Grant Edwards [ mailto:grante@visi.com ]
> Subject: Re: [ECOS] A safe way to print debug output in DSRs ?
> 
> If diag_printf does a busy-wait on a UART (as it does on my
> system in hal_diag_write_char()), it can have a pretty big
> timing impact on the DSR.  If it doesn't get called too often
> and the messages fit into the UART FIFO, then this isn't too
> much of a problem -- but it's important to keep in mind as you
> sprinkle diag_printf() around in the code.

Has someone considered to add parallel port debug support? This could
improve the ti ming problems, and should be easier to do than ethernet
support. USB could be great too
(Just in case someone is not busy enought...)


-- 
Fabrice Gautier
fabrice_gautier@sdesigns.com 

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

* Re: [ECOS] A safe way to print debug output in DSRs ?
  2000-08-29 19:38 Fabrice Gautier
@ 2000-08-29 13:57 ` Grant Edwards
  0 siblings, 0 replies; 5+ messages in thread
From: Grant Edwards @ 2000-08-29 13:57 UTC (permalink / raw)
  To: Fabrice Gautier; +Cc: Jonathan Larmour, Ecos-List (E-mail)

On Tue, Aug 29, 2000 at 01:52:52PM -0700, Fabrice Gautier wrote:
> > -----Original Message-----
> > From: Grant Edwards [ mailto:grante@visi.com ]
> > Subject: Re: [ECOS] A safe way to print debug output in DSRs ?
> > 
> > If diag_printf does a busy-wait on a UART (as it does on my
> > system in hal_diag_write_char()), it can have a pretty big
> > timing impact on the DSR.  If it doesn't get called too often
> > and the messages fit into the UART FIFO, then this isn't too
> > much of a problem -- but it's important to keep in mind as you
> > sprinkle diag_printf() around in the code.
> 
> Has someone considered to add parallel port debug support? This could
> improve the ti ming problems, and should be easier to do than ethernet
> support. USB could be great too
> (Just in case someone is not busy enought...)

The diag_printf routine uses the hal_diag_write_char() routine,
so you can define that to do whatever you want with the data.
Writing it to a parallel port should be pretty trivial.

If you're talking about supporting bi-direction communication
with gdb via parallel port, then that's a bit more work...

-- 
Grant Edwards
grante@visi.com

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

end of thread, other threads:[~2000-08-29 19:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-29 11:43 [ECOS] A safe way to print debug output in DSRs ? Fabrice Gautier
2000-08-29 11:58 ` Jonathan Larmour
2000-08-29 12:17   ` Grant Edwards
2000-08-29 19:38 Fabrice Gautier
2000-08-29 13:57 ` Grant Edwards

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