Commit Graph

62 Commits

Author SHA1 Message Date
xuxingliang cef56fbdb6 drivers/segger: inline note_sysview_get_timestamp
Avoid another layer of function call to get time.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-14 17:03:57 +02:00
zhangwenjian 7aa1871664 note:support filter for each note channel
Signed-off-by: zhangwenjian <zhangwenjian@xiaomi.com>
2024-10-13 14:05:50 +08:00
xuxingliang 62f0126b06 drivers/segger: add note vprint support
Print note log to sysview terminal.

See https://www.segger.com/products/development-tools/systemview/#logging-output

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-12 09:58:00 +08:00
xuxingliang 5dffc61097 sched/note: add wdog note for segger sysview
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-09 08:39:58 +08:00
xuxingliang bc5a337a58 sched/note: add note for wdog module
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-09 08:39:58 +08:00
xuxingliang 18d5ae20f5 drivers/segger: add heap data plot
Add heap current used to note.
Plot it in segger sysview data plot.

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-10-07 17:34:59 +08:00
Neo Xu b3cc564910 drivers/segger: upgrade segger to v356
From V3.5.6 on, data plot is supported.

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-10-07 17:34:59 +08:00
xuxingliang 3bfb40f299 drivers/segger: add heap note support
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-10-07 17:34:59 +08:00
xuxingliang 7044b10c88 task: use get_task_name where possible
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-10-01 20:38:06 +08:00
chao an 9abe737ef3 syslog/channel: add constant attribute if SYSLOG_IOCTL is not enabled
move all private channel define from data to rodata

Signed-off-by: chao an <anchao@lixiang.com>
2024-09-26 16:10:29 +08:00
xuxingliang ae03313473 drivers/segger: upgrade to v3.54
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-07-03 17:31:23 +08:00
chao an e456c88c09 Revert "sched: replace some global variables to macro"
sched implementation not depends on macro abstraction, so revert below commit:

This reverts commit 4e62d0005a
This reverts commit 0f0c370520
This reverts commit ad0efd04ee

Signed-off-by: chao an <anchao@lixiang.com>
2024-06-06 22:00:25 +08:00
chao an feb6ede434 sched/cpu: replace up_cpu_index() to this_cpu()
In SMP mode, up_cpu_index()/this_cpu() are the same, both return the index of the physical core.
In AMP mode, up_cpu_index() will return the index of the physical core, and this_cpu() will always return 0

| #ifdef CONFIG_SMP
| #  define this_cpu()             up_cpu_index()
| #elif defined(CONFIG_AMP)
| #  define this_cpu()             (0)
| #else
| #  define this_cpu()             (0)
| #endif

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-21 18:52:35 +08:00
chao an 4e62d0005a sched: replace some global variables to macro
replace to macro will help to extend the scheduling implementation

Signed-off-by: chao an <anchao@lixiang.com>
2024-03-21 18:51:25 +08:00
chao an 09c17fcfa8 segger/rtt: correct macro name to avoid unable to change default mode
SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL should be CONFIG_SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL

Signed-off-by: chao an <anchao@xiaomi.com>
2023-11-30 06:16:09 -08:00
raiden00pl 7996266f6e drivers/segger/Kconfig: cosmetics 2023-11-13 06:08:30 -08:00
yinshengkai ddb87d3b86 clock: replace all up_perf_xx with perf_xx
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-10-02 16:11:43 +02:00
raiden00pl 4db39d7afd drivers/rtt: make RTT console optional 2023-09-29 13:00:06 +08:00
Daniel Appiagyei 5bfda12634 c++ compatibility: rename reserved c++ keywords 'public' and 'this' 2023-09-16 19:45:02 +08:00
chao an 664927c86e mm/alloc: remove all unnecessary cast for alloc
Fix the minor style issue and remove unnecessary cast

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-30 14:34:20 +08:00
raiden00pl a72b8e2fd4 cmake: drivers/segger support 2023-08-22 23:37:08 +08:00
yinshengkai bc181f3f9c drivers/rtt: add rtt syslog channel configuration
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-11 18:13:52 +08:00
raiden00pl dbc28cbf75 note_sysview.c: note_sysview_initialize should return error value 2023-08-02 08:05:37 -07:00
Xiang Xiao bcaa52e0f1 driver/segger: Simplify serial driver configuation
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-16 14:37:21 +03:00
xiajizhong 7160849f63 new feature on trace dump support segger-rtt
Signed-off-by: xiajizhong <xiajizhong@xiaomi.com>
2023-07-16 14:37:21 +03:00
Xiang Xiao dbd13c2aca drivers/segger: Rename serial device from /dev/rttx to /dev/ttyRx
follow the serial driver naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-15 18:38:08 -03:00
yinshengkai 9c6f48e57b drivers/segger: add RTT serial support
usage:
  1. Connect Jlink, start JLinkGDBServer
     JLinkGDBServer -if SWD -device stm32h743zi -speed 16000
  2. Listen to the RTT port data and forward it to the virtual serial port
     sudo socat -d -d PTY,link=/dev/ttyRTT0,raw,ignoreeof TCP:127.0.0.1:19021,reuseaddr
  3. Read serial data
     minicom -D /dev/ttyRTT0

