Commit Graph

207 Commits

Author SHA1 Message Date
Jiuzhu Dong
817259ec2d syslog/ramlog_channel: fix log confusion when multi task writing together
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-03 11:24:21 -05:00
Jiuzhu Dong
7fa69e4173 syslog/ramlog: get ramlog size by ioctl
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-03 11:24:21 -05:00
Jiuzhu Dong
b30bf4ff06 syslog/default_channel: fix log confusion when multi task writing together
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-03 11:24:21 -05:00
Jiuzhu Dong
a75b712e77 syslog: fix crash when print localtime by syslog
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-02 04:57:11 -05:00
ligd
5de150160f syslog: add CPU id to system when open CONFIG_SMP
Change-Id: Ie8aaf44583ff4146b79b1392d1410b31806a81e8
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-07-02 08:45:43 +09:00
Fotis Panagiotopoulos
b16de69e56 syslog: Added channel close callback. 2021-06-18 00:47:09 -05:00
Xiang Xiao
80157b8782 syslog/ramlog: Remove the duplication of \n->\r\n conversion
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I5497f3ab40a55c5c08ba893e1186b93915cef03a
2021-06-17 06:22:28 -07:00
Fotis Panagiotopoulos
b73dc0f166 syslog: Added separator in file logs. 2021-06-09 10:09:04 -05:00
Xiang Xiao
5b2a17b892 Include assert.h in necessary place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-08 13:06:08 -07:00
Fotis Panagiotopoulos
37ec290a11 Syslog file rotations number is configurable. 2021-06-08 04:12:48 -05:00
Fotis Panagiotopoulos
216194d31b Added automatic log rotation, when log file is opened. 2021-06-03 15:57:28 -03:00
Xiang Xiao
2e54df0f35 Don't include assert.h from public header file
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-03 08:36:03 -07:00
Fotis Panagiotopoulos
e189d83e11 SYSLOG channel add functions return handle to the channel. 2021-06-03 08:36:15 -05:00
Jiuzhu Dong
ed6b257fa4 syslog: support ramlog, up_putc, rpmsg_syslog coexist
N/A

Change-Id: Ia58c7e195da7ad48f3018a131a78b2f01f94e741
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-06-02 08:45:20 -05:00
Jiuzhu Dong
01ff3604b0 syslog/Kconfig: support config multi syslog channel
delete choice for select syslog log device

Change-Id: Ifc02e687526506afac46febec375062949869356
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-06-02 08:45:20 -05:00
Jiuzhu Dong
e21fddbb34 syslog/emerg: fix bug about printing LOG_EMERG log from iob buffer
The patch is related to: commit 5f7c98b6e1

Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date:   Mon May 17 22:38:22 2021 +0800

    drivers/syslog: Remove emergstream implementation and caller

    since emergstream always call syslog_force, but syslog_force is designed
    for the interrupt context, and then doesn't mean any emergency thing.
    On the other hand, emergstream has other bad side effect:
    1.Can't output to file or dev channel
    2.Can't work well with the interrupt buffer

    Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-06-02 10:25:19 -03:00
Jiuzhu Dong
aeb7ed8c53 syslog/ramlog: initialize g_sysdev based on the current ramlog buffer
by ramlog_initbuf();
Algorithm: Scan the entire ramlog buffer, the position of the head
is the first byte is not empty and second byte is empty. The position
of the tail is the first byte is empty and second byte is not empty.

Change-Id: Ieb9161bd670481cd335e9a901287cd5e589f0849
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-06-01 15:16:45 -03:00
Jiuzhu Dong
ec38d0ce98 syslog/ramlog: save ramlog to fixed section
we can reload ramlog after hot reboot.

Change-Id: Iee7c105a2358075302121d6bf0047bc54d07e9a6
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-06-01 15:16:45 -03:00
Jiuzhu Dong
4ae6862bbe syslog: fix bug about syslog_default_write
Change-Id: I6d8b5bce8071f11b1903fe1fa0fe8dbc34bf3a09
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-06-01 12:44:17 -05:00
Xiang Xiao
5f7c98b6e1 drivers/syslog: Remove emergstream implementation and caller
since emergstream always call syslog_force, but syslog_force is designed
for the interrupt context, and then doesn't mean any emergency thing.
On the other hand, emergstream has other bad side effect:
1.Can't output to file or dev channel
2.Can't work well with the interrupt buffer

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-05-18 09:26:28 -03:00
Jiuzhu Dong
ff567124d3 driver/syslog: add config SYSLOG_RPMSG_SERVER_NAME to
N/A

specified the name of remote proc(rpmsg server)

