ramlog: Remove all ramlog_consoleinit related code

Because we can get the same function by CONSOLE_SYSLOG/syslog_console_init.
BTW, it isn't a good choice to use g_ramlogfops as /dev/console since nsh
will read back what it send out which will surprise most people.
This commit is contained in:
Xiang Xiao
2020-02-18 02:10:15 +08:00
committed by Gregory Nutt
parent f982ee43db
commit dcaaf2d912
42 changed files with 45 additions and 261 deletions
-7
View File
@@ -6929,10 +6929,6 @@ int syslog_file_channel(FAR const char *devpath);
<p> <p>
<code>CONFIG_RAMLOG</code>: Enables the RAM logging feature <code>CONFIG_RAMLOG</code>: Enables the RAM logging feature
</li> </li>
<li>
<p>
<code>CONFIG_RAMLOG_CONSOLE</code>: Use the RAM logging device as a system console. If this feature is enabled (along with <code>CONFIG_DEV_CONSOLE</code>), then all console output will be re-directed to a circular buffer in RAM. This might be useful, for example, if the only console is a Telnet console. Then in that case, console output from non-Telnet threads will go to the circular buffer and can be viewed using the NSH <code>dmesg</code> command. This optional is not useful in other scenarios.
</li>
<li> <li>
<p> <p>
<code>CONFIG_RAMLOG_SYSLOG</code>: Use the RAM logging device for the SYSLOG interface. If this feature is enabled, then all debug output will be re-directed to the circular buffer in RAM. This RAM log can be viewed from NSH using the <code>dmesg</code> command. NOTE: Unlike the limited, generic character driver SYSLOG device, the RAMLOG <i>can</i> be used to capture debug output from <code>CONFIG_RAMLOG_SYSLOG</code>: Use the RAM logging device for the SYSLOG interface. If this feature is enabled, then all debug output will be re-directed to the circular buffer in RAM. This RAM log can be viewed from NSH using the <code>dmesg</code> command. NOTE: Unlike the limited, generic character driver SYSLOG device, the RAMLOG <i>can</i> be used to capture debug output from
@@ -6943,9 +6939,6 @@ int syslog_file_channel(FAR const char *devpath);
<code>CONFIG_RAMLOG_NPOLLWAITERS</code>: The number of threads than can be waiting for this driver on <code>poll()</code>. Default: 4 <code>CONFIG_RAMLOG_NPOLLWAITERS</code>: The number of threads than can be waiting for this driver on <code>poll()</code>. Default: 4
</li> </li>
</ul> </ul>
<p>
If <code>CONFIG_RAMLOG_CONSOLE</code> or <code>CONFIG_RAMLOG_SYSLOG</code> is selected, then the following must also be provided:
</p>
<ul> <ul>
<li> <li>
<p> <p>
-7
View File
@@ -2117,13 +2117,6 @@ o File system / Generic drivers (fs/, drivers/)
Status: Open Status: Open
Priority: Medium-Low Priority: Medium-Low
Title: CONFIG_RAMLOG_CONSOLE DOES NOT WORK
Description: When I enable CONFIG_RAMLOG_CONSOLE, the system does not come up
properly (using configuration stm3240g-eval/nsh2). The problem
may be an assertion that is occurring before we have a console.
Status: Open
Priority: Medium
Title: UNIFIED DESCRIPTOR REPRESENTATION Title: UNIFIED DESCRIPTOR REPRESENTATION
Description: There are two separate ranges of descriptors for file and Description: There are two separate ranges of descriptors for file and
socket descriptors: if a descriptor is in one range then it is socket descriptors: if a descriptor is in one range then it is
-3
View File
@@ -50,7 +50,6 @@
#include <nuttx/net/tun.h> #include <nuttx/net/tun.h>
#include <nuttx/net/telnet.h> #include <nuttx/net/telnet.h>
#include <nuttx/syslog/syslog.h> #include <nuttx/syslog/syslog.h>
#include <nuttx/syslog/ramlog.h>
#include <nuttx/syslog/syslog_console.h> #include <nuttx/syslog/syslog_console.h>
#include <nuttx/serial/pty.h> #include <nuttx/serial/pty.h>
#include <nuttx/crypto/crypto.h> #include <nuttx/crypto/crypto.h>
@@ -194,8 +193,6 @@ void up_initialize(void)
lwlconsole_init(); lwlconsole_init();
#elif defined(CONFIG_CONSOLE_SYSLOG) #elif defined(CONFIG_CONSOLE_SYSLOG)
syslog_console_init(); syslog_console_init();
#elif defined(CONFIG_RAMLOG_CONSOLE)
ramlog_consoleinit();
#endif #endif
#ifdef CONFIG_PSEUDOTERM_SUSV1 #ifdef CONFIG_PSEUDOTERM_SUSV1
+1 -5
View File
@@ -60,14 +60,10 @@
#ifndef CONFIG_DEV_CONSOLE #ifndef CONFIG_DEV_CONSOLE
# undef USE_SERIALDRIVER # undef USE_SERIALDRIVER
# undef USE_EARLYSERIALINIT # undef USE_EARLYSERIALINIT
# undef CONFIG_RAMLOG_CONSOLE
#else #else
# if defined(CONFIG_ARM_LWL_CONSOLE) # if defined(CONFIG_ARM_LWL_CONSOLE)
# undef USE_SERIALDRIVER # undef USE_SERIALDRIVER
# undef USE_EARLYSERIALINIT # undef USE_EARLYSERIALINIT
# elif defined(CONFIG_RAMLOG_CONSOLE)
# undef USE_SERIALDRIVER
# undef USE_EARLYSERIALINIT
# else # else
# define USE_SERIALDRIVER 1 # define USE_SERIALDRIVER 1
# define USE_EARLYSERIALINIT 1 # define USE_EARLYSERIALINIT 1
@@ -87,7 +83,7 @@
/* Check if an interrupt stack size is configured */ /* Check if an interrupt stack size is configured */
#ifndef CONFIG_ARCH_INTERRUPTSTACK #ifndef CONFIG_ARCH_INTERRUPTSTACK
# define CONFIG_ARCH_INTERRUPTSTACK 0 # define CONFIG_ARCH_INTERRUPTSTACK 0
#endif #endif
/* Macros to handle saving and restoring interrupt state. In the current ARM /* Macros to handle saving and restoring interrupt state. In the current ARM
+1 -5
View File
@@ -152,12 +152,8 @@
#ifndef CONFIG_DEV_CONSOLE #ifndef CONFIG_DEV_CONSOLE
# undef USE_SERIALDRIVER # undef USE_SERIALDRIVER
# undef USE_EARLYSERIALINIT # undef USE_EARLYSERIALINIT
# undef CONFIG_RAMLOG_CONSOLE
#else #else
# if defined(CONFIG_RAMLOG_CONSOLE) # if defined(HAVE_RS232_DEVICE)
# undef USE_SERIALDRIVER
# undef USE_EARLYSERIALINIT
# elif defined(HAVE_RS232_DEVICE)
# define USE_SERIALDRIVER 1 # define USE_SERIALDRIVER 1
# define USE_EARLYSERIALINIT 1 # define USE_EARLYSERIALINIT 1
# else # else
+1 -5
View File
@@ -71,12 +71,8 @@
#ifndef CONFIG_DEV_CONSOLE #ifndef CONFIG_DEV_CONSOLE
# undef USE_SERIALDRIVER # undef USE_SERIALDRIVER
# undef USE_EARLYSERIALINIT # undef USE_EARLYSERIALINIT
# undef CONFIG_RAMLOG_CONSOLE
#else #else
# if defined(CONFIG_RAMLOG_CONSOLE) # if defined(HAVE_USART_DEVICE)
# undef USE_SERIALDRIVER
# undef USE_EARLYSERIALINIT
# elif defined(HAVE_USART_DEVICE)
# define USE_SERIALDRIVER 1 # define USE_SERIALDRIVER 1
# define USE_EARLYSERIALINIT 1 # define USE_EARLYSERIALINIT 1
# else # else
+1 -5
View File
@@ -77,12 +77,8 @@
#ifndef CONFIG_DEV_CONSOLE #ifndef CONFIG_DEV_CONSOLE
# undef USE_SERIALDRIVER # undef USE_SERIALDRIVER
# undef USE_EARLYSERIALINIT # undef USE_EARLYSERIALINIT
# undef CONFIG_RAMLOG_CONSOLE
#else #else
# if defined(CONFIG_RAMLOG_CONSOLE) # if defined(HAVE_USART_DEVICE)
# undef USE_SERIALDRIVER
# undef USE_EARLYSERIALINIT
# elif defined(HAVE_USART_DEVICE)
# define USE_SERIALDRIVER 1 # define USE_SERIALDRIVER 1
# define USE_EARLYSERIALINIT 1 # define USE_EARLYSERIALINIT 1
# else # else
+2 -10
View File
@@ -76,15 +76,9 @@
#ifndef CONFIG_DEV_CONSOLE #ifndef CONFIG_DEV_CONSOLE
# undef USE_SERIALDRIVER # undef USE_SERIALDRIVER
# undef USE_EARLYSERIALINIT # undef USE_EARLYSERIALINIT
# undef CONFIG_RAMLOG_CONSOLE
#else #else
# if defined(CONFIG_RAMLOG_CONSOLE) # define USE_SERIALDRIVER 1
# undef USE_SERIALDRIVER # define USE_EARLYSERIALINIT 1
# undef USE_EARLYSERIALINIT
# else
# define USE_SERIALDRIVER 1
# define USE_EARLYSERIALINIT 1
# endif
#endif #endif
/* If some other device is used as the console, then the serial driver may /* If some other device is used as the console, then the serial driver may
@@ -228,8 +222,6 @@ void up_initialize(void)
#if defined(CONFIG_CONSOLE_SYSLOG) #if defined(CONFIG_CONSOLE_SYSLOG)
syslog_console_init(); syslog_console_init();
#elif defined(CONFIG_RAMLOG_CONSOLE)
ramlog_consoleinit();
#endif #endif
#ifdef CONFIG_PSEUDOTERM_SUSV1 #ifdef CONFIG_PSEUDOTERM_SUSV1
-2
View File
@@ -155,8 +155,6 @@ void up_initialize(void)
#if defined(CONFIG_CONSOLE_SYSLOG) #if defined(CONFIG_CONSOLE_SYSLOG)
syslog_console_init(); syslog_console_init();
#elif defined(CONFIG_RAMLOG_CONSOLE)
ramlog_consoleinit();
#endif #endif
#ifdef CONFIG_PSEUDOTERM_SUSV1 #ifdef CONFIG_PSEUDOTERM_SUSV1
+4 -10
View File
@@ -60,15 +60,9 @@
#ifndef CONFIG_DEV_CONSOLE #ifndef CONFIG_DEV_CONSOLE
# undef USE_SERIALDRIVER # undef USE_SERIALDRIVER
# undef USE_EARLYSERIALINIT # undef USE_EARLYSERIALINIT
# undef CONFIG_RAMLOG_CONSOLE
#else #else
# if defined(CONFIG_RAMLOG_CONSOLE) # define USE_SERIALDRIVER 1
# undef USE_SERIALDRIVER # define USE_EARLYSERIALINIT 1
# undef USE_EARLYSERIALINIT
# else
# define USE_SERIALDRIVER 1
# define USE_EARLYSERIALINIT 1
# endif
#endif #endif
/* If some other device is used as the console, then the serial driver may /* If some other device is used as the console, then the serial driver may
@@ -78,13 +72,13 @@
*/ */
#if !defined(USE_SERIALDRIVER) && defined(CONFIG_STANDARD_SERIAL) #if !defined(USE_SERIALDRIVER) && defined(CONFIG_STANDARD_SERIAL)
# define USE_SERIALDRIVER 1 # define USE_SERIALDRIVER 1
#endif #endif
/* Check if an interrupt stack size is configured */ /* Check if an interrupt stack size is configured */
#ifndef CONFIG_ARCH_INTERRUPTSTACK #ifndef CONFIG_ARCH_INTERRUPTSTACK
# define CONFIG_ARCH_INTERRUPTSTACK 0 # define CONFIG_ARCH_INTERRUPTSTACK 0
#endif #endif
/* Macros to handle saving and restore interrupt state. In the current CPU12 /* Macros to handle saving and restore interrupt state. In the current CPU12
-2
View File
@@ -157,8 +157,6 @@ void up_initialize(void)
#if defined(CONFIG_CONSOLE_SYSLOG) #if defined(CONFIG_CONSOLE_SYSLOG)
syslog_console_init(); syslog_console_init();
#elif defined(CONFIG_RAMLOG_CONSOLE)
ramlog_consoleinit();
#endif #endif
#ifdef CONFIG_PSEUDOTERM_SUSV1 #ifdef CONFIG_PSEUDOTERM_SUSV1
+3 -9
View File
@@ -57,15 +57,9 @@
#ifndef CONFIG_DEV_CONSOLE #ifndef CONFIG_DEV_CONSOLE
# undef USE_SERIALDRIVER # undef USE_SERIALDRIVER
# undef USE_EARLYSERIALINIT # undef USE_EARLYSERIALINIT
# undef CONFIG_RAMLOG_CONSOLE
#else #else
# if defined(CONFIG_RAMLOG_CONSOLE) # define USE_SERIALDRIVER 1
# undef USE_SERIALDRIVER # define USE_EARLYSERIALINIT 1
# undef USE_EARLYSERIALINIT
# else
# define USE_SERIALDRIVER 1
# define USE_EARLYSERIALINIT 1
# endif
#endif #endif
/* If some other device is used as the console, then the serial driver may /* If some other device is used as the console, then the serial driver may
@@ -81,7 +75,7 @@
/* Check if an interrupt stack size is configured */ /* Check if an interrupt stack size is configured */
#ifndef CONFIG_ARCH_INTERRUPTSTACK #ifndef CONFIG_ARCH_INTERRUPTSTACK
# define CONFIG_ARCH_INTERRUPTSTACK 0 # define CONFIG_ARCH_INTERRUPTSTACK 0
#endif #endif
/* In the MIPS model, the state is copied from the stack to the TCB, but /* In the MIPS model, the state is copied from the stack to the TCB, but
+2 -8
View File
@@ -77,15 +77,9 @@
#ifndef CONFIG_DEV_CONSOLE #ifndef CONFIG_DEV_CONSOLE
# undef USE_SERIALDRIVER # undef USE_SERIALDRIVER
# undef USE_EARLYSERIALINIT # undef USE_EARLYSERIALINIT
# undef CONFIG_RAMLOG_CONSOLE
#else #else
# if defined(CONFIG_RAMLOG_CONSOLE) # define USE_SERIALDRIVER 1
# undef USE_SERIALDRIVER # define USE_EARLYSERIALINIT 1
# undef USE_EARLYSERIALINIT
# else
# define USE_SERIALDRIVER 1
# define USE_EARLYSERIALINIT 1
# endif
#endif #endif
/**************************************************************************** /****************************************************************************
+2 -8
View File
@@ -77,15 +77,9 @@
#ifndef CONFIG_DEV_CONSOLE #ifndef CONFIG_DEV_CONSOLE
# undef USE_SERIALDRIVER # undef USE_SERIALDRIVER
# undef USE_EARLYSERIALINIT # undef USE_EARLYSERIALINIT
# undef CONFIG_RAMLOG_CONSOLE
#else #else
# if defined(CONFIG_RAMLOG_CONSOLE) # define USE_SERIALDRIVER 1
# undef USE_SERIALDRIVER # define USE_EARLYSERIALINIT 1
# undef USE_EARLYSERIALINIT
# else
# define USE_SERIALDRIVER 1
# define USE_EARLYSERIALINIT 1
# endif
#endif #endif
/**************************************************************************** /****************************************************************************
-2
View File
@@ -248,8 +248,6 @@ void up_initialize(void)
#if defined(CONFIG_CONSOLE_SYSLOG) #if defined(CONFIG_CONSOLE_SYSLOG)
syslog_console_init(); syslog_console_init();
#elif defined(CONFIG_RAMLOG_CONSOLE)
ramlog_consoleinit();
#endif #endif
#ifdef CONFIG_PSEUDOTERM_SUSV1 #ifdef CONFIG_PSEUDOTERM_SUSV1
+3 -9
View File
@@ -60,15 +60,9 @@
#ifndef CONFIG_DEV_CONSOLE #ifndef CONFIG_DEV_CONSOLE
# undef USE_SERIALDRIVER # undef USE_SERIALDRIVER
# undef USE_EARLYSERIALINIT # undef USE_EARLYSERIALINIT
# undef CONFIG_RAMLOG_CONSOLE
#else #else
# if defined(CONFIG_RAMLOG_CONSOLE) # define USE_SERIALDRIVER 1
# undef USE_SERIALDRIVER # define USE_EARLYSERIALINIT 1
# undef USE_EARLYSERIALINIT
# else
# define USE_SERIALDRIVER 1
# define USE_EARLYSERIALINIT 1
# endif
#endif #endif
/* If some other device is used as the console, then the serial driver may /* If some other device is used as the console, then the serial driver may
@@ -84,7 +78,7 @@
/* Check if an interrupt stack size is configured */ /* Check if an interrupt stack size is configured */
#ifndef CONFIG_ARCH_INTERRUPTSTACK #ifndef CONFIG_ARCH_INTERRUPTSTACK
# define CONFIG_ARCH_INTERRUPTSTACK 0 # define CONFIG_ARCH_INTERRUPTSTACK 0
#endif #endif
#define up_savestate(regs) up_copyfullstate(regs, (uint32_t*)CURRENT_REGS) #define up_savestate(regs) up_copyfullstate(regs, (uint32_t*)CURRENT_REGS)
-2
View File
@@ -141,8 +141,6 @@ void up_initialize(void)
#if defined(CONFIG_CONSOLE_SYSLOG) #if defined(CONFIG_CONSOLE_SYSLOG)
syslog_console_init(); syslog_console_init();
#elif defined(CONFIG_RAMLOG_CONSOLE)
ramlog_consoleinit();
#endif #endif
#ifdef CONFIG_PSEUDOTERM_SUSV1 #ifdef CONFIG_PSEUDOTERM_SUSV1
+3 -9
View File
@@ -65,15 +65,9 @@
#ifndef CONFIG_DEV_CONSOLE #ifndef CONFIG_DEV_CONSOLE
# undef USE_SERIALDRIVER # undef USE_SERIALDRIVER
# undef USE_EARLYSERIALINIT # undef USE_EARLYSERIALINIT
# undef CONFIG_RAMLOG_CONSOLE
#else #else
# if defined(CONFIG_RAMLOG_CONSOLE) # define USE_SERIALDRIVER 1
# undef USE_SERIALDRIVER # define USE_EARLYSERIALINIT 1
# undef USE_EARLYSERIALINIT
# else
# define USE_SERIALDRIVER 1
# define USE_EARLYSERIALINIT 1
# endif
#endif #endif
/* If some other device is used as the console, then the serial driver may /* If some other device is used as the console, then the serial driver may
@@ -89,7 +83,7 @@
/* Check if an interrupt stack size is configured */ /* Check if an interrupt stack size is configured */
#ifndef CONFIG_ARCH_INTERRUPTSTACK #ifndef CONFIG_ARCH_INTERRUPTSTACK
# define CONFIG_ARCH_INTERRUPTSTACK 0 # define CONFIG_ARCH_INTERRUPTSTACK 0
#endif #endif
/**************************************************************************** /****************************************************************************
-6
View File
@@ -139,8 +139,6 @@ void up_initialize(void)
#if defined(CONFIG_CONSOLE_SYSLOG) #if defined(CONFIG_CONSOLE_SYSLOG)
syslog_console_init(); syslog_console_init();
#elif defined(CONFIG_RAMLOG_CONSOLE)
ramlog_consoleinit();
#endif #endif
#ifdef CONFIG_PSEUDOTERM_SUSV1 #ifdef CONFIG_PSEUDOTERM_SUSV1
@@ -156,9 +154,5 @@ void up_initialize(void)
syslog_initialize(SYSLOG_INIT_EARLY); syslog_initialize(SYSLOG_INIT_EARLY);
#ifdef CONFIG_RAMLOG_SYSLOG
ramlog_sysloginit();
#endif
board_autoled_on(LED_IRQSENABLED); board_autoled_on(LED_IRQSENABLED);
} }
+2 -8
View File
@@ -85,15 +85,9 @@
#ifndef CONFIG_DEV_CONSOLE #ifndef CONFIG_DEV_CONSOLE
# undef USE_SERIALDRIVER # undef USE_SERIALDRIVER
# undef USE_EARLYSERIALINIT # undef USE_EARLYSERIALINIT
# undef CONFIG_RAMLOG_CONSOLE
#else #else
# if defined(CONFIG_RAMLOG_CONSOLE) # define USE_SERIALDRIVER 1
# undef USE_SERIALDRIVER # define USE_EARLYSERIALINIT 1
# undef USE_EARLYSERIALINIT
# else
# define USE_SERIALDRIVER 1
# define USE_EARLYSERIALINIT 1
# endif
#endif #endif
/**************************************************************************** /****************************************************************************
-2
View File
@@ -232,8 +232,6 @@ void up_initialize(void)
up_devconsole(); /* Our private /dev/console */ up_devconsole(); /* Our private /dev/console */
#elif defined(CONFIG_CONSOLE_SYSLOG) #elif defined(CONFIG_CONSOLE_SYSLOG)
syslog_console_init(); syslog_console_init();
#elif defined(CONFIG_RAMLOG_CONSOLE)
ramlog_consoleinit();
#endif #endif
#ifdef CONFIG_PSEUDOTERM_SUSV1 #ifdef CONFIG_PSEUDOTERM_SUSV1
+1 -2
View File
@@ -89,9 +89,8 @@
#ifndef CONFIG_DEV_CONSOLE #ifndef CONFIG_DEV_CONSOLE
# undef USE_DEVCONSOLE # undef USE_DEVCONSOLE
# undef CONFIG_RAMLOG_CONSOLE
#else #else
# if defined(CONFIG_RAMLOG_CONSOLE) || defined(CONFIG_SYSLOG_RPMSG) # ifdef CONFIG_SYSLOG_RPMSG
# undef USE_DEVCONSOLE # undef USE_DEVCONSOLE
# else # else
# define USE_DEVCONSOLE 1 # define USE_DEVCONSOLE 1
-2
View File
@@ -157,8 +157,6 @@ void up_initialize(void)
#if defined(CONFIG_CONSOLE_SYSLOG) #if defined(CONFIG_CONSOLE_SYSLOG)
syslog_console_init(); syslog_console_init();
#elif defined(CONFIG_RAMLOG_CONSOLE)
ramlog_consoleinit();
#endif #endif
#ifdef CONFIG_PSEUDOTERM_SUSV1 #ifdef CONFIG_PSEUDOTERM_SUSV1
+3 -9
View File
@@ -59,15 +59,9 @@
#ifndef CONFIG_DEV_CONSOLE #ifndef CONFIG_DEV_CONSOLE
# undef USE_SERIALDRIVER # undef USE_SERIALDRIVER
# undef USE_EARLYSERIALINIT # undef USE_EARLYSERIALINIT
# undef CONFIG_RAMLOG_CONSOLE
#else #else
# if defined(CONFIG_RAMLOG_CONSOLE) # define USE_SERIALDRIVER 1
# undef USE_SERIALDRIVER # define USE_EARLYSERIALINIT 1
# undef USE_EARLYSERIALINIT
# else
# define USE_SERIALDRIVER 1
# define USE_EARLYSERIALINIT 1
# endif
#endif #endif
/* If some other device is used as the console, then the serial driver may /* If some other device is used as the console, then the serial driver may
@@ -83,7 +77,7 @@
/* Check if an interrupt stack size is configured */ /* Check if an interrupt stack size is configured */
#ifndef CONFIG_ARCH_INTERRUPTSTACK #ifndef CONFIG_ARCH_INTERRUPTSTACK
# define CONFIG_ARCH_INTERRUPTSTACK 0 # define CONFIG_ARCH_INTERRUPTSTACK 0
#endif #endif
/* Macros to handle saving and restore interrupt state. In the current /* Macros to handle saving and restore interrupt state. In the current
+2 -8
View File
@@ -60,15 +60,9 @@
#ifndef CONFIG_DEV_CONSOLE #ifndef CONFIG_DEV_CONSOLE
# undef USE_SERIALDRIVER # undef USE_SERIALDRIVER
# undef USE_EARLYSERIALINIT # undef USE_EARLYSERIALINIT
# undef CONFIG_RAMLOG_CONSOLE
#else #else
# if defined(CONFIG_RAMLOG_CONSOLE) # define USE_SERIALDRIVER 1
# undef USE_SERIALDRIVER # define USE_EARLYSERIALINIT 1
# undef USE_EARLYSERIALINIT
# else
# define USE_SERIALDRIVER 1
# define USE_EARLYSERIALINIT 1
# endif
#endif #endif
/* If some other device is used as the console, then the serial driver may /* If some other device is used as the console, then the serial driver may
@@ -165,8 +165,6 @@ void up_initialize(void)
#if defined(CONFIG_CONSOLE_SYSLOG) #if defined(CONFIG_CONSOLE_SYSLOG)
syslog_console_init(); syslog_console_init();
#elif defined(CONFIG_RAMLOG_CONSOLE)
ramlog_consoleinit();
#endif #endif
#ifdef CONFIG_PSEUDOTERM_SUSV1 #ifdef CONFIG_PSEUDOTERM_SUSV1
-2
View File
@@ -157,8 +157,6 @@ void up_initialize(void)
#if defined(CONFIG_CONSOLE_SYSLOG) #if defined(CONFIG_CONSOLE_SYSLOG)
syslog_console_init(); syslog_console_init();
#elif defined(CONFIG_RAMLOG_CONSOLE)
ramlog_consoleinit();
#endif #endif
#ifdef CONFIG_PSEUDOTERM_SUSV1 #ifdef CONFIG_PSEUDOTERM_SUSV1
+2 -8
View File
@@ -66,15 +66,9 @@
#elif !defined(CONFIG_DEV_CONSOLE) #elif !defined(CONFIG_DEV_CONSOLE)
# undef USE_SERIALDRIVER # undef USE_SERIALDRIVER
# undef USE_EARLYSERIALINIT # undef USE_EARLYSERIALINIT
# undef CONFIG_RAMLOG_CONSOLE
#else #else
# if defined(CONFIG_RAMLOG_CONSOLE) # define USE_SERIALDRIVER 1
# undef USE_SERIALDRIVER # define USE_EARLYSERIALINIT 1
# undef USE_EARLYSERIALINIT
# else
# define USE_SERIALDRIVER 1
# define USE_EARLYSERIALINIT 1
# endif
#endif #endif
/* If some other device is used as the console, then the serial driver may /* If some other device is used as the console, then the serial driver may
-2
View File
@@ -156,8 +156,6 @@ void up_initialize(void)
#if defined(CONFIG_CONSOLE_SYSLOG) #if defined(CONFIG_CONSOLE_SYSLOG)
syslog_console_init(); syslog_console_init();
#elif defined(CONFIG_RAMLOG_CONSOLE)
ramlog_consoleinit();
#endif #endif
#ifdef CONFIG_PSEUDOTERM_SUSV1 #ifdef CONFIG_PSEUDOTERM_SUSV1
+1 -12
View File
@@ -59,11 +59,8 @@
#if !defined(CONFIG_DEV_CONSOLE) #if !defined(CONFIG_DEV_CONSOLE)
# undef USE_SERIALDRIVER # undef USE_SERIALDRIVER
# undef CONFIG_RAMLOG_CONSOLE
#else #else
# if defined(CONFIG_RAMLOG_CONSOLE) # if defined(CONFIG_CONSOLE_SYSLOG)
# undef USE_SERIALDRIVER
# elif defined(CONFIG_CONSOLE_SYSLOG)
# undef USE_SERIALDRIVER # undef USE_SERIALDRIVER
# else # else
# define USE_SERIALDRIVER 1 # define USE_SERIALDRIVER 1
@@ -126,14 +123,6 @@ void syslog_console_init();
# define syslog_console_init() # define syslog_console_init()
#endif #endif
/* Defined in drivers/ramlog.c */
#ifdef CONFIG_RAMLOG_CONSOLE
void ramlog_consoleinit(void);
#else
# define ramlog_consoleinit()
#endif
/* Low level string output */ /* Low level string output */
void up_puts(const char *str); void up_puts(const char *str);
-1
View File
@@ -834,7 +834,6 @@ Configurations
Device Drivers: Device Drivers:
CONFIG_RAMLOG=y : Enable the RAM-based logging feature. CONFIG_RAMLOG=y : Enable the RAM-based logging feature.
CONFIG_RAMLOG_CONSOLE=n : (We don't use the RAMLOG console)
CONFIG_RAMLOG_SYSLOG=y : This enables the RAM-based logger as the CONFIG_RAMLOG_SYSLOG=y : This enables the RAM-based logger as the
system logger. system logger.
CONFIG_RAMLOG_NONBLOCKING=y : Needs to be non-blocking for dmesg CONFIG_RAMLOG_NONBLOCKING=y : Needs to be non-blocking for dmesg
-1
View File
@@ -4300,7 +4300,6 @@ Configurations
Device Drivers: Device Drivers:
CONFIG_RAMLOG=y : Enable the RAM-based logging feature. CONFIG_RAMLOG=y : Enable the RAM-based logging feature.
CONFIG_RAMLOG_CONSOLE=n : (We don't use the RAMLOG console)
CONFIG_RAMLOG_SYSLOG=y : This enables the RAM-based logger as the CONFIG_RAMLOG_SYSLOG=y : This enables the RAM-based logger as the
system logger. system logger.
CONFIG_RAMLOG_NONBLOCKING=y : Needs to be non-blocking for dmesg CONFIG_RAMLOG_NONBLOCKING=y : Needs to be non-blocking for dmesg
-1
View File
@@ -1877,7 +1877,6 @@ Configuration sub-directories
Device Drivers: Device Drivers:
CONFIG_RAMLOG=y : Enable the RAM-based logging feature. CONFIG_RAMLOG=y : Enable the RAM-based logging feature.
CONFIG_RAMLOG_CONSOLE=n : (We don't use the RAMLOG console)
CONFIG_RAMLOG_SYSLOG=y : This enables the RAM-based logger as the CONFIG_RAMLOG_SYSLOG=y : This enables the RAM-based logger as the
system logger. system logger.
CONFIG_RAMLOG_NONBLOCKING=y : Needs to be non-blocking for dmesg CONFIG_RAMLOG_NONBLOCKING=y : Needs to be non-blocking for dmesg
@@ -406,7 +406,6 @@ Configurations
Device Drivers: Device Drivers:
CONFIG_RAMLOG=y : Enable the RAM-based logging feature. CONFIG_RAMLOG=y : Enable the RAM-based logging feature.
CONFIG_RAMLOG_CONSOLE=n : (We don't use the RAMLOG console)
CONFIG_RAMLOG_SYSLOG=y : This enables the RAM-based logger as the CONFIG_RAMLOG_SYSLOG=y : This enables the RAM-based logger as the
system logger. system logger.
CONFIG_RAMLOG_NONBLOCKING=y : Needs to be non-blocking for dmesg CONFIG_RAMLOG_NONBLOCKING=y : Needs to be non-blocking for dmesg
+1 -1
View File
@@ -734,7 +734,7 @@ Where <subdir> is one of the following:
There are some special settings to make life with only a Telnet There are some special settings to make life with only a Telnet
CONFIG_RAMLOG=y - Enable the RAM-based logging feature. CONFIG_RAMLOG=y - Enable the RAM-based logging feature.
CONFIG_RAMLOG_CONSOLE=y - Use the RAM logger as the default console. CONFIG_CONSOLE_SYSLOG=y - Use the RAM logger as the default console.
This means that any console output from non-Telnet threads will This means that any console output from non-Telnet threads will
go into the circular buffer in RAM. go into the circular buffer in RAM.
CONFIG_RAMLOG_SYSLOG - This enables the RAM-based logger as the CONFIG_RAMLOG_SYSLOG - This enables the RAM-based logger as the
+1 -1
View File
@@ -1104,7 +1104,7 @@ Where <subdir> is one of the following:
There are some special settings to make life with only a Telnet There are some special settings to make life with only a Telnet
CONFIG_RAMLOG=y - Enable the RAM-based logging feature. CONFIG_RAMLOG=y - Enable the RAM-based logging feature.
CONFIG_RAMLOG_CONSOLE=y - Use the RAM logger as the default console. CONFIG_CONSOLE_SYSLOG=y - Use the RAM logger as the default console.
This means that any console output from non-Telnet threads will This means that any console output from non-Telnet threads will
go into the circular buffer in RAM. go into the circular buffer in RAM.
CONFIG_RAMLOG_SYSLOG - This enables the RAM-based logger as the CONFIG_RAMLOG_SYSLOG - This enables the RAM-based logger as the
@@ -1111,7 +1111,6 @@ Where <subdir> is one of the following:
3. The RAM log is enabled" 3. The RAM log is enabled"
CONFIG_RAMLOG=y : Enable the RAM-based logging feature. CONFIG_RAMLOG=y : Enable the RAM-based logging feature.
CONFIG_RAMLOG_CONSOLE=n : (there is no default console device)
CONFIG_RAMLOG_SYSLOG=y : This enables the RAM-based logger as the CONFIG_RAMLOG_SYSLOG=y : This enables the RAM-based logger as the
system logger. system logger.
@@ -893,7 +893,6 @@ Where <subdir> is one of the following:
Device Drivers -> System Logging Device Options: Device Drivers -> System Logging Device Options:
CONFIG_RAMLOG=y : Enable the RAM-based logging feature. CONFIG_RAMLOG=y : Enable the RAM-based logging feature.
CONFIG_RAMLOG_CONSOLE=n : (there is no default console device)
CONFIG_RAMLOG_SYSLOG=y : This enables the RAM-based logger as the CONFIG_RAMLOG_SYSLOG=y : This enables the RAM-based logger as the
system logger. system logger.
+1 -12
View File
@@ -32,21 +32,10 @@ config RAMLOG
details as needed to support logging. details as needed to support logging.
if RAMLOG if RAMLOG
config RAMLOG_CONSOLE
bool "Use RAMLOG for /dev/console"
default n
depends on DEV_CONSOLE
---help---
Use the RAM logging device as a system console. If this feature is enabled (along
with DEV_CONSOLE), then all console output will be re-directed to a circular
buffer in RAM. This is useful, for example, if the only console is a Telnet
console. Then in that case, console output from non-Telnet threads will go to
the circular buffer and can be viewed using the NSH 'dmesg' command.
config RAMLOG_BUFSIZE config RAMLOG_BUFSIZE
int "RAMLOG buffer size" int "RAMLOG buffer size"
default 1024 default 1024
depends on RAMLOG_SYSLOG || RAMLOG_CONSOLE depends on RAMLOG_SYSLOG
---help--- ---help---
Size of the console RAM log. Default: 1024 Size of the console RAM log. Default: 1024
+2 -9
View File
@@ -469,13 +469,6 @@ RAM Logging Device
---------------------------- ----------------------------
* CONFIG_RAMLOG - Enables the RAM logging feature * CONFIG_RAMLOG - Enables the RAM logging feature
* CONFIG_RAMLOG_CONSOLE - Use the RAM logging device as a system
console. If this feature is enabled (along with CONFIG_DEV_CONSOLE),
then all console output will be re-directed to a circular buffer in
RAM. This might be useful, for example, if the only console is a
Telnet console. Then in that case, console output from non-Telnet
threads will go to the circular buffer and can be viewed using the NSH
dmesg command. This optional is not useful in other scenarios.
* CONFIG_RAMLOG_SYSLOG - Use the RAM logging device for the syslogging * CONFIG_RAMLOG_SYSLOG - Use the RAM logging device for the syslogging
interface. If this feature is enabled, then all debug output (only) interface. If this feature is enabled, then all debug output (only)
will be re-directed to the circular buffer in RAM. This RAM log can will be re-directed to the circular buffer in RAM. This RAM log can
@@ -485,8 +478,8 @@ RAM Logging Device
* CONFIG_RAMLOG_NPOLLWAITERS - The number of threads than can be waiting * CONFIG_RAMLOG_NPOLLWAITERS - The number of threads than can be waiting
for this driver on poll(). Default: 4 for this driver on poll(). Default: 4
If CONFIG_RAMLOG_CONSOLE or CONFIG_RAMLOG_SYSLOG is selected, then the If CONFIG_RAMLOG_SYSLOG is selected, then the following must also be
following must also be provided: provided:
* CONFIG_RAMLOG_BUFSIZE - The size of the circular buffer to use. * CONFIG_RAMLOG_BUFSIZE - The size of the circular buffer to use.
Default: 1024 bytes. Default: 1024 bytes.
+2 -26
View File
@@ -152,7 +152,7 @@ static const struct file_operations g_ramlogfops =
* for the syslogging function. * for the syslogging function.
*/ */
#if defined(CONFIG_RAMLOG_CONSOLE) || defined(CONFIG_RAMLOG_SYSLOG) #ifdef CONFIG_RAMLOG_SYSLOG
static char g_sysbuffer[CONFIG_RAMLOG_BUFSIZE]; static char g_sysbuffer[CONFIG_RAMLOG_BUFSIZE];
/* This is the device structure for the console or syslogging function. It /* This is the device structure for the console or syslogging function. It
@@ -677,7 +677,6 @@ errout:
* *
****************************************************************************/ ****************************************************************************/
#if !defined(CONFIG_RAMLOG_CONSOLE) && !defined(CONFIG_RAMLOG_SYSLOG)
int ramlog_register(FAR const char *devpath, FAR char *buffer, size_t buflen) int ramlog_register(FAR const char *devpath, FAR char *buffer, size_t buflen)
{ {
FAR struct ramlog_dev_s *priv; FAR struct ramlog_dev_s *priv;
@@ -719,26 +718,6 @@ int ramlog_register(FAR const char *devpath, FAR char *buffer, size_t buflen)
return ret; return ret;
} }
#endif
/****************************************************************************
* Name: ramlog_consoleinit
*
* Description:
* Use a pre-allocated RAM logging device and register it at /dev/console
*
****************************************************************************/
#ifdef CONFIG_RAMLOG_CONSOLE
int ramlog_consoleinit(void)
{
FAR struct ramlog_dev_s *priv = &g_sysdev;
/* Register the console character driver */
return register_driver("/dev/console", &g_ramlogfops, 0666, priv);
}
#endif
/**************************************************************************** /****************************************************************************
* Name: ramlog_syslog_channel * Name: ramlog_syslog_channel
@@ -747,9 +726,6 @@ int ramlog_consoleinit(void)
* Use a pre-allocated RAM logging device and register it at the path * Use a pre-allocated RAM logging device and register it at the path
* specified by CONFIG_RAMLOG_SYSLOG * specified by CONFIG_RAMLOG_SYSLOG
* *
* If CONFIG_RAMLOG_CONSOLE is also defined, then this functionality is
* performed when ramlog_consoleinit() is called.
*
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_RAMLOG_SYSLOG #ifdef CONFIG_RAMLOG_SYSLOG
@@ -779,7 +755,7 @@ int ramlog_syslog_channel(void)
* *
****************************************************************************/ ****************************************************************************/
#if defined(CONFIG_RAMLOG_CONSOLE) || defined(CONFIG_RAMLOG_SYSLOG) #ifdef CONFIG_RAMLOG_SYSLOG
int ramlog_putc(int ch) int ramlog_putc(int ch)
{ {
FAR struct ramlog_dev_s *priv = &g_sysdev; FAR struct ramlog_dev_s *priv = &g_sysdev;
+4 -35
View File
@@ -66,12 +66,6 @@
/* Configuration ************************************************************/ /* Configuration ************************************************************/
/* CONFIG_RAMLOG - Enables the RAM logging feature /* CONFIG_RAMLOG - Enables the RAM logging feature
* CONFIG_RAMLOG_CONSOLE - Use the RAM logging device as a system console.
* If this feature is enabled (along with CONFIG_DEV_CONSOLE), then all
* console output will be re-directed to a circular buffer in RAM. This
* is useful, for example, if the only console is a Telnet console. Then
* in that case, console output from non-Telnet threads will go to the
* circular buffer and can be viewed using the NSH 'dmesg' command.
* CONFIG_RAMLOG_SYSLOG - Use the RAM logging device for the syslogging * CONFIG_RAMLOG_SYSLOG - Use the RAM logging device for the syslogging
* interface. If this feature is enabled then all debug output (only) * interface. If this feature is enabled then all debug output (only)
* will be re-directed to the circular buffer in RAM. This RAM log can * will be re-directed to the circular buffer in RAM. This RAM log can
@@ -81,16 +75,12 @@
* CONFIG_RAMLOG_NPOLLWAITERS - The number of threads than can be waiting * CONFIG_RAMLOG_NPOLLWAITERS - The number of threads than can be waiting
* for this driver on poll(). Default: 4 * for this driver on poll(). Default: 4
* *
* If CONFIG_RAMLOG_CONSOLE or CONFIG_RAMLOG_SYSLOG is selected, then the * If CONFIG_RAMLOG_SYSLOG is selected, then the following may also be
* following may also be provided: * provided:
* *
* CONFIG_RAMLOG_BUFSIZE - Size of the console RAM log. Default: 1024 * CONFIG_RAMLOG_BUFSIZE - Size of the console RAM log. Default: 1024
*/ */
#ifndef CONFIG_DEV_CONSOLE
# undef CONFIG_RAMLOG_CONSOLE
#endif
#if defined(CONFIG_RAMLOG_SYSLOG) && !defined(CONFIG_SYSLOG_DEVPATH) #if defined(CONFIG_RAMLOG_SYSLOG) && !defined(CONFIG_SYSLOG_DEVPATH)
# define CONFIG_SYSLOG_DEVPATH "/dev/ramlog" # define CONFIG_SYSLOG_DEVPATH "/dev/ramlog"
#endif #endif
@@ -130,32 +120,14 @@ extern "C"
* *
* This interface is not normally used but can be made available is * This interface is not normally used but can be made available is
* someone just wants to tinker with the RAM log as a generic character * someone just wants to tinker with the RAM log as a generic character
* device. Normally both CONFIG_RAMLOG_CONSOLE and CONFIG_RAMLOG_SYSLOG * device. Normally both CONFIG_CONSOLE_SYSLOG and CONFIG_RAMLOG_SYSLOG
* would be set (to capture all output in the log) -OR- just * would be set (to capture all output in the log) -OR- just
* CONFIG_RAMLOG_SYSLOG would be set to capture debug output only * CONFIG_RAMLOG_SYSLOG would be set to capture debug output only
* in the log. * in the log.
* *
****************************************************************************/ ****************************************************************************/
#if !defined(CONFIG_RAMLOG_CONSOLE) && !defined(CONFIG_RAMLOG_SYSLOG)
int ramlog_register(FAR const char *devpath, FAR char *buffer, size_t buflen); int ramlog_register(FAR const char *devpath, FAR char *buffer, size_t buflen);
#endif
/****************************************************************************
* Name: ramlog_consoleinit
*
* Description:
* Create the RAM logging device and register it at the specified path.
* Mostly likely this path will be /dev/console.
*
* If CONFIG_RAMLOG_SYSLOG is also defined, then the same RAM logging
* device is also registered at CONFIG_SYSLOG_DEVPATH
*
****************************************************************************/
#ifdef CONFIG_RAMLOG_CONSOLE
int ramlog_consoleinit(void);
#endif
/**************************************************************************** /****************************************************************************
* Name: ramlog_syslog_channel * Name: ramlog_syslog_channel
@@ -164,9 +136,6 @@ int ramlog_consoleinit(void);
* Create the RAM logging device and register it at the specified path. * Create the RAM logging device and register it at the specified path.
* Mostly likely this path will be CONFIG_SYSLOG_DEVPATH * Mostly likely this path will be CONFIG_SYSLOG_DEVPATH
* *
* If CONFIG_RAMLOG_CONSOLE is also defined, then this functionality is
* performed when ramlog_consoleinit() is called.
*
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_RAMLOG_SYSLOG #ifdef CONFIG_RAMLOG_SYSLOG
@@ -181,7 +150,7 @@ int ramlog_syslog_channel(void);
* *
****************************************************************************/ ****************************************************************************/
#if defined(CONFIG_RAMLOG_CONSOLE) || defined(CONFIG_RAMLOG_SYSLOG) #ifdef CONFIG_RAMLOG_SYSLOG
int ramlog_putc(int ch); int ramlog_putc(int ch);
#endif #endif