Commit Graph

94 Commits

Author SHA1 Message Date
yinshengkai 6064aa8bb5 drivers/note: remove choice in Kconfig
To support multiple note drivers to be used at the same time

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-06 16:23:00 +08:00
yinshengkai 8f823ce320 sergger: add note_ prefix to sysview
change 1: rename sysview.c to note_sysview.c
change 2: add note_ prefix to sysview's public function

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-05 22:04:52 +08:00
yinshengkai 77466742c7 drivers/segger: register sysview to note drivers list
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-05 22:04:52 +08:00
Xiang Xiao 779a610ca3 Remove the unnecessary NULL fields in global instance definition of file_operations
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 00:32:13 +02:00
Xiang Xiao 1815f8b731 drivers/note: Add const to g_notelog_ops
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 00:21:18 +02:00
Xiang Xiao 98ab55ef68 drivers/note: Replace the scritical section with spin_xxx_wo_note
to avoid to generate the unexpected schedule information

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 00:21:18 +02:00
yinshengkai 1cee890aa7 drivers/note: unify the spinlock operation in noteram
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-02 22:29:01 +08:00
Xiang Xiao cc9166274a drivers/note: Fix the mismatch of va_end call
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-31 14:57:47 +02:00
yinshengkai f85102d81b drivers/note: adjust note kconfig order
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-12-30 15:50:30 -03:00
yinshengkai ca5fcc58c2 sched: move SCHED_INSTRUMENTATION_xxx to note Kconfig
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-12-30 15:50:30 -03:00
yinshengkai 64b6df42a4 drivers/note: register notelog device
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-12-30 22:21:12 +08:00
yinshengkai 376e30193b drivers/note: remove sched_note_syscall_xxx in notelog
syslog is a system call, which will cause recursion after turning on SCHED_INSTRUMENTATION_SYSCALL

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-12-30 22:21:12 +08:00
yinshengkai bc7c520eca drivers/note: add note_syscall_enter parameter list
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-12-29 09:25:54 -03:00
yinshengkai dd32eccfc3 drivers/note: Move taskname related functions to note_driver.c
so all note drivers can retrieve the task name even after the task exit

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-12-26 15:03:57 +08:00
yinshengkai 6f66c0ea0b drivers/note: sched_note support mulit-channel
call callbacks for different channels in sched_note_*
noteram channel is enabled by default

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-12-17 19:41:21 +08:00
Xiang Xiao 06842c824a sched/note: Change sched_note_[begin|end] to macro
improve the speed

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-16 12:20:53 +02:00
yinshengkai 552cf4b549 merge sched_note_spinxx into sched_note_spincommon
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-12-16 17:03:53 +08:00
yinshengkai 2460ff4f78 drivers/note: rename /dev/note to /dev/note/ram
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-12-15 15:53:49 +08:00
Xiang Xiao 03f07effc9 drivers/note: Fix the style issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-14 21:24:13 +02:00
Xiang Xiao c36640e205 drivers/segger: Rename nuttx/note/note_sysview.h to nuttx/segger/sysview.h
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-14 21:24:13 +02:00
Xiang Xiao 126c93015f drivers/node: Rename sched_note.c to to note_driver.c
prepare to support the multiple note driver

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-14 21:24:13 +02:00
Xiang Xiao d7307ef26c drivers/node: Rename note_register to note_initialize
prepare to support the multiple note driver

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-14 21:24:13 +02:00
yinshengkai 026c8eede0 drivers/note: unify spinlock related functions
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-12-10 02:30:24 +08:00
yinshengkai 09814831b8 sched: move sched_note.c to drivers/note
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-12-09 23:36:11 +08:00
Huang Qi e4e3208180 Replace all strncpy with strlcpy for safety
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-08-25 13:38:36 +08:00
Petro Karashchenko 98ba65c422 c89: get rid of designated initializers in common code
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-28 13:39:27 +08:00
Huang Qi 7d58e6263f drivers/note: Add macro guard for instrumention switch
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-03-14 10:52:48 +08:00
chao.an e04ccba78a note/sysview: add Segger System View support
Reference:
https://www.segger.com/products/development-tools/systemview
https://github.com/SEGGERMicro/SystemView
https://github.com/SEGGERMicro/RTT

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-29 17:26:04 +08:00
Petro Karashchenko a743fed63d file_operations: get back C89 compatible initializer
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-11 02:14:00 +08:00
zhanghu6 84019b9170 noteram: when the buffer overflow happen and give the asan report
READ of size 1 at 0x5ec78f90 thread T0
0 0x59682d7a in noteram_remove note/noteram_driver.c:432
1 0x59683c43 in sched_note_add note/noteram_driver.c:854
0x5ec78f90 is located 0 bytes to the right of global variable 'g_noteram_info' defined in 'note/noteram_driver.c:95:30' (0x5ec78780) of size 2064
0x5ec78f90 is located 48 bytes to the left of global variable '*.Lubsan_type0' defined in 'note/noteram_driver.c' (0x5ec78fc0) of size 10
reason: that read pos is tail of g_noteram_info.ni_buffer causes overflow
2021-12-10 12:33:14 -06:00
Abdelatif Guettouche 9b1d4de3be drivers/note: Fix typos.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-11-12 16:50:41 -03:00
Xiang Xiao 8fe701c8ae note/notelog: Implement more sched_note callback
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-07-04 18:52:32 -03:00
Xiang Xiao 0941bad877 note: Move up_schednote.c to drivers/note folder
since it is general enough to work on other target

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-07-04 18:52:32 -03:00
Xiang Xiao 5f3a98b5a8 libc/assert: Reference the expression in all case
to avoid the warning "defined but not used"

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I55b7c092d0f2e5882fc1784987657c10cdf2d90b
2021-04-03 21:00:41 +01: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
Nakamura, Yuuichi 7905ee17d4 Add task name recording for note RAM driver 2020-11-02 01:12:08 -08:00
Masayuki Ishikawa 822497d021 drivers: note: Fix compile errors in noteram_driver.c
Summary:
- This commit fixes compile errors if CONFIG_DEBUG_ASSERTIONS=y

Impact:
- Affects noteram_driver only

Testing:
- Tested with spresense:wifi_smp with CONFIG_DEBUG_ASSERTIONS=y

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-10-06 16:42:40 +08:00
Nakamura, Yuuichi 89ea234af8 Add on-boot instrumentation support for note filter 2020-10-06 03:26:46 +08:00
Nakamura, Yuuichi a373079a94 Fix /dev/note driver for task trace support 2020-10-06 03:26:46 +08:00
Nakamura, Yuuichi 6efecd2105 Add notectl driver 2020-10-06 03:26:46 +08:00
Xiang Xiao 77ae03788a note: Rename note driver to noteram driver
to reflect this is just a normal note driver with ram buffer

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-09-15 14:55:22 +08:00
Xiang Xiao 0c3930ba11 sched: Rename note_add to sched_note_add
to better match other sched_note_* function

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-09-12 08:42:30 -07:00
Xiang Xiao 952af92690 sched/note: Move the circle buffer code to driver
so the format code can be shared by different transport

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-09-07 11:54:10 +08: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