Remove lowsyslog(). The new syslog() includes all of the functionality of lowsyslog(). No longer any need for two interfaces.

This commit is contained in:
Gregory Nutt 2016-06-20 08:57:08 -06:00
parent 5002e27e84
commit 2b445ddccc
43 changed files with 243 additions and 575 deletions

View File

@ -51,22 +51,6 @@
#include "group/group.h"
/********************************************************************************
* Pre-processor Definitions
********************************************************************************/
/********************************************************************************
* Public Data
********************************************************************************/
/********************************************************************************
* Private Data
********************************************************************************/
/********************************************************************************
* Private Functions
********************************************************************************/
/********************************************************************************
* Public Functions
********************************************************************************/
@ -74,8 +58,8 @@
void up_decodeirq(uint32_t *regs)
{
#ifdef CONFIG_SUPPRESS_INTERRUPTS
lowsyslog(LOG_ERR, "Unexpected IRQ\n");
CURRENT_REGS = regs;
err("ERROR: Unexpected IRQ\n");
PANIC();
#else
/* Decode the interrupt. First, fetch the interrupt id register. */

View File

@ -74,8 +74,8 @@
void up_decodeirq(uint32_t *regs)
{
#ifdef CONFIG_SUPPRESS_INTERRUPTS
lowsyslog(LOG_ERR, "Unexpected IRQ\n");
CURRENT_REGS = regs;
err("ERROR: Unexpected IRQ\n");
PANIC();
#else
uint32_t regval;

View File

@ -111,8 +111,8 @@ static void lpc214x_decodeirq(uint32_t *regs)
#endif
{
#ifdef CONFIG_SUPPRESS_INTERRUPTS
lowsyslog(LOG_ERR, "Unexpected IRQ\n");
CURRENT_REGS = regs;
err("ERROR: Unexpected IRQ\n");
PANIC();
#else

View File

@ -110,9 +110,9 @@ static void lpc23xx_decodeirq(uint32_t *regs)
#endif
{
#ifdef CONFIG_SUPPRESS_INTERRUPTS
lowsyslog(LOG_ERR, "Unexpected IRQ\n");
CURRENT_REGS = regs;
PANIC();
err("ERROR: Unexpected IRQ\n");
CURRENT_REGS = regs;
#else
/* Check which IRQ fires */

View File

@ -76,8 +76,8 @@
void up_decodeirq(uint32_t *regs)
{
#ifdef CONFIG_SUPPRESS_INTERRUPTS
lowsyslog(LOG_ERR, "Unexpected IRQ\n");
CURRENT_REGS = regs;
err("ERROR: Unexpected IRQ\n");
PANIC();
#else
int index;

View File

@ -91,8 +91,8 @@ void up_decodeirq(uint32_t *regs)
{
#ifdef CONFIG_SUPPRESS_INTERRUPTS
board_autoled_on(LED_INIRQ);
lowsyslog(LOG_ERR, "Unexpected IRQ\n");
CURRENT_REGS = regs;
err("ERROR: Unexpected IRQ\n");
PANIC();
#else
unsigned int irq;

View File

@ -72,19 +72,15 @@
} \
while(0)
/* __arch_syslog() and __arch_lowsyslog() override behavior of NuttX
* dbg macros. They put the format string into program memory and
* utilize IPTR (__memx) parameter of syslog to take the format
* directly from program memory. This reduces amount of RAM held by
* the format strings used in debug statements.
/* __arch_syslog() overrides the behavior of NuttX debug macros. They put
* the format string into program memory and utilize IPTR (__memx) parameter
* of syslog to take the format directly from program memory. This reduces
* amount of RAM held by the format strings used in debug statements.
*/
#define __arch_syslog(...) \
__dbg_expand(syslog, ##__VA_ARGS__)
#define __arch_lowsyslog(...) \
__dbg_expand(lowsyslog, ##__VA_ARGS__)
#endif /* CONFIG_AVR_HAS_MEMX_PTR */
#endif /* __INCLUDE_ARCH_DEBUG_H */

View File

@ -68,19 +68,19 @@ void sched_note_start(FAR struct tcb_s *tcb)
{
#ifdef CONFIG_SMP
#if CONFIG_TASK_NAME_SIZE > 0
lowsyslog(LOG_INFO, "CPU%d: Start %s, TCB@%p, state=%d\n",
tcb->cpu, tcb->name, tcb, tcb->task_state);
syslog(LOG_INFO, "CPU%d: Start %s, TCB@%p, state=%d\n",
tcb->cpu, tcb->name, tcb, tcb->task_state);
#else
lowsyslog(LOG_INFO, "CPU%d: Start TCB@%p, state=%d\n"
tcb->cpu, tcb, tcb->task_state);
syslog(LOG_INFO, "CPU%d: Start TCB@%p, state=%d\n"
tcb->cpu, tcb, tcb->task_state);
#endif
#else
#if CONFIG_TASK_NAME_SIZE > 0
lowsyslog(LOG_INFO, "Start %s, TCB@%p, state=%d\n",
tcb->name, tcb, tcb->task_state);
syslog(LOG_INFO, "Start %s, TCB@%p, state=%d\n",
tcb->name, tcb, tcb->task_state);
#else
lowsyslog(LOG_INFO, "Start TCB@%p, state=%d\n",
tcb, tcb->task_state);
syslog(LOG_INFO, "Start TCB@%p, state=%d\n",
tcb, tcb->task_state);
#endif
#endif
}
@ -89,19 +89,19 @@ void sched_note_stop(FAR struct tcb_s *tcb)
{
#ifdef CONFIG_SMP
#if CONFIG_TASK_NAME_SIZE > 0
lowsyslog(LOG_INFO, "CPU%d: Stop %s, TCB@%p, state=%d\n",
tcb->cpu, tcb->name, tcb, tcb->task_state);
syslog(LOG_INFO, "CPU%d: Stop %s, TCB@%p, state=%d\n",
tcb->cpu, tcb->name, tcb, tcb->task_state);
#else
lowsyslog(LOG_INFO, "CPU%d: Stop TCB@%p, state=%d\n",
tcb->cpu, tcb, tcb->task_state);
syslog(LOG_INFO, "CPU%d: Stop TCB@%p, state=%d\n",
tcb->cpu, tcb, tcb->task_state);
#endif
#else
#if CONFIG_TASK_NAME_SIZE > 0
lowsyslog(LOG_INFO, "Stop %s, TCB@%p, state=%d\n",
tcb->name, tcb, tcb->task_state);
syslog(LOG_INFO, "Stop %s, TCB@%p, state=%d\n",
tcb->name, tcb, tcb->task_state);
#else
lowsyslog(LOG_INFO, "Stop TCB@%p, state=%d\n",
tcb, tcb->task_state);
syslog(LOG_INFO, "Stop TCB@%p, state=%d\n",
tcb, tcb->task_state);
#endif
#endif
}
@ -110,19 +110,19 @@ void sched_note_suspend(FAR struct tcb_s *tcb)
{
#ifdef CONFIG_SMP
#if CONFIG_TASK_NAME_SIZE > 0
lowsyslog(LOG_INFO, "CPU%d: Suspend %s, TCB@%p, state=%d\n",
tcb->cpu, tcb->name, tcb, tcb->task_state);
syslog(LOG_INFO, "CPU%d: Suspend %s, TCB@%p, state=%d\n",
tcb->cpu, tcb->name, tcb, tcb->task_state);
#else
lowsyslog(LOG_INFO, "CPU%d: Suspend TCB@%p, state=%d\n",
tcb->cpu, tcb, tcb->task_state);
syslog(LOG_INFO, "CPU%d: Suspend TCB@%p, state=%d\n",
tcb->cpu, tcb, tcb->task_state);
#endif
#else
#if CONFIG_TASK_NAME_SIZE > 0
lowsyslog(LOG_INFO, "Suspend %s, TCB@%p, state=%d\n",
tcb->name, tcb, tcb->task_state);
syslog(LOG_INFO, "Suspend %s, TCB@%p, state=%d\n",
tcb->name, tcb, tcb->task_state);
#else
lowsyslog(LOG_INFO, "Suspend TCB@%p, state=%d\n",
tcb, tcb->task_state);
syslog(LOG_INFO, "Suspend TCB@%p, state=%d\n",
tcb, tcb->task_state);
#endif
#endif
}
@ -131,19 +131,19 @@ void sched_note_resume(FAR struct tcb_s *tcb)
{
#ifdef CONFIG_SMP
#if CONFIG_TASK_NAME_SIZE > 0
lowsyslog(LOG_INFO, "CPU%d: Resume %s, TCB@%p, state=%d\n",
tcb->cpu, tcb->name, tcb, tcb->task_state);
syslog(LOG_INFO, "CPU%d: Resume %s, TCB@%p, state=%d\n",
tcb->cpu, tcb->name, tcb, tcb->task_state);
#else
lowsyslog(LOG_INFO, "CPU%d: Resume TCB@%p, state=%d\n",
tcb->cpu, tcb, tcb->task_state);
syslog(LOG_INFO, "CPU%d: Resume TCB@%p, state=%d\n",
tcb->cpu, tcb, tcb->task_state);
#endif
#else
#if CONFIG_TASK_NAME_SIZE > 0
lowsyslog(LOG_INFO, "Resume %s, TCB@%p, state=%d\n",
tcb->name, tcb, tcb->task_state);
syslog(LOG_INFO, "Resume %s, TCB@%p, state=%d\n",
tcb->name, tcb, tcb->task_state);
#else
lowsyslog(LOG_INFO, "Resume TCB@%p, state=%d\n",
tcb, tcb->task_state);
syslog(LOG_INFO, "Resume TCB@%p, state=%d\n",
tcb, tcb->task_state);
#endif
#endif
}
@ -160,19 +160,19 @@ void sched_note_premption(FAR struct tcb_s *tcb, bool locked)
{
#ifdef CONFIG_SMP
#if CONFIG_TASK_NAME_SIZE > 0
lowsyslog(LOG_INFO, "CPU%d: Task %s TCB@%p preemption %s\n",
tcb->cpu, tcb->name, tcb, locked ? "LOCKED" : "UNLOCKED");
syslog(LOG_INFO, "CPU%d: Task %s TCB@%p preemption %s\n",
tcb->cpu, tcb->name, tcb, locked ? "LOCKED" : "UNLOCKED");
#else
lowsyslog(LOG_INFO, "CPU%d: TCB@%p preemption %s\n",
tcb->cpu, tcb, locked ? "LOCKED" : "UNLOCKED");
syslog(LOG_INFO, "CPU%d: TCB@%p preemption %s\n",
tcb->cpu, tcb, locked ? "LOCKED" : "UNLOCKED");
#endif
#else
#if CONFIG_TASK_NAME_SIZE > 0
lowsyslog(LOG_INFO, "Task %s, TCB@%p preemption %s\n",
tcb->name, tcb, locked ? "LOCKED" : "UNLOCKED");
syslog(LOG_INFO, "Task %s, TCB@%p preemption %s\n",
tcb->name, tcb, locked ? "LOCKED" : "UNLOCKED");
#else
lowsyslog(LOG_INFO, "TCB@%p preemption %s\n",
tcb, locked ? "LOCKED" : "UNLOCKED");
syslog(LOG_INFO, "TCB@%p preemption %s\n",
tcb, locked ? "LOCKED" : "UNLOCKED");
#endif
#endif
}
@ -190,19 +190,19 @@ void sched_note_csection(FAR struct tcb_s *tcb, bool enter)
{
#ifdef CONFIG_SMP
#if CONFIG_TASK_NAME_SIZE > 0
lowsyslog(LOG_INFO, "CPU%d: Task %s TCB@%p critical section %s\n",
tcb->cpu, tcb->name, tcb, enter ? "ENTER" : "LEAVE");
syslog(LOG_INFO, "CPU%d: Task %s TCB@%p critical section %s\n",
tcb->cpu, tcb->name, tcb, enter ? "ENTER" : "LEAVE");
#else
lowsyslog(LOG_INFO, "CPU%d: TCB@%p critical section %s\n",
tcb->cpu, tcb, enter ? "ENTER" : "LEAVE");
syslog(LOG_INFO, "CPU%d: TCB@%p critical section %s\n",
tcb->cpu, tcb, enter ? "ENTER" : "LEAVE");
#endif
#else
#if CONFIG_TASK_NAME_SIZE > 0
lowsyslog(LOG_INFO, "Task %s, TCB@%p critical section %s\n",
tcb->name, tcb, enter ? "ENTER" : "LEAVE");
syslog(LOG_INFO, "Task %s, TCB@%p critical section %s\n",
tcb->name, tcb, enter ? "ENTER" : "LEAVE");
#else
lowsyslog(LOG_INFO, "TCB@%p critical section %s\n",
tcb, enter ? "ENTER" : "LEAVE");
syslog(LOG_INFO, "TCB@%p critical section %s\n",
tcb, enter ? "ENTER" : "LEAVE");
#endif
#endif
}

View File

@ -88,42 +88,42 @@ void z16f_sysexec(FAR chipreg_t *regs)
excp = getreg16(Z16F_SYSEXCP);
if ((excp & Z16F_SYSEXCP_SPOVF) != 0)
{
lowsyslog(LOG_ERR, "SP OVERFLOW\n");
err("ERROR: SP OVERFLOW\n");
}
if ((excp & Z16F_SYSEXCP_PCOVF) != 0)
{
lowsyslog(LOG_ERR, "PC OVERFLOW\n");
err("ERROR: PC OVERFLOW\n");
}
if ((excp & Z16F_SYSEXCP_DIV0) != 0)
{
lowsyslog(LOG_ERR, "Divide by zero\n");
err("ERROR: Divide by zero\n");
}
if ((excp & Z16F_SYSEXCP_DIVOVF) != 0)
{
lowsyslog(LOG_ERR, "Divide overflow\n");
err("ERROR: Divide overflow\n");
}
if ((excp & Z16F_SYSEXCP_ILL) != 0)
{
lowsyslog(LOG_ERR, "Illegal instruction\n");
err("ERROR: Illegal instruction\n");
}
if ((excp & Z16F_SYSEXCP_WDTOSC) != 0)
{
lowsyslog(LOG_ERR, "WDT oscillator failure\n");
err("ERROR: WDT oscillator failure\n");
}
if ((excp & Z16F_SYSEXCP_PRIOSC) != 0)
{
lowsyslog(LOG_ERR, "Primary Oscillator Failure\n");
err("ERROR: Primary Oscillator Failure\n");
}
if ((excp & Z16F_SYSEXCP_WDT) != 0)
{
lowsyslog(LOG_ERR, "Watchdog timeout\n");
err("ERROR: Watchdog timeout\n");
z16f_reset();
}

View File

@ -78,8 +78,8 @@ FAR chipreg_t *up_doirq(uint8_t irq, FAR chipreg_t *regs)
#ifdef CONFIG_SUPPRESS_INTERRUPTS
lowsyslog(LOG_ERR, "Unexpected IRQ\n");
IRQ_ENTER(regs);
err("ERROR: Unexpected IRQ\n");
PANIC();
return NULL; /* Won't get here */

View File

@ -93,8 +93,7 @@ int board_usbmsc_initialize(int port)
pbuffer = (uint8_t *)kmm_malloc(BUFFER_SIZE);
if (!pbuffer)
{
lowsyslog(LOG_ERR, "ERROR: Failed to allocate ramdisk of size %d\n",
BUFFER_SIZE);
err("ERROR: Failed to allocate ramdisk of size %d\n", BUFFER_SIZE);
return -ENOMEM;
}
@ -107,9 +106,8 @@ int board_usbmsc_initialize(int port)
RDFLAG_WRENABLED | RDFLAG_FUNLINK);
if (ret < 0)
{
syslog(LOG_ERR,
"ERROR: create_ramdisk: Failed to register ramdisk at %s: %d\n",
g_source, -ret);
err("ERROR: create_ramdisk: Failed to register ramdisk at %s: %d\n",
g_source, -ret);
kmm_free(pbuffer);
return ret;
}
@ -119,9 +117,8 @@ int board_usbmsc_initialize(int port)
ret = mkfatfs(g_source, &g_fmt);
if (ret < 0)
{
syslog(LOG_ERR,
"ERROR: create_ramdisk: Failed to create FAT filesystem on ramdisk at %s\n",
g_source);
err("ERROR: create_ramdisk: Failed to create FAT filesystem on ramdisk at %s\n",
g_source);
/* kmm_free(pbuffer); -- RAM disk is registered */
return ret;
}

View File

@ -93,8 +93,8 @@ int board_usbmsc_initialize(int port)
pbuffer = (uint8_t *)kmm_malloc(BUFFER_SIZE);
if (!pbuffer)
{
lowsyslog("board_usbmsc_initialize: Failed to allocate ramdisk of size %d\n",
BUFFER_SIZE);
err("ERROR: board_usbmsc_initialize: Failed to allocate ramdisk of size %d\n",
BUFFER_SIZE);
return -ENOMEM;
}
@ -107,8 +107,8 @@ int board_usbmsc_initialize(int port)
RDFLAG_WRENABLED | RDFLAG_FUNLINK);
if (ret < 0)
{
printf("create_ramdisk: Failed to register ramdisk at %s: %d\n",
g_source, -ret);
err("ERROR: create_ramdisk: Failed to register ramdisk at %s: %d\n",
g_source, -ret);
kmm_free(pbuffer);
return ret;
}
@ -118,8 +118,8 @@ int board_usbmsc_initialize(int port)
ret = mkfatfs(g_source, &g_fmt);
if (ret < 0)
{
printf("create_ramdisk: Failed to create FAT filesystem on ramdisk at %s\n",
g_source);
err("ERROR: create_ramdisk: Failed to create FAT filesystem on ramdisk at %s\n",
g_source);
/* kmm_free(pbuffer); -- RAM disk is registered */
return ret;
}

View File

@ -6,14 +6,14 @@ index 3cc6323..ad42790 100644
* for all IO regions (Including the vector region).
*/
+lowsyslog(LOG_INFO, "Calling a1x_setupmappings\n"); // REMOVE ME
+syslog(LOG_INFO, "Calling a1x_setupmappings\n"); // REMOVE ME
a1x_setupmappings();
/* Provide a special mapping for the IRAM interrupt vector positioned in
* high memory.
*/
+lowsyslog(LOG_INFO, "Calling a1x_vectormapping\n"); // REMOVE ME
+syslog(LOG_INFO, "Calling a1x_vectormapping\n"); // REMOVE ME
a1x_vectormapping();
#endif /* CONFIG_ARCH_ROMPGTABLE */
@ -21,19 +21,19 @@ index 3cc6323..ad42790 100644
* arm_vector.S
*/
+lowsyslog(LOG_INFO, "Calling a1x_copyvectorblock\n"); // REMOVE ME
+syslog(LOG_INFO, "Calling a1x_copyvectorblock\n"); // REMOVE ME
a1x_copyvectorblock();
/* Initialize the FPU */
#ifdef CONFIG_ARCH_FPU
+lowsyslog(LOG_INFO, "Calling arm_fpuconfig\n"); // REMOVE ME
+syslog(LOG_INFO, "Calling arm_fpuconfig\n"); // REMOVE ME
arm_fpuconfig();
#endif
/* Perform common, low-level chip initialization (might do nothing) */
+lowsyslog(LOG_INFO, "Calling a1x_lowsetup\n"); // REMOVE ME
+syslog(LOG_INFO, "Calling a1x_lowsetup\n"); // REMOVE ME
a1x_lowsetup();
/* Perform early serial initialization if we are going to use the serial
@ -41,7 +41,7 @@ index 3cc6323..ad42790 100644
*/
#ifdef USE_EARLYSERIALINIT
+lowsyslog(LOG_INFO, "Calling up_earlyserialinit\n"); // REMOVE ME
+syslog(LOG_INFO, "Calling up_earlyserialinit\n"); // REMOVE ME
up_earlyserialinit();
#endif
@ -49,7 +49,7 @@ index 3cc6323..ad42790 100644
*/
#ifdef CONFIG_BUILD_PROTECTED
+lowsyslog(LOG_INFO, "Calling a1x_userspace\n"); // REMOVE ME
+syslog(LOG_INFO, "Calling a1x_userspace\n"); // REMOVE ME
a1x_userspace();
#endif
@ -57,9 +57,9 @@ index 3cc6323..ad42790 100644
* - Configuration of board specific resources (PIOs, LEDs, etc).
*/
+lowsyslog(LOG_INFO, "Calling a1x_boardinitialize\n"); // REMOVE ME
+syslog(LOG_INFO, "Calling a1x_boardinitialize\n"); // REMOVE ME
a1x_boardinitialize();
+lowsyslog(LOG_INFO, "Returning\n"); // REMOVE ME
+syslog(LOG_INFO, "Returning\n"); // REMOVE ME
}
diff --git a/nuttx/arch/arm/src/armv7-a/arm_head.S b/nuttx/arch/arm/src/armv7-a/arm_head.S
index bce82d5..924bd24 100644

View File

@ -97,31 +97,9 @@ Status
-CONFIG_RAMLOG_NPOLLWAITERS=4
I would also disable debug output from CPU0 so that I could better see the
debug output from CPU1:
debug output from CPU1. In drivers/syslog/vsyslog.c:
$ diff -u libc/syslog/lib_lowsyslog.c libc/syslog/lib_lowsyslog.c.SAVE
--- libc/syslog/lib_lowsyslog.c 2016-05-22 14:56:35.130096500 -0600
+++ libc/syslog/lib_lowsyslog.c.SAVE 2016-05-20 13:36:22.588330100 -0600
@@ -126,7 +126,0 @@
{
va_list ap;
int ret;
+if (up_cpu_index() == 0) return 17; // REMOVE ME
/* Let lowvsyslog do the work */
va_start(ap, fmt);
$ diff -u libc/syslog/lib_syslog.c libc/syslog/lib_syslog.c.SAVE
--- libc/syslog/lib_syslog.c 2016-05-22 14:56:35.156098100 -0600
+++ libc/syslog/lib_syslog.c.SAVE 2016-05-20 13:36:15.331284000 -0600
@@ -192,6 +192,7 @@
{
va_list ap;
int ret;
+if (up_cpu_index() == 0) return 17; // REMOVE ME
/* Let vsyslog do the work */
Platform Features
=================

View File

@ -318,9 +318,9 @@ void stm32_pmbuttons(void)
if (oldhandler != NULL)
{
lowsyslog(LOG_WARNING, "WARNING: oldhandler:%p is not NULL! "
"Button events may be lost or aliased!\n",
oldhandler);
warn("WARNING: oldhandler:%p is not NULL! "
"Button events may be lost or aliased!\n",
oldhandler);
}
}
#endif

View File

@ -2631,9 +2631,6 @@
<file>
<name>$PROJ_DIR$/../../../../../libc/syslog/lib_syslog.c</name>
</file>
<file>
<name>$PROJ_DIR$/../../../../../libc/syslog/lib_lowsyslog.c</name>
</file>
<file>
<name>$PROJ_DIR$/../../../../../libc/syslog/lib_setlogmask.c</name>
</file>

View File

@ -1478,16 +1478,6 @@
<FileType>1</FileType>
<FilePath>../../../../../libc/symtab/symtab_findorderedbyvalue.c</FilePath>
</File>
<File>
<FileName>lib_syslog.c</FileName>
<FileType>1</FileType>
<FilePath>../../../../../libc/syslog/lib_syslog.c</FilePath>
</File>
<File>
<FileName>lib_lowsyslog.c</FileName>
<FileType>1</FileType>
<FilePath>../../../../../libc/syslog/lib_lowsyslog.c</FilePath>
</File>
<File>
<FileName>lib_setlogmask.c</FileName>
<FileType>1</FileType>

View File

@ -617,7 +617,7 @@ Where <subdir> is one of the following:
- /dev/console still exists and still refers to the serial port. So
you can still use certain kinds of debug output (see include/debug.h, all
of the interfaces based on lowsyslog will work in this configuration).
of the debug output from interrupt handlers will be lost.
- But don't enable USB debug output! Since USB is console is used for
USB debug output and you are using a USB console, there will be

View File

@ -726,7 +726,7 @@ Where <subdir> is one of the following:
- /dev/console still exists and still refers to the serial port. So
you can still use certain kinds of debug output (see include/debug.h, all
of the interfaces based on lowsyslog will work in this configuration).
debug output from interrupt handlers will be lost.
- But don't enable USB debug output! Since USB is console is used for
USB debug output and you are using a USB console, there will be

View File

@ -1425,11 +1425,6 @@
<FileType>1</FileType>
<FilePath>../../../../../libc/syslog/lib_syslog.c</FilePath>
</File>
<File>
<FileName>lib_lowsyslog.c</FileName>
<FileType>1</FileType>
<FilePath>../../../../../libc/syslog/lib_lowsyslog.c</FilePath>
</File>
<File>
<FileName>lib_setlogmask.c</FileName>
<FileType>1</FileType>

View File

@ -1652,7 +1652,7 @@ Where <subdir> is one of the following:
- /dev/console still exists and still refers to the serial port. So
you can still use certain kinds of debug output (see include/debug.h, all
of the interfaces based on lowsyslog will work in this configuration).
of the debug output from interrupt handlers will be lost.
- But don't enable USB debug output! Since USB is console is used for
USB debug output and you are using a USB console, there will be

View File

@ -142,9 +142,9 @@ void stm32_pm_buttons(void)
if (oldhandler != NULL)
{
lowsyslog(LOG_WARNING, "WARNING: oldhandler:%p is not NULL! "
"Button events may be lost or aliased!\n",
oldhandler);
warn(LOG_WARNING, "WARNING: oldhandler:%p is not NULL! "
"Button events may be lost or aliased!\n",
oldhandler);
}
#endif
}

View File

@ -253,9 +253,9 @@ void board_button_initialize(void)
xcpt_t oldhandler = board_button_irq(i, button_handler);
if (oldhandler != NULL)
{
lowsyslog(LOG_WARNING, "WARNING: oldhandler:%p is not NULL! "
"Button events may be lost or aliased!\n",
oldhandler);
warn("WARNING: oldhandler:%p is not NULL! "
"Button events may be lost or aliased!\n",
oldhandler);
}
#endif
#endif

View File

@ -815,9 +815,9 @@ int ee25xx_initialize(FAR struct spi_dev_s *dev, FAR char *devname,
eedev->readonly = !!readonly;
lowsyslog(LOG_NOTICE,
"EEPROM device %s, %d bytes, %d per page, addrlen %d, readonly %d\n",
devname, eedev->size, eedev->pgsize, eedev->addrlen, eedev->readonly);
info(LOG_NOTICE,
"EEPROM device %s, %d bytes, %d per page, addrlen %d, readonly %d\n",
devname, eedev->size, eedev->pgsize, eedev->addrlen, eedev->readonly);
return register_driver(devname, &ee25xx_fops, 0666, eedev);
}

View File

@ -195,13 +195,13 @@
#ifdef CONFIG_ENC28J60_REGDEBUG
# define enc_wrdump(a,v) \
lowsyslog(LOG_DEBUG, "ENC28J60: %02x<-%02x\n", a, v);
syslog(LOG_DEBUG, "ENC28J60: %02x<-%02x\n", a, v);
# define enc_rddump(a,v) \
lowsyslog(LOG_DEBUG, "ENC28J60: %02x->%02x\n", a, v);
syslog(LOG_DEBUG, "ENC28J60: %02x->%02x\n", a, v);
# define enc_cmddump(c) \
lowsyslog(LOG_DEBUG, "ENC28J60: CMD: %02x\n", c);
syslog(LOG_DEBUG, "ENC28J60: CMD: %02x\n", c);
# define enc_bmdump(c,b,s) \
lowsyslog(LOG_DEBUG, "ENC28J60: CMD: %02x buffer: %p length: %d\n", c, b, s);
syslog(LOG_DEBUG, "ENC28J60: CMD: %02x buffer: %p length: %d\n", c, b, s);
#else
# define enc_wrdump(a,v)
# define enc_rddump(a,v)
@ -774,56 +774,56 @@ static int enc_waitbreg(FAR struct enc_driver_s *priv, uint8_t ctrlreg,
#if 0 /* Sometimes useful */
static void enc_rxdump(FAR struct enc_driver_s *priv)
{
lowsyslog(LOG_DEBUG, "Rx Registers:\n");
lowsyslog(LOG_DEBUG, " EIE: %02x EIR: %02x\n",
enc_rdgreg(priv, ENC_EIE), enc_rdgreg(priv, ENC_EIR));
lowsyslog(LOG_DEBUG, " ESTAT: %02x ECON1: %02x ECON2: %02x\n",
enc_rdgreg(priv, ENC_ESTAT), enc_rdgreg(priv, ENC_ECON1),
enc_rdgreg(priv, ENC_ECON2));
lowsyslog(LOG_DEBUG, " ERXST: %02x %02x\n",
enc_rdbreg(priv, ENC_ERXSTH), enc_rdbreg(priv, ENC_ERXSTL));
lowsyslog(LOG_DEBUG, " ERXND: %02x %02x\n",
enc_rdbreg(priv, ENC_ERXNDH), enc_rdbreg(priv, ENC_ERXNDL));
lowsyslog(LOG_DEBUG, " ERXRDPT: %02x %02x\n",
enc_rdbreg(priv, ENC_ERXRDPTH), enc_rdbreg(priv, ENC_ERXRDPTL));
lowsyslog(LOG_DEBUG, " ERXFCON: %02x EPKTCNT: %02x\n",
enc_rdbreg(priv, ENC_ERXFCON), enc_rdbreg(priv, ENC_EPKTCNT));
lowsyslog(LOG_DEBUG, " MACON1: %02x MACON3: %02x\n",
enc_rdbreg(priv, ENC_MACON1), enc_rdbreg(priv, ENC_MACON3));
lowsyslog(LOG_DEBUG, " MAMXFL: %02x %02x\n",
enc_rdbreg(priv, ENC_MAMXFLH), enc_rdbreg(priv, ENC_MAMXFLL));
lowsyslog(LOG_DEBUG, " MAADR: %02x:%02x:%02x:%02x:%02x:%02x\n",
enc_rdbreg(priv, ENC_MAADR1), enc_rdbreg(priv, ENC_MAADR2),
enc_rdbreg(priv, ENC_MAADR3), enc_rdbreg(priv, ENC_MAADR4),
enc_rdbreg(priv, ENC_MAADR5), enc_rdbreg(priv, ENC_MAADR6));
syslog(LOG_DEBUG, "Rx Registers:\n");
syslog(LOG_DEBUG, " EIE: %02x EIR: %02x\n",
enc_rdgreg(priv, ENC_EIE), enc_rdgreg(priv, ENC_EIR));
syslog(LOG_DEBUG, " ESTAT: %02x ECON1: %02x ECON2: %02x\n",
enc_rdgreg(priv, ENC_ESTAT), enc_rdgreg(priv, ENC_ECON1),
enc_rdgreg(priv, ENC_ECON2));
syslog(LOG_DEBUG, " ERXST: %02x %02x\n",
enc_rdbreg(priv, ENC_ERXSTH), enc_rdbreg(priv, ENC_ERXSTL));
syslog(LOG_DEBUG, " ERXND: %02x %02x\n",
enc_rdbreg(priv, ENC_ERXNDH), enc_rdbreg(priv, ENC_ERXNDL));
syslog(LOG_DEBUG, " ERXRDPT: %02x %02x\n",
enc_rdbreg(priv, ENC_ERXRDPTH), enc_rdbreg(priv, ENC_ERXRDPTL));
syslog(LOG_DEBUG, " ERXFCON: %02x EPKTCNT: %02x\n",
enc_rdbreg(priv, ENC_ERXFCON), enc_rdbreg(priv, ENC_EPKTCNT));
syslog(LOG_DEBUG, " MACON1: %02x MACON3: %02x\n",
enc_rdbreg(priv, ENC_MACON1), enc_rdbreg(priv, ENC_MACON3));
syslog(LOG_DEBUG, " MAMXFL: %02x %02x\n",
enc_rdbreg(priv, ENC_MAMXFLH), enc_rdbreg(priv, ENC_MAMXFLL));
syslog(LOG_DEBUG, " MAADR: %02x:%02x:%02x:%02x:%02x:%02x\n",
enc_rdbreg(priv, ENC_MAADR1), enc_rdbreg(priv, ENC_MAADR2),
enc_rdbreg(priv, ENC_MAADR3), enc_rdbreg(priv, ENC_MAADR4),
enc_rdbreg(priv, ENC_MAADR5), enc_rdbreg(priv, ENC_MAADR6));
}
#endif
#if 0 /* Sometimes useful */
static void enc_txdump(FAR struct enc_driver_s *priv)
{
lowsyslog(LOG_DEBUG, "Tx Registers:\n");
lowsyslog(LOG_DEBUG, " EIE: %02x EIR: %02x\n",
enc_rdgreg(priv, ENC_EIE), enc_rdgreg(priv, ENC_EIR));
lowsyslog(LOG_DEBUG, " ESTAT: %02x ECON1: %02x\n",
enc_rdgreg(priv, ENC_ESTAT), enc_rdgreg(priv, ENC_ECON1));
lowsyslog(LOG_DEBUG, " ETXST: %02x %02x\n",
enc_rdbreg(priv, ENC_ETXSTH), enc_rdbreg(priv, ENC_ETXSTL));
lowsyslog(LOG_DEBUG, " ETXND: %02x %02x\n",
enc_rdbreg(priv, ENC_ETXNDH), enc_rdbreg(priv, ENC_ETXNDL));
lowsyslog(LOG_DEBUG, " MACON1: %02x MACON3: %02x MACON4: %02x\n",
enc_rdbreg(priv, ENC_MACON1), enc_rdbreg(priv, ENC_MACON3),
enc_rdbreg(priv, ENC_MACON4));
lowsyslog(LOG_DEBUG, " MACON1: %02x MACON3: %02x MACON4: %02x\n",
enc_rdbreg(priv, ENC_MACON1), enc_rdbreg(priv, ENC_MACON3),
enc_rdbreg(priv, ENC_MACON4));
lowsyslog(LOG_DEBUG, " MABBIPG: %02x MAIPG %02x %02x\n",
enc_rdbreg(priv, ENC_MABBIPG), enc_rdbreg(priv, ENC_MAIPGH),
enc_rdbreg(priv, ENC_MAIPGL));
lowsyslog(LOG_DEBUG, " MACLCON1: %02x MACLCON2: %02x\n",
enc_rdbreg(priv, ENC_MACLCON1), enc_rdbreg(priv, ENC_MACLCON2));
lowsyslog(LOG_DEBUG, " MAMXFL: %02x %02x\n",
enc_rdbreg(priv, ENC_MAMXFLH), enc_rdbreg(priv, ENC_MAMXFLL));
syslog(LOG_DEBUG, "Tx Registers:\n");
syslog(LOG_DEBUG, " EIE: %02x EIR: %02x\n",
enc_rdgreg(priv, ENC_EIE), enc_rdgreg(priv, ENC_EIR));
syslog(LOG_DEBUG, " ESTAT: %02x ECON1: %02x\n",
enc_rdgreg(priv, ENC_ESTAT), enc_rdgreg(priv, ENC_ECON1));
syslog(LOG_DEBUG, " ETXST: %02x %02x\n",
enc_rdbreg(priv, ENC_ETXSTH), enc_rdbreg(priv, ENC_ETXSTL));
syslog(LOG_DEBUG, " ETXND: %02x %02x\n",
enc_rdbreg(priv, ENC_ETXNDH), enc_rdbreg(priv, ENC_ETXNDL));
syslog(LOG_DEBUG, " MACON1: %02x MACON3: %02x MACON4: %02x\n",
enc_rdbreg(priv, ENC_MACON1), enc_rdbreg(priv, ENC_MACON3),
enc_rdbreg(priv, ENC_MACON4));
syslog(LOG_DEBUG, " MACON1: %02x MACON3: %02x MACON4: %02x\n",
enc_rdbreg(priv, ENC_MACON1), enc_rdbreg(priv, ENC_MACON3),
enc_rdbreg(priv, ENC_MACON4));
syslog(LOG_DEBUG, " MABBIPG: %02x MAIPG %02x %02x\n",
enc_rdbreg(priv, ENC_MABBIPG), enc_rdbreg(priv, ENC_MAIPGH),
enc_rdbreg(priv, ENC_MAIPGL));
syslog(LOG_DEBUG, " MACLCON1: %02x MACLCON2: %02x\n",
enc_rdbreg(priv, ENC_MACLCON1), enc_rdbreg(priv, ENC_MACLCON2));
syslog(LOG_DEBUG, " MAMXFL: %02x %02x\n",
enc_rdbreg(priv, ENC_MAMXFLH), enc_rdbreg(priv, ENC_MAMXFLL));
}
#endif

View File

@ -187,17 +187,17 @@
#ifdef CONFIG_ENCX24J600_REGDEBUG
# define enc_wrdump(a,v) \
lowsyslog(LOG_DEBUG, "ENCX24J600: %02x<-%04x\n", a, v);
syslog(LOG_DEBUG, "ENCX24J600: %02x<-%04x\n", a, v);
# define enc_rddump(a,v) \
lowsyslog(LOG_DEBUG, "ENCX24J600: %02x->%04x\n", a, v);
syslog(LOG_DEBUG, "ENCX24J600: %02x->%04x\n", a, v);
# define enc_bfsdump(a,m) \
lowsyslog(LOG_DEBUG, "ENCX24J600: %02x|=%04x\n", a, m);
syslog(LOG_DEBUG, "ENCX24J600: %02x|=%04x\n", a, m);
# define enc_bfcdump(a,m) \
lowsyslog(LOG_DEBUG, "ENCX24J600: %02x&=~%04x\n", a, m);
syslog(LOG_DEBUG, "ENCX24J600: %02x&=~%04x\n", a, m);
# define enc_cmddump(c) \
lowsyslog(LOG_DEBUG, "ENCX24J600: CMD: %02x\n", c);
syslog(LOG_DEBUG, "ENCX24J600: CMD: %02x\n", c);
# define enc_bmdump(c,b,s) \
lowsyslog(LOG_DEBUG, "ENCX24J600: CMD: %02x buffer: %p length: %d\n", c, b, s);
syslog(LOG_DEBUG, "ENCX24J600: CMD: %02x buffer: %p length: %d\n", c, b, s);
#else
# define enc_wrdump(a,v)
# define enc_rddump(a,v)
@ -764,56 +764,56 @@ static void enc_bfc(FAR struct enc_driver_s *priv, uint16_t ctrlreg,
#if 0 /* Sometimes useful */
static void enc_rxdump(FAR struct enc_driver_s *priv)
{
lowsyslog(LOG_DEBUG, "Rx Registers:\n");
lowsyslog(LOG_DEBUG, " EIE: %02x EIR: %02x\n",
enc_rdgreg(priv, ENC_EIE), enc_rdgreg(priv, ENC_EIR));
lowsyslog(LOG_DEBUG, " ESTAT: %02x ECON1: %02x ECON2: %02x\n",
enc_rdgreg(priv, ENC_ESTAT), enc_rdgreg(priv, ENC_ECON1),
enc_rdgreg(priv, ENC_ECON2));
lowsyslog(LOG_DEBUG, " ERXST: %02x %02x\n",
enc_rdbreg(priv, ENC_ERXSTH), enc_rdbreg(priv, ENC_ERXSTL));
lowsyslog(LOG_DEBUG, " ERXND: %02x %02x\n",
enc_rdbreg(priv, ENC_ERXNDH), enc_rdbreg(priv, ENC_ERXNDL));
lowsyslog(LOG_DEBUG, " ERXRDPT: %02x %02x\n",
enc_rdbreg(priv, ENC_ERXRDPTH), enc_rdbreg(priv, ENC_ERXRDPTL));
lowsyslog(LOG_DEBUG, " ERXFCON: %02x EPKTCNT: %02x\n",
enc_rdbreg(priv, ENC_ERXFCON), enc_rdbreg(priv, ENC_EPKTCNT));
lowsyslog(LOG_DEBUG, " MACON1: %02x MACON3: %02x\n",
enc_rdbreg(priv, ENC_MACON1), enc_rdbreg(priv, ENC_MACON3));
lowsyslog(LOG_DEBUG, " MAMXFL: %02x %02x\n",
enc_rdbreg(priv, ENC_MAMXFLH), enc_rdbreg(priv, ENC_MAMXFLL));
lowsyslog(LOG_DEBUG, " MAADR: %02x:%02x:%02x:%02x:%02x:%02x\n",
enc_rdbreg(priv, ENC_MAADR1), enc_rdbreg(priv, ENC_MAADR2),
enc_rdbreg(priv, ENC_MAADR3), enc_rdbreg(priv, ENC_MAADR4),
enc_rdbreg(priv, ENC_MAADR5), enc_rdbreg(priv, ENC_MAADR6));
syslog(LOG_DEBUG, "Rx Registers:\n");
syslog(LOG_DEBUG, " EIE: %02x EIR: %02x\n",
enc_rdgreg(priv, ENC_EIE), enc_rdgreg(priv, ENC_EIR));
syslog(LOG_DEBUG, " ESTAT: %02x ECON1: %02x ECON2: %02x\n",
enc_rdgreg(priv, ENC_ESTAT), enc_rdgreg(priv, ENC_ECON1),
enc_rdgreg(priv, ENC_ECON2));
syslog(LOG_DEBUG, " ERXST: %02x %02x\n",
enc_rdbreg(priv, ENC_ERXSTH), enc_rdbreg(priv, ENC_ERXSTL));
syslog(LOG_DEBUG, " ERXND: %02x %02x\n",
enc_rdbreg(priv, ENC_ERXNDH), enc_rdbreg(priv, ENC_ERXNDL));
syslog(LOG_DEBUG, " ERXRDPT: %02x %02x\n",
enc_rdbreg(priv, ENC_ERXRDPTH), enc_rdbreg(priv, ENC_ERXRDPTL));
syslog(LOG_DEBUG, " ERXFCON: %02x EPKTCNT: %02x\n",
enc_rdbreg(priv, ENC_ERXFCON), enc_rdbreg(priv, ENC_EPKTCNT));
syslog(LOG_DEBUG, " MACON1: %02x MACON3: %02x\n",
enc_rdbreg(priv, ENC_MACON1), enc_rdbreg(priv, ENC_MACON3));
syslog(LOG_DEBUG, " MAMXFL: %02x %02x\n",
enc_rdbreg(priv, ENC_MAMXFLH), enc_rdbreg(priv, ENC_MAMXFLL));
syslog(LOG_DEBUG, " MAADR: %02x:%02x:%02x:%02x:%02x:%02x\n",
enc_rdbreg(priv, ENC_MAADR1), enc_rdbreg(priv, ENC_MAADR2),
enc_rdbreg(priv, ENC_MAADR3), enc_rdbreg(priv, ENC_MAADR4),
enc_rdbreg(priv, ENC_MAADR5), enc_rdbreg(priv, ENC_MAADR6));
}
#endif
#if 0 /* Sometimes useful */
static void enc_txdump(FAR struct enc_driver_s *priv)
{
lowsyslog(LOG_DEBUG, "Tx Registers:\n");
lowsyslog(LOG_DEBUG, " EIE: %02x EIR: %02x\n",
enc_rdgreg(priv, ENC_EIE), enc_rdgreg(priv, ENC_EIR));
lowsyslog(LOG_DEBUG, " ESTAT: %02x ECON1: %02x\n",
enc_rdgreg(priv, ENC_ESTAT), enc_rdgreg(priv, ENC_ECON1));
lowsyslog(LOG_DEBUG, " ETXST: %02x %02x\n",
enc_rdbreg(priv, ENC_ETXSTH), enc_rdbreg(priv, ENC_ETXSTL));
lowsyslog(LOG_DEBUG, " ETXND: %02x %02x\n",
enc_rdbreg(priv, ENC_ETXNDH), enc_rdbreg(priv, ENC_ETXNDL));
lowsyslog(LOG_DEBUG, " MACON1: %02x MACON3: %02x MACON4: %02x\n",
enc_rdbreg(priv, ENC_MACON1), enc_rdbreg(priv, ENC_MACON3),
enc_rdbreg(priv, ENC_MACON4));
lowsyslog(LOG_DEBUG, " MACON1: %02x MACON3: %02x MACON4: %02x\n",
enc_rdbreg(priv, ENC_MACON1), enc_rdbreg(priv, ENC_MACON3),
enc_rdbreg(priv, ENC_MACON4));
lowsyslog(LOG_DEBUG, " MABBIPG: %02x MAIPG %02x %02x\n",
enc_rdbreg(priv, ENC_MABBIPG), enc_rdbreg(priv, ENC_MAIPGH),
enc_rdbreg(priv, ENC_MAIPGL));
lowsyslog(LOG_DEBUG, " MACLCON1: %02x MACLCON2: %02x\n",
enc_rdbreg(priv, ENC_MACLCON1), enc_rdbreg(priv, ENC_MACLCON2));
lowsyslog(LOG_DEBUG, " MAMXFL: %02x %02x\n",
enc_rdbreg(priv, ENC_MAMXFLH), enc_rdbreg(priv, ENC_MAMXFLL));
syslog(LOG_DEBUG, "Tx Registers:\n");
syslog(LOG_DEBUG, " EIE: %02x EIR: %02x\n",
enc_rdgreg(priv, ENC_EIE), enc_rdgreg(priv, ENC_EIR));
syslog(LOG_DEBUG, " ESTAT: %02x ECON1: %02x\n",
enc_rdgreg(priv, ENC_ESTAT), enc_rdgreg(priv, ENC_ECON1));
syslog(LOG_DEBUG, " ETXST: %02x %02x\n",
enc_rdbreg(priv, ENC_ETXSTH), enc_rdbreg(priv, ENC_ETXSTL));
syslog(LOG_DEBUG, " ETXND: %02x %02x\n",
enc_rdbreg(priv, ENC_ETXNDH), enc_rdbreg(priv, ENC_ETXNDL));
syslog(LOG_DEBUG, " MACON1: %02x MACON3: %02x MACON4: %02x\n",
enc_rdbreg(priv, ENC_MACON1), enc_rdbreg(priv, ENC_MACON3),
enc_rdbreg(priv, ENC_MACON4));
syslog(LOG_DEBUG, " MACON1: %02x MACON3: %02x MACON4: %02x\n",
enc_rdbreg(priv, ENC_MACON1), enc_rdbreg(priv, ENC_MACON3),
enc_rdbreg(priv, ENC_MACON4));
syslog(LOG_DEBUG, " MABBIPG: %02x MAIPG %02x %02x\n",
enc_rdbreg(priv, ENC_MABBIPG), enc_rdbreg(priv, ENC_MAIPGH),
enc_rdbreg(priv, ENC_MAIPGL));
syslog(LOG_DEBUG, " MACLCON1: %02x MACLCON2: %02x\n",
enc_rdbreg(priv, ENC_MACLCON1), enc_rdbreg(priv, ENC_MACLCON2));
syslog(LOG_DEBUG, " MAMXFL: %02x %02x\n",
enc_rdbreg(priv, ENC_MAMXFLH), enc_rdbreg(priv, ENC_MAMXFLL));
}
#endif

View File

@ -37,7 +37,7 @@
############################################################################
# Include SYSLOG Infrastructure
CSRCS += vsyslog.c vlowsyslog.c syslog_stream.c syslog_channel.c
CSRCS += vsyslog.c syslog_stream.c syslog_channel.c
ifeq ($(CONFIG_SYSLOG_INTBUFFER),y)
CSRCS += syslog_intbuffer.c

View File

@ -765,12 +765,7 @@ int ramlog_syslog_channel(void)
* Name: ramlog_putc
*
* Description:
* This is the low-level system logging interface. The debugging/syslogging
* interfaces are syslog() and lowsyslog(). The difference is that
* the syslog() internface writes to syslog device (usually fd=1, stdout)
* whereas lowsyslog() uses a lower level interface that works from
* interrupt handlers. This function is a a low-level interface used to
* implement lowsyslog() when CONFIG_RAMLOG_SYSLOG=y.
* This is the low-level system logging interface.
*
****************************************************************************/

View File

@ -1,81 +0,0 @@
/****************************************************************************
* drivers/syslog/vlowsyslog.c
*
* Copyright (C) 2007-2009, 2011-2012, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdio.h>
#include <syslog.h>
#include <nuttx/streams.h>
#include <nuttx/syslog/syslog.h>
#ifdef CONFIG_ARCH_LOWPUTC
/* The low-level SYSLOG functions can be used only if we have access to
* either the low-level serial interface, up_putc(), and to syslog_putc()
*/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: _lowvsyslog
*
* Description:
* _lowvsyslog() handles the system logging system calls. It is functionally
* equivalent to vlowsyslog() except that the pre-process priority filtering
* has already been performed and, hence, there is no priority argument.
*
* NOTE: The va_list parameter is passed by reference. That is because
* the va_list is a structure in some compilers and passing of structures
* in the NuttX sycalls does not work.
*
****************************************************************************/
int _lowvsyslog(FAR const IPTR char *fmt, FAR va_list *ap)
{
struct lib_outstream_s stream;
/* Wrap the stdout in a stream object and let lib_vsprintf do the work. */
syslogstream((FAR struct lib_outstream_s *)&stream);
return lib_vsprintf((FAR struct lib_outstream_s *)&stream, fmt, *ap);
}
#endif /* CONFIG_ARCH_LOWPUTC */

View File

@ -57,7 +57,7 @@
*
* Description:
* _vsyslog() handles the system logging system calls. It is functionally
* equivalent to vsyslog() except that the pre-process priority filtering
* equivalent to vsyslog() except that the per-process priority filtering
* has already been performed and, hence, there is no priority argument.
*
* NOTE: The va_list parameter is passed by reference. That is because

View File

@ -190,7 +190,7 @@ void usbtrace(uint16_t event, uint16_t value)
}
}
#else
/* Just print the data using lowsyslog */
/* Just print the data using syslog */
usbtrace_trprintf(usbtrace_syslog, event, value);
#endif

View File

@ -200,13 +200,13 @@ static void usbmsc_dumpdata(const char *msg, const uint8_t *buf, int buflen)
{
int i;
lowsyslog(LOG_DEBUG, "%s:", msg);
syslog(LOG_DEBUG, "%s:", msg);
for (i = 0; i < buflen; i++)
{
lowsyslog(LOG_DEBUG, " %02x", buf[i]);
syslog(LOG_DEBUG, " %02x", buf[i]);
}
lowsyslog(LOG_DEBUG, "\n");
syslog(LOG_DEBUG, "\n");
}
#endif

View File

@ -676,7 +676,7 @@ static void * cc3000_worker(FAR void *arg)
if (data_to_recv >= priv->rx_buffer_max_len)
{
lowsyslog(LOG_INFO, "data_to_recv %d", data_to_recv);
ninfo("data_to_recv %d", data_to_recv);
}
DEBUGASSERT(data_to_recv < priv->rx_buffer_max_len);

View File

@ -133,16 +133,9 @@
#ifndef __arch_syslog
# define __arch_syslog syslog
#endif
#ifndef __arch_lowsyslog
# define __arch_lowsyslog lowsyslog
#endif
#ifdef CONFIG_ARCH_LOWPUTC
# define _alert(format, ...) \
__arch_lowsyslog(LOG_EMERG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
# else
# define _alert(x...)
# endif
#define _alert(format, ...) \
__arch_syslog(LOG_EMERG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
#ifdef CONFIG_DEBUG_ERROR
# define _err(format, ...) \
@ -150,7 +143,7 @@
# ifdef CONFIG_ARCH_LOWPUTC
# define _llerr(format, ...) \
__arch_lowsyslog(LOG_ERR, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
__arch_syslog(LOG_ERR, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
# else
# define _llerr(x...)
# endif
@ -165,7 +158,7 @@
# ifdef CONFIG_ARCH_LOWPUTC
# define _llwarn(format, ...) \
__arch_lowsyslog(LOG_WARNING, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
__arch_syslog(LOG_WARNING, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
# else
# define _llwarn(x...)
# endif
@ -180,7 +173,7 @@
# ifdef CONFIG_ARCH_LOWPUTC
# define _llinfo(format, ...) \
__arch_lowsyslog(LOG_INFO, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
__arch_syslog(LOG_INFO, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
# else
# define _llinfo(x...)
# endif

View File

@ -182,12 +182,7 @@ int ramlog_syslog_channel(void);
* Name: ramlog_putc
*
* Description:
* This is the low-level system logging interface. The debugging/syslogging
* interfaces are syslog() and lowsyslog(). The difference is that
* the syslog() internface writes to syslog device (usually fd=1, stdout)
* whereas lowsyslog() uses a lower level interface that works from
* interrupt handlers. This function is a a low-level interface used to
* implement lowsyslog() when CONFIG_RAMLOG_SYSLOG=y.
* This is the low-level system logging interface.
*
****************************************************************************/

View File

@ -215,11 +215,11 @@ int syslog_flush(void);
#endif
/****************************************************************************
* Name: _vsyslog and _lowvsyslog
* Name: _vsyslog
*
* Description:
* _vsyslog() handles the system logging system calls. It is functionally
* equivalent to vsyslog() except that the pre-process priority filtering
* equivalent to vsyslog() except that the per-process priority filtering
* has already been performed and, hence, there is no priority argument.
*
* NOTE: The va_list parameter is passed by reference. That is because
@ -229,7 +229,6 @@ int syslog_flush(void);
****************************************************************************/
int _vsyslog(FAR const IPTR char *src, FAR va_list *ap);
int _lowvsyslog(FAR const IPTR char *src, FAR va_list *ap);
#undef EXTERN
#ifdef __cplusplus

View File

@ -163,48 +163,6 @@ void closelog(void);
int syslog(int priority, FAR const IPTR char *format, ...);
int vsyslog(int priority, FAR const IPTR char *src, va_list ap);
/****************************************************************************
* Name: lowsyslog and lowvsyslog
*
* Description:
* syslog() generates a log message. The priority argument is formed by
* ORing the facility and the level values (see include/syslog.h). The
* remaining arguments are a format, as in printf and any arguments to the
* format.
*
* This is a non-standard, low-level system logging interface. The
* difference between syslog() and lowsyslog() is that the syslog()
* interface writes to the syslog device (usually fd=1, stdout) whereas
* lowsyslog() uses a lower level interface that works even from interrupt
* handlers.
*
* If the platform cannot support lowsyslog, then we will substitute the
* standard syslogging functions. These will, however, probably cause
* problems if called from interrupt handlers, depending upon the nature of
* the underlying syslog device.
*
* The function lowvsyslog() performs the same task as lowsyslog() with
* the difference that it takes a set of arguments which have been
* obtained using the stdarg variable argument list macros.
*
****************************************************************************/
#ifdef CONFIG_ARCH_LOWPUTC
int lowsyslog(int priority, FAR const IPTR char *format, ...);
int lowvsyslog(int priority, FAR const IPTR char *format, va_list ap);
#else
# ifdef CONFIG_CPP_HAVE_VARARGS
# define lowsyslog(p,f,...) syslog(p,f,##__VA_ARGS__)
# else
# define lowsyslog (void)
# endif
# define lowvsyslog(p,f,a) vsyslog(p,f,a)
#endif
/****************************************************************************
* Name: setlogmask
*

View File

@ -67,8 +67,6 @@
"_llerr","debug.h","!defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_ERROR) && defined(CONFIG_ARCH_LOWPUTC)","int","const char *","..."
"_llinfo","debug.h","!defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_INFO) && defined(CONFIG_ARCH_LOWPUTC)","int","const char *","..."
"_llwarn","debug.h","!defined(CONFIG_CPP_HAVE_VARARGS) && defined(CONFIG_DEBUG_WARN) && defined(CONFIG_ARCH_LOWPUTC)","int","const char *","..."
"lowsyslog","syslog.h","","int","int","FAR const char *","..."
"lowvsyslog","syslog.h","","int","int","FAR const char *","va_list"
"match","nuttx/regex.h","","int","const char *","const char *"
"memccpy","string.h","","FAR void","FAR void *","FAR const void *","int c","size_t"
"memchr","string.h","","FAR void","FAR const void *","int c","size_t"

Can't render this file because it has a wrong number of fields in line 2.

View File

@ -66,52 +66,52 @@ void lib_dumpbuffer(FAR const char *msg, FAR const uint8_t *buffer,
unsigned int j;
unsigned int k;
lowsyslog(LOG_INFO, "%s (%p):\n", msg, buffer);
syslog(LOG_INFO, "%s (%p):\n", msg, buffer);
for (i = 0; i < buflen; i += 32)
{
lowsyslog(LOG_INFO, "%04x: ", i);
syslog(LOG_INFO, "%04x: ", i);
for (j = 0; j < 32; j++)
{
k = i + j;
if (j == 16)
{
lowsyslog(LOG_INFO, " ");
syslog(LOG_INFO, " ");
}
if (k < buflen)
{
lowsyslog(LOG_INFO, "%02x", buffer[k]);
syslog(LOG_INFO, "%02x", buffer[k]);
}
else
{
lowsyslog(LOG_INFO, " ");
syslog(LOG_INFO, " ");
}
}
lowsyslog(LOG_INFO, " ");
syslog(LOG_INFO, " ");
for (j = 0; j < 32; j++)
{
k = i + j;
if (j == 16)
{
lowsyslog(LOG_INFO, " ");
syslog(LOG_INFO, " ");
}
if (k < buflen)
{
if (buffer[k] >= 0x20 && buffer[k] < 0x7f)
{
lowsyslog(LOG_INFO, "%c", buffer[k]);
syslog(LOG_INFO, "%c", buffer[k]);
}
else
{
lowsyslog(LOG_INFO, ".");
syslog(LOG_INFO, ".");
}
}
}
lowsyslog(LOG_INFO, "\n");
syslog(LOG_INFO, "\n");
}
}

View File

@ -35,7 +35,7 @@
# Add the internal C files to the build
CSRCS += lib_syslog.c lib_lowsyslog.c lib_setlogmask.c
CSRCS += lib_syslog.c lib_setlogmask.c
# Add the syslog directory to the build

View File

@ -1,126 +0,0 @@
/****************************************************************************
* lib/syslog/lib_lowsyslog.c
*
* Copyright (C) 2007-2009, 2011-2012, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <syslog.h>
#include <nuttx/syslog/syslog.h>
#include "syslog/syslog.h"
#ifdef CONFIG_ARCH_LOWPUTC
/* The low-level SYSLOG functions can be used only if we have access to
* either the low-level serial interface, up_putc().
*/
#if defined(CONFIG_BUILD_FLAT) || defined (__KERNEL__)
/* The low-level serial interface, up_putc(), is only available in the FLAT
* build or during the kernel pass of the protected or kernel two pass
* builds.
*/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: lowvsyslog
*
* Description:
* The function lowvsyslog() performs the same task as lowsyslog() with
* the difference that it takes a set of arguments which have been
* obtained using the stdarg variable argument list macros.
*
****************************************************************************/
int lowvsyslog(int priority, FAR const IPTR char *fmt, va_list ap)
{
int ret = 0;
/* Check if this priority is enabled */
if ((g_syslog_mask & LOG_MASK(priority)) != 0)
{
/* Perform the _lowvsyslog system call.
*
* NOTE: The va_list parameter is passed by reference. That is
* because the va_list is a structure in some compilers and passing
* of structures in the NuttX sycalls does not work.
*/
ret = _lowvsyslog(fmt, &ap);
}
return ret;
}
/****************************************************************************
* Name: lowsyslog
*
* Description:
* syslog() generates a log message. The priority argument is formed by
* ORing the facility and the level values (see include/syslog.h). The
* remaining arguments are a format, as in printf and any arguments to the
* format.
*
* This is a non-standard, low-level system logging interface. The
* difference between syslog() and lowsyslog() is that the syslog()
* interface writes to the syslog device (usually fd=1, stdout) whereas
* lowsyslog() uses a lower level interface that works even from interrupt
* handlers.
*
****************************************************************************/
int lowsyslog(int priority, FAR const IPTR char *fmt, ...)
{
va_list ap;
int ret;
/* Let lowvsyslog do the work */
va_start(ap, fmt);
ret = lowvsyslog(priority, fmt, ap);
va_end(ap);
return ret;
}
#endif /* CONFIG_BUILD_FLAT) || __KERNEL__ */
#endif /* CONFIG_ARCH_LOWPUTC */

View File

@ -77,7 +77,7 @@ void iob_dump(FAR const char *msg, FAR struct iob_s *iob, unsigned int len,
unsigned int cndx;
head = iob;
lowsyslog(LOG_DEBUG, "%s: iob=%p pktlen=%d\n", msg, head, head->io_pktlen);
syslog(LOG_DEBUG, "%s: iob=%p pktlen=%d\n", msg, head, head->io_pktlen);
/* Check if the offset is beyond the data in the I/O buffer chain */
@ -92,8 +92,8 @@ void iob_dump(FAR const char *msg, FAR struct iob_s *iob, unsigned int len,
for (; iob; iob = iob->io_flink)
{
lowsyslog(LOG_DEBUG, " iob=%p len=%d offset=%d\n",
iob, iob->io_len, iob->io_offset);
syslog(LOG_DEBUG, " iob=%p len=%d offset=%d\n",
iob, iob->io_len, iob->io_offset);
}
/* Get the amount of data to be displayed, limited by the amount that we
@ -117,47 +117,47 @@ void iob_dump(FAR const char *msg, FAR struct iob_s *iob, unsigned int len,
if (nbytes > 0)
{
lowsyslog(LOG_DEBUG, " %04x: ", offset);
syslog(LOG_DEBUG, " %04x: ", offset);
for (cndx = 0; cndx < 32; cndx++)
{
if (cndx == 16)
{
lowsyslog(LOG_DEBUG, " ");
syslog(LOG_DEBUG, " ");
}
if ((lndx + cndx) < len)
{
lowsyslog(LOG_DEBUG, "%02x", data[cndx]);
syslog(LOG_DEBUG, "%02x", data[cndx]);
}
else
{
lowsyslog(LOG_DEBUG, " ");
syslog(LOG_DEBUG, " ");
}
}
lowsyslog(LOG_DEBUG, " ");
syslog(LOG_DEBUG, " ");
for (cndx = 0; cndx < 32; cndx++)
{
if (cndx == 16)
{
lowsyslog(LOG_DEBUG, " ");
syslog(LOG_DEBUG, " ");
}
if ((lndx + cndx) < len)
{
if (data[cndx] >= 0x20 && data[cndx] < 0x7f)
{
lowsyslog(LOG_DEBUG, "%c", data[cndx]);
syslog(LOG_DEBUG, "%c", data[cndx]);
}
else
{
lowsyslog(LOG_DEBUG, ".");
syslog(LOG_DEBUG, ".");
}
}
}
lowsyslog(LOG_DEBUG, "\n");
syslog(LOG_DEBUG, "\n");
}
}
}

View File

@ -63,8 +63,8 @@
void tcp_wrbuffer_dump(FAR const char *msg, FAR struct tcp_wrbuffer_s *wrb,
unsigned int len, unsigned int offset)
{
lowsyslog(LOG_DEBUG, "%s: wrb=%p segno=%d sent=%d nrtx=%d\n",
msg, wrb, WRB_SEQNO(wrb), WRB_SENT(wrb), WRB_NRTX(wrb));
syslog(LOG_DEBUG, "%s: wrb=%p segno=%d sent=%d nrtx=%d\n",
msg, wrb, WRB_SEQNO(wrb), WRB_SENT(wrb), WRB_NRTX(wrb));
iob_dump("I/O Buffer Chain", WRB_IOB(wrb), len, offset);
}