wangmingrong1
d2dc2c796d
Path Error
...
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-26 13:50:53 +08:00
buxiasen
3e24aab208
stream_getc: use lib_stream_eof instead of EOF
...
Will case scanftest break #14778 , at " %4c%n" case.
scanf use INT_MAX cause EOF break.
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-11-26 10:25:36 +08:00
Jinliang Li
f3213efc7f
armv8-r/libc: optimize libc string apis with asm
...
Optimize libc string apis(memcpy/memset/memmove/memchr/strcmp/strlen)
with arm32 assembly instruction including vfp and neon.
Add arch releated elf parsing
Signed-off-by: Jinliang Li <lijinliang1@lixiang.com>
2024-11-26 10:22:12 +08:00
hujun5
f5136b2afa
spinlock: remove recursive locks with write_lock_irqsave/read_lock_irqsave
...
reason:
1 There is a similar PR, https://github.com/apache/nuttx/pull/14079 ,
2 Currently, no one is using recursive locks with write_lock_irqsave/read_lock_irqsave.
3 Nested spinlock is harmful, prone to abuse and leading to a decline in code quality and performance
4 Nested spinlock is also not available in Linux.
5 In our future plans, nested usage of enter_critical_section and spin_lock_irqsave will also be removed.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-26 10:21:04 +08:00
hujun5
33226a9bb7
use spin_lock_wo_note replace spin_lock in csection
...
reason:
spin_lock_wo_note/spin_unlock_wo_note should be called in matching pairs.
This commit fixes the regression from https://github.com/apache/nuttx/pull/13933
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-26 10:17:18 +08:00
simbit18
00f831028f
[ci] platforms: added toolchains
...
add toolchains for macOS on Apple Intel
xtensa-esp32s2
xtensa-esp32s3
add toolchains for macOS on Apple Silicon
xtensa-esp32s2
xtensa-esp32s3
add install for ubuntu.sh
xtensa-esp32s2
xtensa-esp32s3
add install for linux.sh
xtensa-esp32s2
xtensa-esp32s3
2024-11-26 10:14:42 +08:00
hujun5
eb65c5a8cd
note: Remove enter_critical_section from the sched_note module to avoid recursive calls.
...
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-26 10:14:02 +08:00
hujun5
111a0746c2
arm64: change name saved_reg to saved_regs
...
reason:
saved_regs is more meaningful and used by all other arch
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-26 10:09:31 +08:00
hujun5
53548509b1
fix build error
...
common/espressif/esp_rmt.c: In function 'rmt_set_tx_thr_intr_en':
common/espressif/esp_rmt.c:654:48: error: passing argument 1 of 'spin_lock_irqsave' makes pointer from integer without a cast [-Werror=int-conversion]
654 | flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~
| |
| spinlock_t {aka unsigned char}
/home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/spinlock.h:617:55: note: expected 'volatile spinlock_t *' {aka 'volatile unsigned char *'} but argument is of type 'spinlock_t' {aka 'unsigned char'}
617 | irqstate_t spin_lock_irqsave(FAR volatile spinlock_t *lock)
| ~~~~~~~~~~~~~~~~~~~~~^~~~
CC: nsh_script.c common/espressif/esp_rmt.c:662:48: error: passing argument 1 of 'spin_lock_irqsave' makes pointer from integer without a cast [-Werror=int-conversion]
662 | flags = spin_lock_irqsave(g_rmtdev_common.rmt_spinlock);
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~
| |
| spinlock_t {aka unsigned char}
/home/hujun5/downloads1/vela_sim/nuttx/include/nuttx/spinlock.h:617:55: note: expected '
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-26 09:03:29 +08:00
YAMAMOTO Takashi
92b9a30878
fs/littlefs: make CONFIG_FS_LITTLEFS_VERSION include the "v" prefix
...
To allow other tags/branches like "devel" and even sha256 hash.
2024-11-25 20:15:53 -03:00
Neo Xu
224a8f4b28
Documentation: fix nuttxgdb related commands
...
Now we should load tools/gdb/gdbinit.py script
Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
2024-11-25 18:43:23 -03:00
hujun5
34e79f9618
spinlock: use spin_lock_init replace spin_initialize
...
reason:
1: spin_lock_init and spin_initialize have similar functionalities.
2: spin_lock and spin_unlock should be called in matching pairs.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-26 00:02:44 +08:00
yinshengkai
e69903c939
tools/gdb: Add a singleton class for macros
...
Usage:
macro = Macro("nuttx/nuttx")
print(macro.CONFIG_MM_BACKTRACE)
if macro.CONFIG_MM_BACKTRACE:
print("mm backtrace is enabled")
else:
print("mm backtrace is disabled")
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-11-25 22:58:53 +08:00
yinshengkai
9eaec7ba49
tools/gdb: move the macros cache files to a temporary directory
...
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-11-25 22:58:53 +08:00
yinshengkai
7aa2dc24cd
tools/gdb: fix checkpatch warning
...
Use Python raw strings to avoid escaping:
SyntaxWarning: invalid escape sequence '\?'
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-11-25 22:58:53 +08:00
chao an
24add5eeaf
spelling: fix spelling typo premp -> preemp
...
Signed-off-by: chao an <anchao@lixiang.com>
2024-11-25 22:05:05 +08:00
chao an
6ffb001fdf
spelling: fix spelling typo premption -> preemption
...
Signed-off-by: chao an <anchao@lixiang.com>
2024-11-25 22:05:05 +08:00
wangmingrong1
47e33c6433
clang/gcov: Add a way to directly dump memory address
...
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-25 18:03:19 +08:00
wangmingrong1
a73217d1d6
Clang/gcov: Supports gcc standard output interface "__gcov_dump"
...
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-11-25 18:03:19 +08:00
hujun5
03f430edf7
fix some build error
...
hujun5@hujun5-OptiPlex-7070:~/downloads1/vela_sim/nuttx$ make -j12
chip/qemu_boot.c: In function 'up_cpu_start':
chip/qemu_boot.c:102:3: warning: implicit declaration of function 'sched_note_cpu_start' [-Wimplicit-function-declaration]
102 | sched_note_cpu_start(this_task(), cpu);
| ^~~~~~~~~~~~~~~~~~~~
chip/qemu_boot.c:102:24: warning: implicit declaration of function 'this_task' [-Wimplicit-function-declaration]
102 | sched_note_cpu_start(this_task(), cpu);
| ^~~~~~~~~
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-11-25 17:10:50 +08:00
xuxingliang
8031c9c1de
gdb/mm: cache global variables to save time of memleak check
...
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-25 13:37:42 +08:00
xuxingliang
a0e9b82a79
tools/gdb: always use name to read register
...
For unknown reason, for some cases, GDB refuses to read register using descriptor. Let's stick to the register name.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-25 13:37:42 +08:00
xuxingliang
9881fbae28
tools/gdb: fix thread command not working
...
`thread` is a GDB prefix command. Use `define` can only change it to a
user prefix command. In this case, `thread 3` is unable to pass
the argument 3 to python.
Use python code to register command to overwrite this behavior. It may
not work with future GDB, but all is good for now.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-25 13:37:42 +08:00
xuxingliang
efb890abd3
gdb/diagnose: use unified message for command error
...
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-25 13:37:42 +08:00
xuxingliang
5b477aacca
gdb/diag: catch gdb.error in diagnositics
...
gdb.error could report if memory is corrupted. Save and report the exception and continue to next command.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-25 13:37:42 +08:00
xuxingliang
191dbcc4f1
gdb/debug: add debugpy to debug python code
...
Usage:
(gdb) debugpy
Waiting for connection at localhost:5678
In VSCode, add new configuration in launch.
{
"name": "Python Debugger: Remote Attach",
"type": "debugpy",
"request": "attach",
"connect": {
"host": "localhost",
"port": 5678
}
}
and launch.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-25 13:37:30 +08:00
xuxingliang
6119a5ea63
gdb: print trace back when some modules failed to load
...
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-25 13:37:19 +08:00
yangao1
400790d40b
tools/gdb/gdbinit.py:add hint
...
Signed-off-by: yangao1 <yangao1@xiaomi.com>
2024-11-25 13:37:19 +08:00
xuxingliang
db9b5c4cee
tools/gdb: register commands gracefully
...
Report any error and continue to try to register next command.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-25 13:37:19 +08:00
xuxingliang
65a93e972c
tools/gdb: guide user for correct usage of nuttxgdb
...
Should use gdbinit.py instead of package __init__.py. Report the correct usage if user try to source the package directly.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-25 13:37:19 +08:00
dependabot[bot]
99b3190ba3
build(deps): bump codelytv/pr-size-labeler from 1.10.1 to 1.10.2
...
Bumps [codelytv/pr-size-labeler](https://github.com/codelytv/pr-size-labeler ) from 1.10.1 to 1.10.2.
- [Release notes](https://github.com/codelytv/pr-size-labeler/releases )
- [Commits](https://github.com/codelytv/pr-size-labeler/compare/v1.10.1...v1.10.2 )
---
updated-dependencies:
- dependency-name: codelytv/pr-size-labeler
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2024-11-25 13:37:09 +08:00
xuxingliang
358261af19
tools/gdb: avoid direct access to tcb['name']
...
It could be disabled at compile time. Use utils.get_task_name to handle it
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-25 00:42:34 +08:00
xuxingliang
41c4eb08c0
gdb/mm: fix prev free judging and region search
...
1. The prev free flag should use field size instead of preceding to compare.
2. If not prev-free, then prevnode should be None.
3. Cast type to mm_freenode_s in order to access flink, blink when node is free.
4. Heap itself is also included in first region.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-25 00:42:34 +08:00
xuxingliang
8667f911bc
gdb/mm: fix memdump when mempool backtrace is disabled
...
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-25 00:42:34 +08:00
xuxingliang
ee9673f62e
gdb/memdump: add option to exclude nodes from specific PID
...
This is useful to exclude memory nodes for mempool.
E.g.
(gdb) mm dump --nob --top 5 --sort size --nop --no-pid -1
Pool CNT PID Size Overhead Seqno Address Backtrace
H 1 0 16777264 44 13 0x41a79010
H 2 160 1536048 44 1129827490 0x41d6aad0
H 1 45374 1536176 44 1129829080 0x45ef1010
H 3 141 408440 44 145817 0x43905bf0
H 7 158 131120 44 32955 0x4308d090
Total 14 blks, 23528696 bytes
(gdb) mm dump --nob --top 5 --sort size --nop
Pool CNT PID Size Overhead Seqno Address Backtrace
H 1 0 16777264 44 13 0x41a79010
* H 6 -1 1048640 44 116954 0x436a0fd0
* H 5 -1 1048640 44 146821 0x43b24fd0
* H 3 -1 1048640 44 66161 0x4335bfd0
* H 3 -1 1048640 44 156337 0x43d3ffd0
Total 18 blks, 16777264 bytes
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-25 00:42:34 +08:00
xuxingliang
f849092ede
gdb/memdump: add option to parse memdump log from device
...
igned-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-25 00:42:34 +08:00
xuxingliang
06a696076a
gdb/memdump: reorganize the memdump parameters
...
Make the dump_nodes etc more common to use.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-25 00:42:34 +08:00
xuxingliang
6d2ebfdec6
mm: dump node overheadp during memdump
...
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-25 00:42:34 +08:00
xuxingliang
797f7a043d
gdb/memdump: show prev and next node in address finding mode
...
This will make it easier to debug memory corruption when agacent node is corrupted.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-25 00:42:34 +08:00
xuxingliang
dd7203aff7
gdb/mm: move memleak to standalone file
...
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-25 00:42:34 +08:00
Xu Xingliang
412644fcf2
gdb: optimize memory commands
...
Tested on a complex project, results are promising.
Command Time cost(s) Time saving(s) Peformance Boost
Before After
memleak 39.494172 22.366415 17.127757 1.8
memdump 41.872441 26.458386 15.414055 1.6
memdump -a 0x1234 28.116294 1.114119 27.002175 25.2
memdump --no-backtrace N/A 1.114119
memmap 7.973809 6.836468 1.137341 1.2
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2024-11-25 00:42:34 +08:00
xuxingliang
9f9cc7eceb
gdb/fs: use Value and Protocol for easy access and hinting
...
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-24 17:52:42 +08:00
xuxingliang
a59a28de5b
gdb/utils: enhance utils.Value
...
Added __format__ method to support format spec like {:>10} that gdb.Value doesn't support. For such case, gdb.Value is converted to python value firstly and then format natively.
Override all methods/attributes could return gdb.Value to return utils.Value instead.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-24 17:52:42 +08:00
xuxingliang
03a38fa633
gdb/fs: handle special inode of epoll, eventfd etc.
...
Those inodes have no name, handle them so the path can correctly show.
Add FILEP output so we can investigate furthure manually.
Change OFLAGS to hex output and increase word space.
E.g.
(gdb) fdinfo -p 120
PID: 120
FD FILEP OFLAGS POS PATH BACKTRACE
0 0x40807f08 0x3 0 /dev/console
1 0x40807f30 0x3 0 /dev/console
2 0x40807f58 0x3 0 /dev/console
3 0x40807f80 0x400 0 epoll
4 0x40807fa8 0x443 0 eventfd
5 0x40807fd0 0x403 0 sock
6 0x40807ff8 0x403 0 sock
7 0x40808020 0x403 0 sock
8 0x40892520 0x403 0 sock
9 0x40892548 0x403 0 sock
10 0x40892570 0x403 0 sock
11 0x40892598 0x403 0 sock
12 0x408925c0 0x403 0 sock
13 0x408925e8 0x403 0 sock
14 0x40892610 0x403 0 sock
15 0x40892638 0x403 0 sock
16 0x40942a20 0x403 0 sock
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-24 17:52:42 +08:00
xuxingliang
5b43a8cb9b
gdb/fs: use python iterator instead of C style callbacks
...
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-24 17:52:42 +08:00
yangao1
502377034a
nuttxgdb/fs.py:add diagnose api
...
Signed-off-by: yangao1 <yangao1@xiaomi.com>
2024-11-24 17:52:42 +08:00
dependabot[bot]
52ac99126d
Documentation: Bump docutils from 0.18.1 to 0.19
...
This PR bumps the version of docutils from 0.18.1 to 0.19, as requested by dependabot:
- https://github.com/apache/nuttx/pull/14910
2024-11-24 17:52:30 +08:00
xuxingliang
c013648617
tools/gdb: improve nxgcore speed
...
Let GDB to read from ELF for readonly data.
Disable this feature by nxgcore --no-trust-readonly.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-24 03:03:40 +08:00
xuxingliang
3a2d4584c7
gdb/utils: cache backtrace result for better performance
...
GDB is slow to look up symbols, cache the result to speed up commands like memdump etc.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-24 03:03:40 +08:00
xuxingliang
f5371e92f3
gdb/backtrace: optimize backtrace formatting
...
Use a class Bactrace to support convert address to backtrace, format to string, accessing element and iterate though them.
Adjust usage in fs and addr2line to make full use of it.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
2024-11-24 03:03:40 +08:00