Performance:(STM32H743, 400MHZ)
time "dd if=/dev/zero of=/dev/console bs=512 count=2048"
6.67 sec  157KB/s

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-07-12 09:54:50 +08:00
yinshengkai e1553e8407 drivers/rtt: check whether Jlink is connected
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-07-12 09:54:50 +08:00
chao an 6ee9ec7656 build: add initial cmake build system
1. Update all CMakeLists.txt to adapt to new layout
2. Fix cmake build break
3. Update all new file license
4. Fully compatible with current compilation environment(use configure.sh or cmake as you choose)

------------------

How to test

From within nuttx/. Configure:

cmake -B build -DBOARD_CONFIG=sim/nsh -GNinja
cmake -B build -DBOARD_CONFIG=sim:nsh -GNinja
cmake -B build -DBOARD_CONFIG=sabre-6quad/smp -GNinja
cmake -B build -DBOARD_CONFIG=lm3s6965-ek/qemu-flat -GNinja

(or full path in custom board) :
cmake -B build -DBOARD_CONFIG=$PWD/boards/sim/sim/sim/configs/nsh -GNinja

This uses ninja generator (install with sudo apt install ninja-build). To build:

$ cmake --build build

menuconfig:

$ cmake --build build -t menuconfig

--------------------------

2. cmake/build: reformat the cmake style by cmake-format

https://github.com/cheshirekow/cmake_format

$ pip install cmakelang

$ for i in `find -name CMakeLists.txt`;do cmake-format $i -o $i;done
$ for i in `find -name *\.cmake`;do cmake-format $i -o $i;done

Co-authored-by: Matias N <matias@protobits.dev>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-08 13:50:48 +08:00
Xiang Xiao 309f89d6c3 segger: Change the default value of SEGGER_RTT_MAX_NUM_DOWN_BUFFERS to SEGGER_RTT_MAX_NUM_UP_BUFFERS
since the number of down buffers should be equal to the number of up buffers in most cases.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-23 00:36:36 +03:00
Xiang Xiao 6f6fce95a2 Replace all sprintf with snprintf
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-08 09:57:01 +02:00
wangming9 a7fc26124d arch/arm64: the arm64 perf interface supports pmu
Summary:
- Support arm64 pmu api, Currently only the cycle counter function is supported.
- Using ARM64 PMU hardware capability to implement perf interface, modify all
  perf interface related code.
- Support for pmu init under smp.

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2023-04-10 16:23:49 -03:00
yinshengkai 64e7e43f1f drivers/note: adjust the note_driver_ops definition
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-03-21 12:13:38 -03:00
Karel Kočí 62661600b2 treewide: add DOWNLOAD variable as unification of curl call
This is a followup to the commit
03b164f59c.
2023-03-08 17:05:05 +08:00
Xiang Xiao ee24396d77 drivers/note: Change DRIVER_NOTExxx to DRIVERS_NOTExxx
follow other driver config style

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-20 14:30:59 +08:00
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 2e4c4822eb segger/sysview: add up_perf_freq result chaeck
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-06 15:06:15 +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
yinshengkai 4ba7624804 Revert "Sysview add prefix kconfig to add an option to decouple sched_note calls"
This reverts commit f72f7ebee0.
2023-01-05 22:04:52 +08: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
Peter van der Perk f72f7ebee0 Sysview add prefix kconfig to add an option to decouple sched_note calls 2022-12-08 17:49:55 +01:00
Xiang Xiao 055f1f33eb libc/stream: Rename [lib_stream_](put|get) to [lib_stream_](putc|getc)
to make the naming style consistent with each other

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 14:27:55 +01:00
Xiang Xiao 4be9ec774b Don't download tarballs if a local git repo found
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 10:47:36 +01:00
yinshengkai 699e3e8291 let segger RTT kconfig sink one level
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-11-28 15:22:58 +08:00
Xiang Xiao af2b491420 driver/segger: Move SYSLOG_RTT config from drivers/syslog to drivers/segger
and remove include/nuttx/syslog/syslog_rtt.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-27 23:10:39 +01:00
Xiang Xiao fd268d7123 drivers/segger: Add STREAM_RTT option
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-27 23:10:39 +01:00
Xiang Xiao ac365ab7e9 drivers/segger: Refine Kconfig option
1.Add SEGGER_SYSVIEW_RTT_CHANNEL option
2.SEGGER_RTT_BUFFER_SIZE_UP always default to 1KB
3.SEGGER_SYSVIEW_RTT_BUFFER_SIZE default to SEGGER_RTT_BUFFER_SIZE_UP

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-27 23:10:39 +01:00
yinshengkai 126b33c488 drivers/segger: add Segger RTT stream support
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-11-27 23:39:20 +08:00
Xu Xingliang d1be53e748 drivers/segger: make RTT_MODE configurable
CHAMPION-2373

To allow use NO_BLOCK mode, so the system keeps running when debugger disconnected.

Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2022-11-21 17:19:09 +08:00