diff --git a/ChangeLog.txt b/ChangeLog.txt index 9d58a7edb..86b6c9941 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -288,7 +288,7 @@ * apps/examples/ostest/prioinherit.c: Limit the number of test threads to no more than 3 of each priority. Bad things happen when the existing logic tried to created several hundred test - treads! + threads! * apps/nshlib/nsh.h: Both CONFIG_LIBC_STRERROR and CONFIG_NSH_STRERROR must be defined to use strerror() with NSH. * apps/examples/*/*_main.c, system/i2c/i2c_main.c, and others: Added @@ -3623,7 +3623,7 @@ PASSED for Back to Back test. From Johannes (2019-02-15). * configs/system/embedlog: Update to version 0.4.0. From Michal Lyszczek (2019-02-15). - * app/examples/embedlog: This example program presents most usefull + * app/examples/embedlog: This example program presents most useful features of embedlog library and how to use them. From Michal Lyszczek (2019-02-15). * system/nxplayer and nxrecorder: Change 'int prio' to 'unsigned int prio'. diff --git a/examples/embedlog/embedlog_main.c b/examples/embedlog/embedlog_main.c index 1cca649da..1efda61fa 100644 --- a/examples/embedlog/embedlog_main.c +++ b/examples/embedlog/embedlog_main.c @@ -131,7 +131,7 @@ static void el_print_options(void) el_ooption(&g_el, EL_TS_FRACT, EL_TS_FRACT_NS); el_ooption(&g_el, EL_FINFO, 1); - el_oprint(OELF, "log location is very usefull for debuging"); + el_oprint(OELF, "log location is very useful for debugging"); el_ooption(&g_el, EL_TS, EL_TS_LONG); el_ooption(&g_el, EL_TS_TM, EL_TS_TM_REALTIME); @@ -196,10 +196,12 @@ static void el_print_memory(void) el_oprint(OELI, "print whole ASCII table"); el_opmemory(OELI, ascii, sizeof(ascii)); - el_oprint(OELI, "print memory region that contains string with NULL chars"); + el_oprint(OELI, "print memory region that contains string with NULL " + "chars"); el_opmemory(OELI, s, sizeof(s)); - el_oprint(OELI, "print the same region but this time with nice ascii table"); + el_oprint(OELI, "print the same region but this time with nice ascii " + "table"); el_opmemory_table(OELI, s, sizeof(s)); } @@ -286,9 +288,9 @@ static void el_print_file(const char *workdir) * any other error it actually a warning, telling user that file * could not have been opened now, but every el_print function with * output to file enabled, will try to reopen file. This of course - * apply to situation when problem is temporary - like directory does - * not exist but will be created after warning, or file has no write - * permission but it gets fixed later. + * apply to situation when problem is temporary - like directory + * does not exist but will be created after warning, or file has + * no write permission but it gets fixed later. */ fprintf(stderr, "log file name too long"); diff --git a/nshlib/Kconfig b/nshlib/Kconfig index 665051bae..601a416f9 100644 --- a/nshlib/Kconfig +++ b/nshlib/Kconfig @@ -283,6 +283,12 @@ config NSH_DISABLE_DIRNAME default y if DEFAULT_SMALL || NSH_DISABLESCRIPT default n if !DEFAULT_SMALL && !NSH_DISABLESCRIPT +config NSH_DISABLE_DMESG + bool "Disable dmesg" + default y if DEFAULT_SMALL + default n if !DEFAULT_SMALL + depends on RAMLOG_SYSLOG + config NSH_DISABLE_ECHO bool "Disable echo" default n diff --git a/nshlib/nsh_proccmds.c b/nshlib/nsh_proccmds.c index 471631431..d79a4ade0 100644 --- a/nshlib/nsh_proccmds.c +++ b/nshlib/nsh_proccmds.c @@ -1,7 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_proccmds.c * - * Copyright (C) 2007-2009, 2011-2012, 2014-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011-2012, 2014-2015, 2019 Gregory Nutt. All + * rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -157,26 +158,29 @@ static void nsh_parse_statusline(FAR char *line, * * 111111111122222222223 * 123456789012345678901234567890 - * Name: xxxx... Task/thread name (See CONFIG_TASK_NAME_SIZE) + * Name: xxxx... Task/thread name + * (See CONFIG_TASK_NAME_SIZE) * Type: xxxxxxx {Task, pthread, Kthread, Invalid} * Type: xxxxxxx {Task, pthread, Kthread, Invalid} * PPID: xxxxx Parent thread ID - * State: xxxxxxxx,xxxxxxxxx {Invalid, Waiting, Ready, Running, Inactive}, - * {Unlock, Semaphore, Signal, MQ empty, MQ full} + * State: xxxxxxxx,xxxxxxxxx {Invalid, Waiting, Ready, Running, + * Inactive}, {Unlock, Semaphore, Signal, + * MQ empty, MQ full} * Flags: xxx N,P,X * Priority: nnn Decimal, 0-255 - * Scheduler: xxxxxxxxxxxxxx {SCHED_FIFO, SCHED_RR, SCHED_SPORADIC, SCHED_OTHER} + * Scheduler: xxxxxxxxxxxxxx {SCHED_FIFO, SCHED_RR, SCHED_SPORADIC, + * SCHED_OTHER} * Sigmask: nnnnnnnn Hexadecimal, 32-bit */ #if 0 /* Not used */ - /* Task name */ + /* Task name */ - if (strncmp(line, g_name, strlen(g_name)) == 0) - { - /* Not used */ - } - else + if (strncmp(line, g_name, strlen(g_name)) == 0) + { + /* Not used */ + } + else #endif /* Task/thread type */ @@ -251,9 +255,9 @@ static void nsh_parse_statusline(FAR char *line, } else if (strncmp(line, g_scheduler, strlen(g_scheduler)) == 0) { - /* Skip over the SCHED_ part of the policy. Resultis max 8 bytes */ + /* Skip over the SCHED_ part of the policy. Result is max 8 bytes. */ - status->td_policy = nsh_trimspaces(&line[12+6]); + status->td_policy = nsh_trimspaces(&line[12 + 6]); } else if (strncmp(line, g_sigmask, strlen(g_sigmask)) == 0) { @@ -348,7 +352,7 @@ static int ps_callback(FAR struct nsh_vtbl_s *vtbl, FAR const char *dirpath, nextline = vtbl->iobuffer; do { - /* Find the beginning of the next line and NUL-terminat the + /* Find the beginning of the next line and NUL-terminate the * current line. */ @@ -510,7 +514,7 @@ static int ps_callback(FAR struct nsh_vtbl_s *vtbl, FAR const char *dirpath, nsh_output(vtbl, "%6s ", nsh_trimspaces(vtbl->iobuffer)); #endif - /* Read the task/tread command line */ + /* Read the task/thread command line */ filepath = NULL; ret = asprintf(&filepath, "%s/%s/cmdline", dirpath, entryp->d_name); @@ -551,8 +555,8 @@ int cmd_exec(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) addr = (uintptr_t)strtol(argv[1], &endptr, 0); if (!addr || endptr == argv[1] || *endptr != '\0') { - nsh_error(vtbl, g_fmtarginvalid, argv[0]); - return ERROR; + nsh_error(vtbl, g_fmtarginvalid, argv[0]); + return ERROR; } nsh_output(vtbl, "Calling %p\n", (exec_t)addr); @@ -635,7 +639,7 @@ int cmd_kill(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) goto invalid_arg; } - /* Extract athe pid */ + /* Extract the pid */ pid = strtol(ptr, &endptr, 0); @@ -688,8 +692,8 @@ int cmd_sleep(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) secs = strtol(argv[1], &endptr, 0); if (!secs || endptr == argv[1] || *endptr != '\0') { - nsh_error(vtbl, g_fmtarginvalid, argv[0]); - return ERROR; + nsh_error(vtbl, g_fmtarginvalid, argv[0]); + return ERROR; } sleep(secs); @@ -710,8 +714,8 @@ int cmd_usleep(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) usecs = strtol(argv[1], &endptr, 0); if (!usecs || endptr == argv[1] || *endptr != '\0') { - nsh_error(vtbl, g_fmtarginvalid, argv[0]); - return ERROR; + nsh_error(vtbl, g_fmtarginvalid, argv[0]); + return ERROR; } usleep(usecs); diff --git a/system/embedlog/Kconfig b/system/embedlog/Kconfig index e720b5d0c..12f5ce23c 100644 --- a/system/embedlog/Kconfig +++ b/system/embedlog/Kconfig @@ -58,7 +58,7 @@ config EMBEDLOG_ENABLE_OUT_TTY default y ---help--- If enabled, you will be able to configure logger to print directly - to tty serial device (like /dev/ttyS1). This might be usefull if you + to tty serial device (like /dev/ttyS1). This might be useful if you want to have nsh in one tty and logs on the other. This is suitable if only one task will be printing logs to one tty, if you want multiple tasks to print into one tty, it's better to enable syslog