Add dmesg command that can be used to dump the syslog
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4382 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
7b343bf7fe
commit
cf89cd0330
@ -617,8 +617,8 @@ int ramlog_consoleinit(void)
|
||||
|
||||
sem_init(&priv->rl_exclsem, 0, 1);
|
||||
sem_init(&priv->rl_waitsem, 0, 0);
|
||||
priv->rl_bufsize = g_sysbuffer;
|
||||
priv->rl_buffer = CONFIG_RAMLOG_CONSOLE_BUFSIZE;
|
||||
priv->rl_bufsize = CONFIG_RAMLOG_CONSOLE_BUFSIZE;
|
||||
priv->rl_buffer = g_sysbuffer;
|
||||
|
||||
/* Register the console character driver */
|
||||
|
||||
@ -657,8 +657,8 @@ int ramlog_sysloginit(void)
|
||||
|
||||
sem_init(&priv->rl_exclsem, 0, 1);
|
||||
sem_init(&priv->rl_waitsem, 0, 0);
|
||||
priv->rl_bufsize = g_sysbuffer;
|
||||
priv->rl_buffer = CONFIG_RAMLOG_CONSOLE_BUFSIZE;
|
||||
priv->rl_bufsize = CONFIG_RAMLOG_CONSOLE_BUFSIZE;
|
||||
priv->rl_buffer = g_sysbuffer;
|
||||
|
||||
return register_driver("/dev/syslog", &g_ramlogfops, 0666, priv);
|
||||
}
|
||||
@ -681,7 +681,7 @@ int ramlog_sysloginit(void)
|
||||
int ramlog_putc(int ch)
|
||||
{
|
||||
FAR struct ramlog_dev_s *priv = &g_sysdev;
|
||||
(void)ramlog_addchar(priv, ch)
|
||||
(void)ramlog_addchar(priv, ch);
|
||||
return ch;
|
||||
}
|
||||
#endif
|
||||
|
@ -98,6 +98,10 @@
|
||||
# undef CONFIG_RAMLOG_SYSLOG
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_RAMLOG_CONSOLE_BUFSIZE
|
||||
# define CONFIG_RAMLOG_CONSOLE_BUFSIZE 1024
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
@ -164,7 +168,7 @@ EXTERN int ramlog_consoleinit(void)
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_RAMLOG_CONSOLE) && defined(CONFIG_RAMLOG_SYSLOG)
|
||||
EXTERN int ramlog_sysloginit(void)
|
||||
EXTERN int ramlog_sysloginit(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -284,7 +284,7 @@ EXTERN void lib_nulloutstream(FAR struct lib_outstream_s *nulloutstream);
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SYSLOG
|
||||
EXTERN void lib_sylogstream(FAR struct lib_outstream_s *stream);
|
||||
EXTERN void lib_syslogstream(FAR struct lib_outstream_s *stream);
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
|
@ -52,7 +52,7 @@ STDIO_SRCS += lib_fopen.c lib_fclose.c lib_fread.c lib_libfread.c lib_fseek.c \
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef ($(CONFIG_SYSLOG)
|
||||
ifeq ($(CONFIG_SYSLOG),y)
|
||||
STDIO_SRCS += lib_syslogstream.c
|
||||
endif
|
||||
|
||||
|
@ -42,6 +42,10 @@
|
||||
#include <debug.h>
|
||||
#include "lib_internal.h"
|
||||
|
||||
/* This interface can only be used from within the kernel */
|
||||
|
||||
#if !defined(CONFIG_NUTTX_KERNEL) || defined(__KERNEL__)
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
****************************************************************************/
|
||||
@ -113,4 +117,5 @@ int lib_lowprintf(const char *fmt, ...)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ARCH_LOWPUTC || CONFIG_SYSLOG*/
|
||||
#endif /* CONFIG_ARCH_LOWPUTC || CONFIG_SYSLOG */
|
||||
#endif /* __KERNEL__ */
|
||||
|
@ -42,9 +42,16 @@
|
||||
#include "lib_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Some output destinations are only available from within the kernel */
|
||||
|
||||
#if defined(CONFIG_NUTTX_KERNEL) && !defined(__KERNEL__)
|
||||
# undef CONFIG_SYSLOG
|
||||
# undef CONFIG_ARCH_LOWPUTC
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Type Declarations
|
||||
****************************************************************************/
|
||||
|
@ -75,7 +75,7 @@ static void syslogstream_putc(FAR struct lib_outstream_s *this, int ch)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: lib_sylogstream
|
||||
* Name: lib_syslogstream
|
||||
*
|
||||
* Description:
|
||||
* Initializes a stream for use with the coinfigured syslog interface.
|
||||
@ -89,7 +89,7 @@ static void syslogstream_putc(FAR struct lib_outstream_s *this, int ch)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void lib_sylogstream(FAR struct lib_outstream_s *stream)
|
||||
void lib_syslogstream(FAR struct lib_outstream_s *stream)
|
||||
{
|
||||
stream->put = syslogstream_putc;
|
||||
#ifdef CONFIG_STDIO_LINEBUFFER
|
||||
|
Loading…
x
Reference in New Issue
Block a user