In devices without storage media, you can export data to the
command line and then generate the corresponding gcda file
It can save the result output by calling __gcov_info_to_gcda
The usage is similar to:
https://gcc.gnu.org/onlinedocs/gcc/Freestanding-Environments.html#Profiling-and-Test-Coverage-in-Freestanding-Environments
Usage:
./tools/configure.sh qemu-armv7a:nsh
Modify the configuration
+CONFIG_COVERAGE_ALL=y
+CONFIG_COVERAGE_MINI=y
+CONFIG_SYSTEM_GCOV=y
Run:
qemu-system-arm -cpu cortex-a7 -nographic -smp 4 \
-machine virt,virtualization=off,gic-version=2 \
-net none -chardev stdio,id=con,mux=on -serial chardev:con \
-mon chardev=con,mode=readline -kernel ./nuttx/nuttx -semihosting -s | tee gcov.txt
./nuttx/tools/gcov_convert.py -i ./gcov.txt
./nuttx/tools/gcov.sh -t arm-none-eabi-gcov
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
go through each inode and print its structure info
in the form like below:
├── i_name: bin, i_ino: 51
│ i_parent: , i_peer: data, i_child: , i_crefs: 1, i_flags: 3
│ ......(other info)
│ ├── i_name: audio, i_ino: 5
│ │ i_parent: dev, i_peer: binder, i_child: mixer......
Signed-off-by: zhengyu9 <zhengyu9@xiaomi.com>
support mount command in gdb, print mount information
test result:
/bin type binfs
/data type hostfs
/etc type romfs
/proc type procfs
/resource type hostfs
/tmp type tmpfs
Signed-off-by: zhengyu9 <zhengyu9@xiaomi.com>
1. Remove Nx prefix for nuttx unique commands.
2. Add docstring for most of the commands in order to show help message.
3. Add 'init_once' method for Memmap command. The prerequisite is checked the moment it's used.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
Read the whole memory costs additional time. When the number memory nodes is
small, test on qemu shows that read memory directly is faster.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
1. Avoid to_bytes by using memoryview directly.
2. No need to call gdb to cast to char *.
3. Cache the memory data without invoke gdb in every iteration.
4. Do code cleanup.
memleak speed improved from 261.93 seconds to 29.9 seconds for x4b
usecase.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
1. add get macro related inteface, for now we have't fully implemented
the way to expand and evalute macros at runtime. We just deal with some macros that can be expand and evaluate into essential constants that will be needed later.
2. rearrange utility functions in a different order
3. reimplment the get register API to make it more commonly used
Signed-off-by: Gao Jiawei <gaojiawei@xiaomi.com>
Python Exception <class 'gdb.error'>: Attempt to assign to an unmodifiable value.
Python Exception <class 'gdb.error'>: Error occurred in Python: Attempt to assign to an unmodifiable value.
Error occurred in Python: Error occurred in Python: Attempt to assign to an unmodifiable value.
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Split nucleo-f4x1re into nucleo-f401re and nucleo-f411re.
These are separate boards and should be in separate directories as it's
done for all other nucleo boards in NuttX
reason:
When entering an exception or interrupt, there are two sets of registers:
one is the "running regs", which we need to save,
and the other is the "ready to running regs", which we may soon use.
For consistency in logic, we can always store the "running regs" in the regs field of g_running_tasks,
otherwise it may lead to errors in the storage location of the "running regs."
When we need to access the "running regs," we should uniformly retrieve them from the regs field of g_running_tasks.
As the next step, we will rename the set_current_regs/up_current_regs functions
for each architecture to more appropriate names, solely for the purpose of identifying interrupts.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
enable various types of common applications and libraries, and enable CMake CI checks.
To avoid regression issues in the build system
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
added shell script darwin_arm64.sh for macOS Apple Silicon
updated toolchains for macOS on Apple Silicon
- arm64
- aarch64
- xpack-riscv
- xtensa-esp32
Improved
1. The pre-installed "picotool" should not depend on `PICO_SDK_PATH`
2. Perhaps we should compile "picotool" from `PICO_SDK_PATH` if it was not found in $PATH
Tests
1. The "picotool" is pre-installed or built from `PICO_SDK_PATH`
LD: nuttx
Generating: nuttx.uf2
Done.
2. `PICO_SDK_PATH` is specified but "picotool" is not installed
LD: nuttx
Building: picotool
Generating: nuttx.uf2
Done.
3. Neither "picotool" nor `PICO_SDK_PATH` are installed/specified
LD: nuttx
PICO_SDK_PATH/picotool must be specified/installed for flash boot
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
1. bin and kbin folders are dynamically generated
2. Context comes before depend, so the bin and kbin folders are created in the context construction phase. When the depend process comes, each library is downloaded, and a relative bin/xxx and kbin/xxx directory is created for each library to place files. This is to prevent duplicate file names.
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
1. Calling CLEAN on these folders did not have any effect
2. bin,kbin will be created during the context construction process
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
fixed this error for msys2
====================================================================================
Configuration/Tool: nucleo-l152re/nsh,CONFIG_ARM_TOOLCHAIN_GNU_EABI
2024-11-05 06:12:26
------------------------------------------------------------------------------------
Cleaning...
Configuring...
make[3]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
make[3]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
make[3]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
make[3]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
make[3]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
make[3]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
make[3]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
make[3]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
make[3]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
use the dynamic library .so of the binding compilation environment,
and then modify the dynamic loader of elf at runtime to run sim elf across system versions
1.add post-build for sim build
2.collect dynamic .so and dynamic interpreter
3.add execution script for the entire package sim elf
change text-segment to 0x50000000
because patchelf will modify the .dynamic section in elf,
the upward alignment of elf will be less than 0x3fffffff,
which will cause asan shadow memory overlap error
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
1. Since the implementation of gcov has changed since clang17, versions before clang17 need to use the libunwind.a file
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
1. CONFIG_ARCH_COVERAGE has been replaced by CONFIG_SCHED_GCOV
2. Delete the SIM-specific GCOV_ALL configuration and change it to a universal configuration for all architectures
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
tmpfile.rename(args.output)
^^^^^^^^^^^^^^
AttributeError: '_io.BufferedRandom' object has no attribute 'rename'. Did you mean: 'name'?
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
1. enable CONFIG_BUILTIN_COMPILER_RT to built libclang_rt.builtins-xxx.a and no longer use the compiler's built-in
2. Modify clang version acquisition to get two decimal points
3. It has been ported to support four architectures: ARM, ARM64, RISCV, and x86_64, among which ARM has been validated
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
To skip the style issue:
arch/arm/src/phy62xx/uart.c:59:15: error: Mixed case identifier found
arch/arm/src/phy62xx/uart.c:64:2: error: Mixed case identifier found
arch/arm/src/phy62xx/uart.c:65:2: error: Mixed case identifier found
arch/arm/src/phy62xx/uart.c:70:2: error: Mixed case identifier found
arch/arm/src/phy62xx/uart.c:71:2: error: Mixed case identifier found
arch/arm/src/phy62xx/uart.c:75:2: error: Mixed case identifier found
arch/arm/src/phy62xx/uart.c:77:7: error: Mixed case identifier found
Signed-off-by: chao an <anchao@lixiang.com>
This PR splits the CI Build Job sim-01 and adds sim-03:
Before the Split: Simulator Jobs take up to 1.5 hours to complete
- sim-01 (1 hour 31 mins): adb, citest, lvgl, matter
- sim-02 (28 mins): posix_test, sqlite
After the Split: Simulator Jobs will complete within 1 hour
- sim-01 (58 mins): adb, citest
- sim-02 (35 mins): lvgl, matter
- sim-03 (28 mins): posix_test, sqlite
This will help us comply with the ASF Policy for GitHub Actions, as explained here: https://github.com/apache/nuttx/issues/14376
The error was introduced by #14393, which was intended to fix this
line for MacOS. This commit makes this line dependent on the host
OS to avoid any compilation errors.
nucleo-144 combines 3 different ST boards. This approach is inconsistent with
the support for the rest of the nucleo boards, where each board is in separate folders.
Also nucleo-144 is no longer reserved for STM32F7 chips but other families also use this format.
After this commit nucleo-144 is divided into 3 boards:
- nucleo-f746zg
- nucleo-f767zi
- nucleo-f722ze
This PR creates the new CI Build Jobs `arm64-01` and `x86_64-01`. The new jobs will split and offload the Arm64 and x86_64 Build Targets from `other`. This will reduce our usage of GitHub Runners, to comply with the ASF Policy for GitHub Actions. (Recently we see more PRs for Arm64 and x86_64)
Before the Split: Simple PRs (One Arch and/or One Board) for Arm64 and x86_64 require almost 1 hour for CI Build
- `other` (57 mins): AVR, SPARC, x86, PinePhone, QEMU Arm64, QEMU x86_64
After the Split: Simple PRs for Arm64 and x86_64 will complete under 30 mins
- `other` (24 mins): AVR, SPARC, x86
- `arm64-01` (29 mins): PinePhone, QEMU Arm64
- `x86_64-01` (9 mins): QEMU x86_64
To skip more unnecessary builds: Our Build Rules `arch.yml` shall ignore the label "Area: Documentation", so that a Simple PR + Docs is still a Simple PR. Previously we experienced longer CI Build Times, just because we added docs to our Simple PR. (Now our PR shall be built exactly like a Simple PR)
The updated CI code is explained here: https://github.com/apache/nuttx/issues/13775
Renamed savedefconfig -> refreshsilent name more consistent with the refresh stage for cmake on github.
Added new savedefconfig to fix
https://github.com/apache/nuttx/issues/14281
Flag --diff will output the changes content.
Flag --check-only will return exit code. It can be used together with --diff.
Run isort again to format the code in place, to make the behavior same as before.
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
Config multi line output to mode 3, so isort and black can agree with
each other:
```
3 - Vertical Hanging Indent
from third_party import (
lib1,
lib2,
lib3,
lib4,
)
```
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
Use showsize.sh to show custom elf file top10 size
tools/showsize.sh vela_ap.elf
tools/showsize.sh vela_audio.elf
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
When using include command in defconfig, it is necessary to support overwriting the configuration in other files
kconfig-conf only prints warnings, but does not return errors
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
When some coverage files cannot be parsed correctly,
skip the current error file and continue to generate coverage report
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
To speed up the CI Workflow, this PR splits the CI Build Jobs for RISC-V into smaller jobs. Each job will now complete within 1 hour.
Before the PR: There are 2 jobs for RISC-V, each requiring more than 1.5 hours
- `risc-v-01` (1 hour 42 mins): BL602, Ox64, ESP32-C3 / C6 / H2
- `risc-v-02` (1 hour 41 mins): K230, Icicle, QEMU, RV32M1-Vega
After the PR: The build is spread across 6 jobs for RISC-V, each job completes within 1 hour
- `risc-v-01` (19 mins): BL602, Ox64
- `risc-v-02` (44 mins): ESP32-C3
- `risc-v-03` (45 mins): ESP32-C6, ESP32-H2
- `risc-v-04` (31 mins): K230, Icicle
- `risc-v-05` (41 mins): QEMU CITest
- `risc-v-06` (38 mins): Rest of QEMU, RV32M1-Vega
Following the same convention as the Arm32 Build Jobs, the above jobs are sorted by Target Name. Performance of the RISC-V Build Jobs is discussed in https://github.com/apache/nuttx/issues/13775
Check g_altpath. If only the CURRENT path is included,
the obj target use its own full path, otherwise just use the filename.
add default value current path for obj-path.
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
patches ending with cmake should be checked.
Currently, any non-cmake files containing cmake keywords will be checked.
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
CI Build Job `arm-05` (runtime 2 hours) has become the Performance Bottleneck for CI Workflow. That's because `arm-05` builds too many targets for nRF, RP2040, SAM 3, SAM A and SAM D. This PR splits `arm-05` into multiple smaller jobs, to reduce the CI Build Duration.
Before the PR: `arm-05` is overloaded, build requires 2 hours
- `arm-05` (2 hours): nRF, RP2040, SAM 3, SAM A, SAM D
- `arm-06` (56 mins): STM32 [a-m]*
After the PR: `arm-05` is offloaded (to `arm-06` and `arm-07`), completes within 1 hour
- `arm-05` (47 mins): nRF
- `arm-06` (1 hour): Reserve for RP2040 exclusively
- `arm-07` (1 hour 15 mins): SAM 3, SAM A, SAM D, STM32 [a-m]*
Build Jobs are sorted by Target Name. So we cascade the changes and rename the Build Jobs: `arm-07` becomes `arm-08`, `arm-08` becomes `arm-09` etc. Then `arm-13` becomes a new job `arm-14`. (Which we added to `build.yml`)
Performance of `arm-05` is discussed in https://github.com/apache/nuttx/issues/13775 and https://github.com/apache/nuttx/issues/12773
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>
Add the new symbol `NativeSymbol` to the white list,
and update the comments about the symbols that are
from WAMR project.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This script seems to assume GNU grep, which is not commonly
available as "grep" on some platforms. For examples, it's
more common to have it named "ggrep" on BSD-based systems
including macOS.
Ideally, I suppose we should avoid GNU dependencies like this
in general. But I'm not motivated enough to rewrite this script
in a portable way today.
cf. https://www.gnu.org/software/grep/manual/grep.html#grep-Programs-1
Switch wget to cURL tool for:
arm_gcc_toolchain()
arm64_gcc_toolchain()
gperf()
riscv_gcc_toolchain()
sparc_gcc_toolchain()
xtensa_esp32_gcc_toolchain()
wasi_sdk()
Used git clone --depth 1 a shallow clone with a history truncated to reduce the clone size for:
kconfig_frontends()
added ninja installation
Switch wget to cURL tool for:
arm_gcc_toolchain()
arm64_gcc_toolchain()
riscv_gcc_toolchain()
sparc_gcc_toolchain()
xtensa_esp32_gcc_toolchain()
xtensa_esp32s2_gcc_toolchain()
xtensa_esp32s3_gcc_toolchain()
wasi_sdk()
Used git clone --depth 1 a shallow clone with a history truncated to reduce the clone size for:
kconfig_frontends()
Bumps esptool from 4.7.0 to 4.8.0.
Switch wget to cURL tool
arm_gcc_toolchain()
arm64_gcc_toolchain()
riscv_gcc_toolchain()
sparc_gcc_toolchain()
xtensa_esp32_gcc_toolchain()
xtensa_esp32s2_gcc_toolchain()
xtensa_esp32s3_gcc_toolchain()
Create a shallow clone with a history truncated of
gen_romfs()
kconfig_frontends()
Simple tool to generate the NuttX release notes
tested on Python-3.8.9
Requirements
pip install PyGithub
pip install PyInquirer
pip install tqdm
The following arguments are required for generating a release: release_version, gh_token
Inspired by https://github.com/btashton/nxutils
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
The script can decode the backtrace dump, considering the syntax
of the backtrace format (properly handle the dump when SMP is
enabled, for instance) based on chip name or the toolchains's
addr2line tool.
1. Similar to asan, supports single byte out of bounds detection
2. Fix the script to address the issue of not supporting the big end
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
Since the size of the shadow area will change during the script merging of global variables, it will lead to unpredictable number of links. After fixing, only three links are required.
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
1. Modify the Kasan global variable script to support array storage of region addresses
2. Due to the lack of formatting in the previous attempt, a formatting script was created
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
The simple improvement is designed to speed up compilation and reduce download errors on github and local.
Added a folder nxtmpdir for storing third-party packages
nuttxworkspace
|
|- nuttx
|- apps
|- nxtmpdir
tools/Unix.mk:
added export NXTMPDIR := $(WSDIR)/nxtmpdir
tools/configure.sh:
added option -S creates the nxtmpdir folder for third-party packages.
tools/Config.mk:
added macro
CLONE - Git clone repository.
CHECK_COMMITSHA - Check if the branch contains the commit SHA-1.
tools/testbuild.sh:
added option -S
For now I added in the folder this package
ESP_HAL_3RDPARTY_URL = https://github.com/espressif/esp-hal-3rdparty.git
ARCH
arch/xtensa/src/esp32/Make.defs
arch/xtensa/src/esp32s2/Make.defs
arch/xtensa/src/esp32s3/Make.defs
arch/risc-v/src/common/espressif/Make.defs
arch/risc-v/src/esp32c3-legacy/Make.defs
but you can also add other packages (maybe also of apps)
maintains the same semantics as Kernel’s module build
and compatible with Kconfiglib implementation.
The problem of kconfiglib not being able to use tri-states is this:
linux is here torvalds/linux@6dd85ff
The module option is extracted from one of the triate three states into a MODULE keyword.
Kconfiglib supports the default implementation of module to be MODULE for compatibility with the linux kernel, and triate degenerates into bool two states
Refer to this code: 061e71f7d7/kconfiglib.py (L4274-L4284)
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
Revert "Parallelize depend file generation"
This reverts commit d5b6ec450f.
parallel depend ddc does not significantly speed up compilation,
intermediately generated .ddc files can cause problems if compilation is interrupted unexpectedly
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Since the introduction of the rp2350, the pico-sdk project has been
re-arranged and elf2uf2 has been merged in to a new 'picotool' binary
which is supplied and installed separately.
Normally ccache places the temporary files in `~/.ccache`, when invoking the container with
`-u <uid>:<gid>`
as e.g. Jenkins does, this might result in a invalid/unknown home folder.
Thus ccache tries to write to `/.ccache` which doesn't exist and the user doesn't have any permissions.
Explicitly set `CCACHE_DIR` to a folder with appropriate permissions.