Change-Id: Ie270d651071e87a40a80ab489597ae18db9814f0
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-05-15 09:39:57 -03:00
Fotis Panagiotopoulos
3543ac95bf syslog_device: Device is re-opened in case of failure. 2021-04-10 06:47:44 -05:00
Fotis Panagiotopoulos
ee7276e7a7 syslog: syslog_device ops are handled internally by the driver. 2021-04-09 08:02:38 -05:00
Fotis Panagiotopoulos
ac7feda1bc syslog: Proper uninit of syslog_device. 2021-04-07 08:38:53 -05:00
Fotis Panagiotopoulos
c4a9a35fb9 syslog: Fix in syslog_intbuffer flushing. 2021-04-06 10:26:55 -05:00
Fotis Panagiotopoulos
1dee243e29 syslog: Added multi device support in syslog_device. 2021-04-06 07:32:23 -05:00
Alin Jerpelea
08e5378b11 NuttX: Gregory Nutt: update licenses to Apache
Several licenses were missed in the initial work

David Sidrane has submitted the ICLA and we can migrate the licenses
 to Apache.

Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-04-03 04:20:31 -07:00
Alin Jerpelea
0f41c3c555 NuttX: Pierre-Noel Bouteville: update licenses to Apache
Pierre-Noel Bouteville has submitted the ICLA and we can migrate the licenses
 to Apache.

David Sidrane has submitted the ICLA and we can migrate the licenses
 to Apache.

Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-04-01 12:13:12 -05:00
Fotis Panagiotopoulos
f13adbe4bb Added support for multiple syslog channels. 2021-03-23 21:35:22 -07:00
Matias N
cf8521e6de syslog: add option to prefix process name 2021-03-11 19:40:48 -03:00
Gustavo Henrique Nihei
330eff36d7 sourcefiles: Fix relative path in file header 2021-03-09 23:18:28 +08:00
Alin Jerpelea
ccff570e6f drivers: nxstyle fixes
nxstyle fixes to pass the CI.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-04 18:32:27 -08:00
Alin Jerpelea
e5b6305f4a drivers: Author Gregory Nutt: update licenses to Apache
Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-04 18:32:27 -08:00
ligd
0d24582fe0 syslog_rpmsg: fix system crash when open CONFIG_SCHED_HAVE_PARENT
Reason:
nx_start use syslog at every early time event the idle thread not
full setup, then syslog_rpmsg -> work_queue -> work_signal ->
nxsig_kill -> rtcb is NULL -> crash

Fix:
sched work_queue after is_rpmsg_ept_ready() is true

Change-Id: I225469ff2526e4b810bf3e23473b55d57e64a1ff
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-03-03 19:08:15 -08:00
Fotis Panagiotopoulos
eabb2fbf38 Re-arranged syslog fields. 2021-01-18 05:37:55 -08:00
chao.an
efe236ba84 drivers/syslog: Prepend Process ID to syslog message
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-01-16 18:38:18 -08:00
Fotis Panagiotopoulos
cb78dadc4b Added color output to syslog. 2021-01-16 16:17:16 -08:00
Fotis Panagiotopoulos
946443e190 Added printing of log priority in syslog. 2021-01-16 08:56:24 -08:00
Fotis Panagiotopoulos
c11413a258 Added formatted timestamps in syslog. 2021-01-14 07:55:22 -06:00
YAMAMOTO Takashi
f8d6a85f90 drivers/syslog/vsyslog.c: Fix a printf format warning 2020-11-16 08:29:00 -08:00
Xiang Xiao
eb4121ce38 Change all 'Nuttx' to 'NuttX'
Unify the naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-10-20 01:45:06 -07:00
Xiang Xiao
f99719e260 Move note driver from drivers/syslog to drivers/note
it's better to put the note transport layer into a common folder

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-09-07 11:54:10 +08:00
Xiang Xiao
b5f429c88b Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-22 17:37:21 -06:00
Xiang Xiao
ae356001cf Change all files come from Xiaomi/Pinecone to Apache License 2.0
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-22 17:37:21 -06:00
YAMAMOTO Takashi
1a669e09cd drivers/syslog/syslog_write.c: nxstyle fix 2020-07-29 21:13:20 -07:00
YAMAMOTO Takashi
9274b67a45 syslog_default_write: Fix the return value
Found by clang-check:

syslog/syslog_write.c:96:7: warning: Value stored to 'nwritten' is never read
      nwritten = g_syslog_channel->sc_write(buffer, buflen);
      ^          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
2020-07-29 21:13:20 -07:00
SPRESENSE
27835c8c0a ramlog: Add overwrite option to ramlog
Enable overwrite of circular buffer. If RAMLOG buffer overflows,
overwrite it from the top of buffer and always keep the latest log.
2020-07-28 04:00:18 -05:00
Nakamura, Yuuichi
ec0212cc8a drivers/syslog/note_driver.c: nxstyle fix 2020-06-17 20:15:54 +08:00
Gregory Nutt
57bc329aac Run nxstyle all .c and .h files modified by PR. 2020-05-17 14:01:00 -03:00
Gregory Nutt
a569006fd8 sched/: Make more naming consistent
Rename various functions per the quidelines of https://cwiki.apache.org/confluence/display/NUTTX/Naming+of+OS+Internal+Functions

    nxsem_setprotocol -> nxsem_set_protocol
    nxsem_getprotocol -> nxsem_get_protocol
    nxsem_getvalue -> nxsem_get_value
2020-05-17 14:01:00 -03:00