From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9890 invoked by alias); 10 May 2007 11:56:36 -0000 Received: (qmail 9880 invoked by uid 22791); 10 May 2007 11:56:34 -0000 X-Spam-Check-By: sourceware.org Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 10 May 2007 11:56:31 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1Hm7Fp-0004GY-00; Thu, 10 May 2007 13:56:17 +0200 Date: Thu, 10 May 2007 14:13:00 -0000 To: Jon Ringle Cc: ecos-discuss@ecos.sourceware.org Message-ID: <20070510115617.GA13088@lunn.ch> Mail-Followup-To: Jon Ringle , ecos-discuss@ecos.sourceware.org References: <4DD3AF7ECBBC43409BA36508938D0185123B73@CVAEX1.VERTICAL.COM> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4DD3AF7ECBBC43409BA36508938D0185123B73@CVAEX1.VERTICAL.COM> User-Agent: Mutt/1.5.13 (2006-08-11) From: Andrew Lunn X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] remote syslog support in Redboot? X-SW-Source: 2007-05/txt/msg00053.txt.bz2 On Wed, May 09, 2007 at 03:12:29PM -0400, Jon Ringle wrote: > Has anyone implemented the ability to have diag_printf() messages be > sent to a remote syslog server in Redboot/ecos? You will have to be careful when doing this. diag_printf() uses a very simple polled IO, blocking serial device driver. The idea is that it should always work, in any context. So you can do a diag_printf() in an ISR or a DSR, not just a thread. It is also guaranteed the output will be out the serial port before diag_printf() returns. If you somehow modify diag_printf to send over a network stack it is unlikely you can keep these properties. I would suggest you look at adding a standard syslog interface, eg: #include void openlog(const char *ident, int option, int facility); void syslog(int priority, const char *format, ...); void closelog(void); #define _BSD_SOURCE #include void vsyslog(int priority, const char *format, va_list ap); and don't modify diag_printf(). Andrew -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss