Commit Graph

167 Commits

Author SHA1 Message Date
Gregory Nutt
3a4984a40b Rename file_close_detached() to juse file_close() for better consistency in naming. 2018-09-15 13:04:56 -06:00
Gregory Nutt
a7fd58c4db Squashed commit of the following:
many locations:  Change occurences of open() followed by file_detach() to file_open().  Change most non-controversion calls to open() to nx_open().

    fs/inode/fs_fileopen.c:  Flesh out file_open() with some interim, placeholder logic.

    fs/inode/fs_fileopen.c:  Add a framework for a file_open() implementation (no real logic in place yet).

    fs/vfs/fs_open.c:  Add nx_open() which is the same as open() except that it does not create a cancellation point nor does it modify the errno variable.
2018-09-15 10:49:41 -06:00
Xiang Xiao
1ee6083de3 Squashed commit of the following:
drivers/syslog:  Channel configuration.  Decouple SYSLOG_SERIAL_CONSOLE and ARCH_LOWPUTC.  Since some hardware can output log to the special debug channel not serial.

    drivers/syslog/vsyslog.c: Support pre-pending a prefix string to log output if enabled.  This very useful to identify which cpu send out the log in AMP SoC.

    drivers/syslog/vsyslog.c: Make timestamp output same as linux kernel.  It's very useful if NuttX syslog retarget to Linux syslog.
2018-08-26 06:49:35 -06:00
Alan Carvalho de Assis
283b73edc5 Fix lots of typos in C comments and Kconfig help text 2018-07-08 18:24:45 -06:00
Gregory Nutt
a94e3284b3 syslog: Enable is partial, crippled version of syslog_flush(); arch/: Call syslog_flush() from assertion handling logic. 2018-06-07 16:29:16 -06:00
Michał Łyszczek
8de51543a4 Fix a few compilation errors. 2018-04-20 15:55:16 -06:00
Gregory Nutt
de6b13b3ab Per OpenGroup.org, syslog -- and, hence, nonstandard vsyslog, and debug wrappers -- does not return a value. Rename _vsyslog to nx_vsyslog. Use internal nx_vsyslog in the few cases where a return value is required. 2018-03-04 08:07:07 -06:00
Gregory Nutt
7cf88d7dbd Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
Gregory Nutt
30f2927101 binfmt/, drivers/, graphics/: Fix several inappropriate accesses to get_errno() that were missed in previous changes (some going back to nuttx-.23). 2018-01-30 17:23:10 -06:00
Gregory Nutt
9568600ab1 Squashed commit of the following:
This commit backs out most of commit b4747286b1.  That change was added because sem_wait() would sometimes cause cancellation points inappropriated.  But with these recent changes, nxsem_wait() is used instead and it is not a cancellation point.

    In the OS, all calls to sem_wait() changed to nxsem_wait().  nxsem_wait() does not return errors via errno so each place where nxsem_wait() is now called must not examine the errno variable.

    In all OS functions (not libraries), change sem_wait() to nxsem_wait().  This will prevent the OS from creating bogus cancellation points and from modifying the per-task errno variable.

    sched/semaphore:  Add the function nxsem_wait().  This is a new internal OS interface.  It is functionally equivalent to sem_wait() except that (1) it is not a cancellation point, and (2) it does not set the per-thread errno value on return.
2017-10-04 15:22:27 -06:00
Gregory Nutt
42a0796615 Squashed commit of the following:
sched/semaphore:  Add nxsem_post() which is identical to sem_post() except that it never modifies the errno variable.  Changed all references to sem_post in the OS to nxsem_post().

    sched/semaphore:  Add nxsem_destroy() which is identical to sem_destroy() except that it never modifies the errno variable.  Changed all references to sem_destroy() in the OS to nxsem_destroy().

    libc/semaphore and sched/semaphore:  Add nxsem_getprotocol() and nxsem_setprotocola which are identical to sem_getprotocol() and set_setprotocol() except that they never modifies the errno variable.  Changed all references to sem_setprotocol in the OS to nxsem_setprotocol().  sem_getprotocol() was not used in the OS
2017-10-03 15:35:24 -06:00
Gregory Nutt
83cdb0c552 Squashed commit of the following:
libc/semaphore:  Add nxsem_getvalue() which is identical to sem_getvalue() except that it never modifies the errno variable.  Changed all references to sem_getvalue in the OS to nxsem_getvalue().

    sched/semaphore:  Rename all internal private functions from sem_xyz to nxsem_xyz.  The sem_ prefix is (will be) reserved only for the application semaphore interfaces.

    libc/semaphore:  Add nxsem_init() which is identical to sem_init() except that it never modifies the errno variable.  Changed all references to sem_init in the OS to nxsem_init().

    sched/semaphore:  Rename sem_tickwait() to nxsem_tickwait() so that it is clear this is an internal OS function.

    sched/semaphoate:  Rename sem_reset() to nxsem_reset() so that it is clear this is an internal OS function.
2017-10-03 12:52:31 -06:00
Mateusz Szafoni
ad369a0bad Merged in raiden00/nuttx (pull request #499)
syslog_console.c: fix typo

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-09-30 12:24:37 +00:00
raiden00pl
525a180ab5 syslog_console.c: fix typo 2017-09-30 13:34:15 +02:00
Gregory Nutt
8a75add6a0 drivers/syslog: syslog internal functions should not set the errno variable: ramlog_putc(), syslog_dev_putc(), syslog_dev_write(), syslog_force(). 2017-09-29 15:24:40 -06:00
Jussi Kivilinna
9fc5f44ef6 syslog: CONFIG_CLOCK_MONOTONIC 2017-08-04 08:02:52 -06:00
Gregory Nutt
95e20afcd2 drivers/: Remove dangling space at the end of lines. 2017-06-28 13:17:17 -06:00
Gregory Nutt
5ce2ece134 syslog: Add header file inclusion to eliminate a warning; mm/iob: private function needs static storage class. 2017-05-16 12:26:23 -06:00
Jussi Kivilinna
a6e556d31c I had to make following change to fix interrupt context syslog (INTBUFFER untested) 2017-05-16 10:56:49 -06:00
Gregory Nutt
a52967a772 Syslog interrrupt buffer: eliminate a warning about an uninitialized variable; simply some related logic. 2017-05-13 17:40:46 -06:00
Gregory Nutt
fc7c3f5328 syslog: I think this might speed upt the CR-LF scan in syslog_dev_write(). 2017-05-12 08:50:56 -06:00
Gregory Nutt
c84a3e3519 Bitbucket Issue 47: Some of last syslog changes needed to be condition on #ifdef CONFIG_SYSLOG_BUFFER in order to be built without syslog buffering enabled. 2017-05-12 07:58:11 -06:00
Gregory Nutt
1c9859520f syslog: There is yet another place where the output can get split. That is in syslog_dev_write(): It will break up the stream to insert a CR before the LF. This can that can be avoid be generating the CR-LF sequence in the buffer and then detecting and ignoring valid CR-LF sequences, rather than expecting syslog_dev_write() to insert the CR in this case.
I don't like the idea that syslog_dev_write() still scans the entire output buffer to expand CR-LF sequence.  This seems really wasteful, especially in this case where we can be sure that the is no CR or LF without a matching LF or CR.  Bu, I think, the existing behavior in syslog_dev_write() must be retained because it is needed in other contexts.
2017-05-12 07:31:50 -06:00
Gregory Nutt
0fc068cc9c syslog: Avoid flushing syslog_stream buffer, if possible, until lib_vsprintf() completely parses the format. This assures that the flush will flush the entire output, even data that may potentially follow the linefeed. And, in that case, it cannot be interleaved with other devug output. Suggested by Jussi Kivilinna. 2017-05-12 06:58:33 -06:00
Gregory Nutt
0de294a586 Fix lots of occurrences of 'the the', 'the there', 'the these', 'the then', 'the they. 2017-05-11 13:35:56 -06:00
Gregory Nutt
b5c1dd09f5 Syslog: Need inclusion of errno.h for fix building with CONFIG_SYSLOG_TIMESTMAP=y 2017-05-11 07:15:57 -06:00
Jussi Kivilinna
ba933efd9e When syslog message has addition characters after last new-line. With buffering those now get lost as vsyslog does not flush output after lib_sprintf. Additional trailing characters could be ANSI escape sequence to reset state that message setups. For example, macro here uses colors and resets state after actual message (including '\n'):
With flushing added to vsyslog, then there is problem that next syslog line might come from other task before reset sequence, causing wrong line getting color. This could be avoided by not flushing on '\n' but only if IOB is full and/or at end of vsyslog. Would this make sense?
2017-05-11 07:11:35 -06:00
Gregory Nutt
d3b9f5b37f Syslog buffering: Use IOBs to buffer data, not an on-stack buffer 2017-05-10 17:36:08 -06:00
Gregory Nutt
d8a83f16be Syslog buffering: Various corrections from early debug 2017-05-10 16:13:21 -06:00
Gregory Nutt
20727d17c3 SYSLOG: Add option to buffer SYSLOG output to avoid interleaving. 2017-05-10 14:42:43 -06:00
Jussi Kivilinna
e835803166 yslog: use monotonic clock for timestamp when available 2017-04-26 10:38:15 -06:00
Gregory Nutt
9f859774a1 setvbuf: Add support for configuration of line buffering. 2017-02-08 11:28:24 -06:00
Gregory Nutt
9ee3f3b933 sched_note: Permit spinlock and critical section notes in in-memory buffer iff sched_not_get() interfaces is disabled. 2016-11-28 18:36:26 -06:00
Gregory Nutt
d65be718c2 sched_note: Extend OS instrumentation to include some SMP events. 2016-11-27 17:14:57 -06:00
Gregory Nutt
4fcbe8e410 drivers: Disable priority inheritance on all semaphores used for signaling 2016-11-03 11:00:47 -06:00
Max Kriegleder
77e5115e23 syslog: Fixes required for file syslog output 2016-10-19 08:27:20 -06:00
Gregory Nutt
9965cbe428 drivers/: Review and correct some stylistic inconsistencies 2016-08-07 09:43:48 -06:00
Gregory Nutt
02b91d9880 Add a SYSLOG character device that can be used to re-direct output to the SYSLOG 2016-07-05 12:58:18 -06:00
Gregory Nutt
a39ce80add SYSLOG logic should use existing file interfaces, not re-invent them. 2016-07-05 12:12:44 -06:00
Gregory Nutt
3b825b3e00 Improve a debug assertion 2016-07-05 09:50:54 -06:00
Gregory Nutt
cbb36416ab Need to use back- not forward-slash in character constant 2016-06-27 09:52:50 -06:00
Gregory Nutt
acf3b14fe2 Trivial typo fix in README and document 2016-06-22 16:17:57 -06:00
Gregory Nutt
31b8e52267 Update README and documentatino 2016-06-22 14:47:40 -06:00
Gregory Nutt
0cb137d021 SYSLOG device flush logic not meaningful if SYSLOG file channels not supported 2016-06-22 13:35:53 -06:00
Gregory Nutt
1774ff2ed9 Add SYSLOG documentation to the porting guide 2016-06-22 12:26:54 -06:00
Gregory Nutt
b3acebd292 Update/replace drivers/syslog/README.txt 2016-06-22 10:47:27 -06:00
Gregory Nutt
9c87749afc SYSLOG device channel: Pre-pending CR to LF is now a configuration option 2016-06-22 10:08:20 -06:00
Gregory Nutt
91b82dcae3 SYSLOG character device channel will now expand LF to CR-LF 2016-06-22 08:36:50 -06:00
Gregory Nutt
82c890db23 syslog_dev_flush() needs to check if the inode is a mountpoint before calling the flush() method. Noted by David Sidrane. 2016-06-22 05:58:33 -06:00
Gregory Nutt
35cb2fb87d Eliminate a warning 2016-06-21 16:59:46 -06:00
Gregory Nutt
cb55c06153 sched_file_channel(): Comments say that we need to lock the scheduler, but we do not. 2016-06-21 16:39:28 -06:00
Gregory Nutt
8a9bd9af9d SYSLOG: Some rather complex conditional compilation missed a case. 2016-06-21 15:08:09 -06:00
Gregory Nutt
0e1e3bc404 Add a file that I forgot in the last commit; Also update some comments. 2016-06-21 13:33:17 -06:00
Gregory Nutt
e6a1d53869 Extend SYSLOG logic so that we can send SYSLOG output to a file. Not verified on initial commit. 2016-06-21 12:54:47 -06:00
David Sidrane
205a4b8498 Missing EXTERN on global variable declaration 2016-06-21 10:09:09 -06:00
Gregory Nutt
8f0c2cdd13 SYSLOG: Change configuration selections to assure that one and only one SYSLOG device can be selected. Also add a check to assure that it is appropriate to use up_putc as the low-level syslog device. Adds CONFIG_SYSLOG_CONSOLE and CONFIG_SYSLOG_SERIAL_CONSOLE. 2016-06-21 09:59:09 -06:00
Gregory Nutt
5118264e6c Rename CONFIG_SYSLOG_CONSOLE to CONFIG_CONSOLE_SYSLOG 2016-06-21 09:35:51 -06:00
Gregory Nutt
485aa6b231 SIM: Comment out skip scheduler debug output that can hang the simulation. 2016-06-21 08:59:01 -06:00
Gregory Nutt
c5ac473bc0 SYSLOG: Remove an obsolete, unused configuration item from Kconfig file 2016-06-21 07:58:42 -06:00
Gregory Nutt
62d8f839c7 SYSLOG: Now a two phase initialization. Some SYSLOG channels cannot be initialized until later in the bringup 2016-06-21 07:52:24 -06:00
Gregory Nutt
5385266756 SYSLOG: Fix a compile problem with assertions enabled. 2016-06-21 07:24:14 -06:00
Gregory Nutt
cf1375daf7 Break syslog_channel.c up into syslog_channel.c, syslog_putc.c, syslog_force.c and syslog_flush.c to limited what is brought into the link. Separate syslog_emergstream.c from syslog_stream.c. Didn't help in the case I was looking at. 2016-06-20 17:10:52 -06:00
Gregory Nutt
505ca542e8 Remove some last traces of lowvsyslog that were missed; Add a SYSLOG emergency channel for handling assertion output more cleanly 2016-06-20 16:11:50 -06:00
Gregory Nutt
2b445ddccc Remove lowsyslog(). The new syslog() includes all of the functionality of lowsyslog(). No longer any need for two interfaces. 2016-06-20 08:57:08 -06:00
Gregory Nutt
5002e27e84 Since syslog_add_intbuffer can now be called from the IDLE thread, it must use a critical section. Also fix an error in circular buffer index handling. 2016-06-20 07:50:07 -06:00
Gregory Nutt
f4c47636e7 SYSLOG: Debug output from the IDLE task should be forced like interrupt level output 2016-06-20 07:35:38 -06:00
Gregory Nutt
fa365e85f5 Update some cmoments 2016-06-20 06:11:22 -06:00
Stefan Kolb
a68232863e Fix missing implementation of static function 2016-06-20 06:11:21 -06:00
Gregory Nutt
9a19d64610 Reanem syslogstream.c to syslog_steam.c for consistency 2016-06-19 18:19:34 -06:00
Gregory Nutt
7dd66a4620 Need to pass va_list as a reference to vsyslog. This is because va_list is a structure in some compilers and passing of structures in the NuttX sycalls does not work. 2016-06-19 14:50:00 -06:00
Gregory Nutt
690a0e7a6e Eliminate another warning 2016-06-19 13:58:39 -06:00
Gregory Nutt
b68822805f Eliminate a warning 2016-06-19 13:56:49 -06:00
Gregory Nutt
e480b385e6 SYSLOG: syslog_initialize.c appeared twice is list of sources 2016-06-19 13:55:23 -06:00
Gregory Nutt
5b2aa7bf99 Remove all traces of CONFIG_SYSLOG 2016-06-19 13:59:43 -06:00
Gregory Nutt
9434d3e945 There is now one-and-only-one copy of syslog_putc. It is in the SYSLOG channel logic and can redirect syslog output as needed. All former syslog_putc versions were renamed and the corresponding SYSLOG device initializaiton now calls syslog_channel() 2016-06-19 13:03:20 -06:00
Gregory Nutt
d82942cf3b Merge remote-tracking branch 'origin/master' into syslog 2016-06-19 11:20:31 -06:00
Gregory Nutt
9f260ca193 Some renaming so that future features will fit in better; If the architecture provides its only system logging (via CONFIG_ARCH_SYSLOG), then syslog_initialize() is stubbed out 2016-06-19 11:16:12 -06:00
Gregory Nutt
19c6a82f8b a few cosmetic changes 2016-06-19 09:52:34 -06:00
Gregory Nutt
a43cdbff0b Add missing file header 2016-06-19 09:48:42 -06:00
Gregory Nutt
f59196247c Merge remote-tracking branch 'origin/master' into syslog 2016-06-19 09:47:13 -06:00
Gregory Nutt
99ad3e9bcf Need to capture return value from ramlog_syslog_initialize() 2016-06-19 09:41:35 -06:00
Gregory Nutt
0f18f3bd15 Move RAMLOG initialize from up_initialilize.c files to syslog_initialize(). up_initialize.c files now call syslog_initialize() unconditionally 2016-06-19 09:39:21 -06:00
Gregory Nutt
de58cb6027 Some higher level SYSLOG features are disabled if the architecture-specific logic provides its own SYSLOG functionality 2016-06-19 09:21:52 -06:00
Gregory Nutt
3bd953316f Add a hook before the existing syslog_initialize() call; rename the old syslog_initialize() to syslog_dev_initialize(). 2016-06-19 09:12:33 -06:00
Gregory Nutt
12150bc6c1 Merge remote-tracking branch 'origin/master' into syslog 2016-06-19 08:48:10 -06:00
Gregory Nutt
e27491f5be Move fs/drivers/fs_devsyslog.c to drivers/syslog/syslog_device.c 2016-06-19 08:46:46 -06:00
Gregory Nutt
668980b4fa Merge remote-tracking branch 'origin/master' into syslog 2016-06-19 08:02:42 -06:00
Gregory Nutt
34f776dce9 Move the OS intensive part of vsyslog and vlowsyslog to drivers/syslog/vsyslog.c and vlowsyslog.c. Also move lib_syslogstrem to drivers/syslog/syslogstream.c 2016-06-19 07:56:24 -06:00
Gregory Nutt
fedf00033c Make default interupt buffer smaller 2016-06-19 07:03:10 -06:00
Gregory Nutt
ea9565e137 SYSLOG: Flesh out interrupt buffer logic 2016-06-18 14:54:25 -06:00
Gregory Nutt
c44a011394 Add some basic SYSLOG channel selection logic 2016-06-18 12:54:55 -06:00
Gregory Nutt
1cdc746726 Rename CONFIG_DEBUG to CONFIG_DEBUG_FEATURES 2016-06-11 14:14:08 -06:00
Paul A. Patience
f8f7b7582c Silence some warnings 2016-05-26 14:06:13 -04:00
Gregory Nutt
242f8ff25f drivers/syslog/note_driver.c: Add a driver that will allow an application to read buffered scheduler instrumentation data 2016-03-17 14:46:00 -06:00
Gregory Nutt
e879d0f423 Move scheduler instrumentation hooks out of sched.h (where they seem like application interfaces) and into nuttx/sched.h where it is clare that these are OS internal interfaces. 2016-03-16 11:00:31 -06:00
Gregory Nutt
0fb035f76b Standardize some naming in code section comments 2016-02-21 18:09:04 -06:00
Gregory Nutt
2244ed46bc nuttx/drivers: Replace irqsave() with enter_critical_section(); replace irqrestore() with leave_critical_section() 2016-02-14 07:32:58 -06:00
Paul A. Patience
b5a77b9403 RAMLOG: Fix forgotten FARs 2015-11-05 10:38:42 -05:00
Gregory Nutt
cf14f8d1b5 drivers/: Fixes to spacing and alignement 2015-10-10 10:41:00 -06:00
Gregory Nutt
0b12dbf95d Fix some spacing problems 2015-10-04 15:04:00 -06:00