Skip to content

Commit c9c0e9d

Browse files
GUIDINGLIopenvela-robot
authored andcommitted
cpuload: add cpulad test case
Change-Id: I8ed08bebffb0f44078a4a2b667a87313f37e618c
1 parent 8a05548 commit c9c0e9d

File tree

354 files changed

+22573
-24893
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

354 files changed

+22573
-24893
lines changed

.github/workflows/build.yml

+36-19
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ on:
2020
- 'releases/*'
2121
tags:
2222

23+
permissions:
24+
contents: read
25+
2326
concurrency:
2427
group: build-${{ github.event.pull_request.number || github.ref }}
2528
cancel-in-progress: true
@@ -59,13 +62,13 @@ jobs:
5962
# Determine the repo and leave that unset to use the normal checkout behavior
6063
# of using the merge commit instead of HEAD
6164
case $GITHUB_REPOSITORY in
62-
"apache/incubator-nuttx")
65+
"apache/nuttx")
6366
# OS
6467
echo "Triggered by change in OS"
6568
APPS_REF=$REF_NAME
6669
;;
6770
68-
"apache/incubator-nuttx-apps" )
71+
"apache/nuttx-apps" )
6972
# APPS
7073
OS_REF=$REF_NAME
7174
echo "Triggered by change in APPS"
@@ -83,7 +86,7 @@ jobs:
8386
- name: Checkout nuttx repo
8487
uses: actions/checkout@v3
8588
with:
86-
repository: apache/incubator-nuttx
89+
repository: apache/nuttx
8790
ref: ${{ steps.gittargets.outputs.os_ref }}
8891
path: sources/nuttx
8992
fetch-depth: 1
@@ -93,13 +96,14 @@ jobs:
9396
- name: Checkout apps repo
9497
uses: actions/checkout@v3
9598
with:
96-
repository: apache/incubator-nuttx-apps
99+
repository: apache/nuttx-apps
97100
ref: ${{ steps.gittargets.outputs.apps_ref }}
98101
path: sources/apps
99102
fetch-depth: 1
100103

101104
- name: Tar sources
102105
run: tar zcf sources.tar.gz sources
106+
103107
- name: Archive Source Bundle
104108
uses: actions/upload-artifact@v3
105109
with:
@@ -114,43 +118,50 @@ jobs:
114118

115119
strategy:
116120
matrix:
117-
boards: [arm-01, arm-02, arm-03, arm-04, arm-05, arm-06, arm-07, arm-08, arm-09, arm-10, arm-11, arm-12, arm-13, other, risc-v, sim-01, sim-02, xtensa]
121+
boards: [arm-01, arm-02, arm-03, arm-04, arm-05, arm-06, arm-07, arm-08, arm-09, arm-10, arm-11, arm-12, arm-13, other, risc-v, sim-01, sim-02, xtensa, codechecker]
118122

119123
steps:
120124
- name: Download Source Artifact
121125
uses: actions/download-artifact@v3
122126
with:
123127
name: source-bundle
124128
path: .
129+
125130
- name: Extract sources
126131
run: tar zxf sources.tar.gz
132+
127133
- name: Docker Login
128-
uses: azure/docker-login@v1
134+
uses: docker/login-action@v2
129135
with:
130-
login-server: ghcr.io
131-
username: ${GITHUB_ACTOR}
136+
registry: ghcr.io
137+
username: ${{ github.actor }}
132138
password: ${{ secrets.GITHUB_TOKEN }}
133139

134140
- name: Docker Pull
135-
run: docker pull ghcr.io/apache/incubator-nuttx/apache-nuttx-ci-linux
141+
run: docker pull ghcr.io/apache/nuttx/apache-nuttx-ci-linux
142+
136143
- name: Export NuttX Repo SHA
137144
run: echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV
145+
138146
- name: Run builds
139147
uses: ./sources/nuttx/.github/actions/ci-container
140148
env:
141149
BLOBDIR: /tools/blobs
142150
with:
143151
run: |
144152
echo "::add-matcher::sources/nuttx/.github/gcc.json"
145-
export CCACHE_DIR=`pwd`/ccache
146-
mkdir $CCACHE_DIR
147153
export ARTIFACTDIR=`pwd`/buildartifacts
148154
git config --global --add safe.directory /github/workspace/sources/nuttx
149155
git config --global --add safe.directory /github/workspace/sources/apps
150156
cd sources/nuttx/tools/ci
151-
./cibuild.sh -A -c testlist/${{matrix.boards}}.dat
152-
ccache -s
157+
if [ "X${{matrix.boards}}" = "Xcodechecker" ]; then
158+
./cibuild.sh -c -A -R --codechecker testlist/${{matrix.boards}}.dat
159+
else
160+
./cibuild.sh -c -A -R testlist/${{matrix.boards}}.dat
161+
fi
162+
153163
- uses: actions/upload-artifact@v3
164+
if: ${{ always() }}
154165
with:
155166
name: linux-builds
156167
path: buildartifacts/
@@ -159,7 +170,7 @@ jobs:
159170
macOS:
160171
permissions:
161172
contents: none
162-
runs-on: macos-10.15
173+
runs-on: macos-12
163174
needs: Fetch-Source
164175
strategy:
165176
matrix:
@@ -170,28 +181,34 @@ jobs:
170181
with:
171182
name: source-bundle
172183
path: .
184+
173185
- name: Extract sources
174186
run: tar zxf sources.tar.gz
187+
175188
- name: Restore Tools Cache
176189
id: cache-tools
177190
uses: actions/cache@v3
178191
env:
179192
cache-name: ${{ runner.os }}-cache-tools
180193
with:
181-
path: prebuilt
194+
path: ./sources/tools
182195
key: ${{ runner.os }}-tools-${{ hashFiles('./sources/nuttx/tools/ci/cibuild.sh') }}
183196

184197
- name: Export NuttX Repo SHA
185198
run: echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV
199+
200+
# Released version of Cython has issues with Python 11. Set runner to use Python 3.10
201+
# https://github.com/cython/cython/issues/4500
202+
- uses: actions/setup-python@v4
203+
with:
204+
python-version: '3.10'
186205
- name: Run Builds
187206
run: |
188207
echo "::add-matcher::sources/nuttx/.github/gcc.json"
189-
export CCACHE_DIR=`pwd`/ccache
190-
mkdir $CCACHE_DIR
191208
export ARTIFACTDIR=`pwd`/buildartifacts
192209
cd sources/nuttx/tools/ci
193-
./cibuild.sh -i -A -c testlist/${{matrix.boards}}.dat
194-
ccache -s
210+
./cibuild.sh -i -c -A -R testlist/${{matrix.boards}}.dat
211+
195212
- uses: actions/upload-artifact@v3
196213
with:
197214
name: macos-builds

.github/workflows/check.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@ permissions:
2424

2525
jobs:
2626
check:
27-
runs-on: ubuntu-18.04
27+
runs-on: ubuntu-latest
2828

2929
steps:
3030
- name: Checkout nuttx repo
3131
uses: actions/checkout@v3
3232
with:
33-
repository: apache/incubator-nuttx
33+
repository: apache/nuttx
3434
path: nuttx
3535
fetch-depth: 0
3636

3737
- name: Checkout apps repo
3838
uses: actions/checkout@v3
3939
with:
40-
repository: apache/incubator-nuttx-apps
40+
repository: apache/nuttx-apps
4141
path: apps
4242
fetch-depth: 0
4343

.gitignore

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,16 @@
1616
*.src
1717
*.swp
1818
*.sym
19+
*.su
1920
*~
20-
.built
2121
.context
2222
.depend
2323
.kconfig
24-
/*.lock
2524
/bin
2625
/boot_romfsimg.h
2726
/external
2827
/Kconfig
2928
/romfs.img
30-
/staging
3129
/symtab_apps.c
3230
cscope.out
3331
Make.dep

Application.mk

+14-16
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@ else
4242
CWD = $(CURDIR)
4343
endif
4444

45-
# Add the static application library to the linked libraries. Don't do this
46-
# with CONFIG_BUILD_KERNEL as there is no static app library
47-
ifneq ($(CONFIG_BUILD_KERNEL),y)
48-
LDLIBS += $(call CONVERT_PATH,$(BIN))
49-
endif
45+
# Add the static application library to the linked libraries.
46+
47+
LDLIBS += $(call CONVERT_PATH,$(BIN))
5048

5149
# When building a module, link with the compiler runtime.
5250
# This should be linked after libapps. Consider that mbedtls in libapps
@@ -64,7 +62,8 @@ ifeq ($(BUILD_MODULE),y)
6462
endif
6563

6664
SUFFIX = $(subst $(DELIM),.,$(CWD))
67-
PROGNAME := $(shell echo $(PROGNAME))
65+
66+
PROGNAME := $(subst ",,$(PROGNAME))
6867

6968
# Object files
7069

@@ -91,7 +90,7 @@ SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) $(MAINSRC)
9190
OBJS = $(RAOBJS) $(CAOBJS) $(COBJS) $(CXXOBJS) $(RUSTOBJS) $(ZIGOBJS)
9291

9392
ifneq ($(BUILD_MODULE),y)
94-
OBJS += $(MAINCOBJ) $(MAINCXXOBJ) $(MAINRUSTOBJ) $(MAINZIGOBJS)
93+
OBJS += $(MAINCOBJ) $(MAINCXXOBJ) $(MAINRUSTOBJ) $(MAINZIGOBJ)
9594
endif
9695

9796
DEPPATH += --dep-path .
@@ -101,7 +100,7 @@ VPATH += :.
101100

102101
# Targets follow
103102

104-
all:: .built
103+
all:: $(OBJS)
105104
.PHONY: clean depend distclean
106105
.PRECIOUS: $(BIN)
107106

@@ -126,8 +125,9 @@ define ELFCOMPILERUST
126125
endef
127126

128127
define ELFCOMPILEZIG
129-
@echo "ZIG: $1"
130-
$(Q) $(ZIG) build-obj $(ZIGELFFLAGS) $($(strip $1)_ZIGELFFLAGS) $1 --name $2
128+
@echo "ZIG: $1"
129+
# Remove target suffix here since zig compiler add .o automatically
130+
$(Q) $(ZIG) build-obj $(ZIGELFFLAGS) $($(strip $1)_ZIGELFFLAGS) --name $(basename $2) $1
131131
endef
132132

133133
define ELFLD
@@ -159,9 +159,8 @@ $(ZIGOBJS): %$(ZIGEXT)$(SUFFIX)$(OBJEXT): %$(ZIGEXT)
159159
$(if $(and $(CONFIG_BUILD_LOADABLE), $(CELFFLAGS)), \
160160
$(call ELFCOMPILEZIG, $<, $@), $(call COMPILEZIG, $<, $@))
161161

162-
.built: $(OBJS)
163-
$(call ARLOCK, $(call CONVERT_PATH,$(BIN)), $^)
164-
$(Q) touch $@
162+
archive:
163+
$(call ARCHIVE_ADD, $(call CONVERT_PATH,$(BIN)), $(OBJS))
165164

166165
ifeq ($(BUILD_MODULE),y)
167166

@@ -226,7 +225,7 @@ ifneq ($(PROGNAME),)
226225
REGLIST := $(addprefix $(BUILTIN_REGISTRY)$(DELIM),$(addsuffix .bdat,$(PROGNAME)))
227226
APPLIST := $(PROGNAME)
228227

229-
$(REGLIST): $(DEPCONFIG) $(firstword $(MAKEFILE_LIST))
228+
$(REGLIST): $(DEPCONFIG) Makefile
230229
$(call REGISTER,$(firstword $(APPLIST)),$(firstword $(PRIORITY)),$(firstword $(STACKSIZE)),$(if $(BUILD_MODULE),,$(firstword $(APPLIST))_main))
231230
$(eval APPLIST=$(filter-out $(firstword $(APPLIST)),$(APPLIST)))
232231
$(if $(filter-out $(firstword $(PRIORITY)),$(PRIORITY)),$(eval PRIORITY=$(filter-out $(firstword $(PRIORITY)),$(PRIORITY))))
@@ -237,7 +236,7 @@ else
237236
register::
238237
endif
239238

240-
.depend: $(firstword $(MAKEFILE_LIST)) $(wildcard $(foreach SRC, $(SRCS), $(addsuffix /$(SRC), $(subst :, ,$(VPATH))))) $(DEPCONFIG)
239+
.depend: Makefile $(wildcard $(foreach SRC, $(SRCS), $(addsuffix /$(SRC), $(subst :, ,$(VPATH))))) $(DEPCONFIG)
241240
$(Q) $(MKDEP) $(DEPPATH) --obj-suffix .c$(SUFFIX)$(OBJEXT) "$(CC)" -- $(CFLAGS) -- $(filter %.c,$^) >Make.dep
242241
$(Q) $(MKDEP) $(DEPPATH) --obj-suffix .S$(SUFFIX)$(OBJEXT) "$(CC)" -- $(CFLAGS) -- $(filter %.S,$^) >>Make.dep
243242
$(Q) $(MKDEP) $(DEPPATH) --obj-suffix $(CXXEXT)$(SUFFIX)$(OBJEXT) "$(CXX)" -- $(CXXFLAGS) -- $(filter %$(CXXEXT),$^) >>Make.dep
@@ -246,7 +245,6 @@ endif
246245
depend:: .depend
247246

248247
clean::
249-
$(call DELFILE, .built)
250248
$(call CLEAN)
251249

252250
distclean:: clean

DISCLAIMER

-6
This file was deleted.

Directory.mk

+8-5
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@ include $(APPDIR)/Make.defs
2222

2323
# Sub-directories that have been built or configured.
2424

25-
SUBDIRS := $(dir $(wildcard *$(DELIM)Makefile))
26-
CONFIGSUBDIRS := $(filter-out $(dir $(wildcard *$(DELIM)Kconfig)),$(SUBDIRS))
27-
CLEANSUBDIRS := $(dir $(wildcard *$(DELIM).built))
28-
CLEANSUBDIRS += $(dir $(wildcard *$(DELIM).depend))
29-
CLEANSUBDIRS += $(dir $(wildcard *$(DELIM).kconfig))
25+
SUBDIRS := $(dir $(wildcard */Makefile))
26+
CONFIGSUBDIRS := $(filter-out $(dir $(wildcard */Kconfig)),$(SUBDIRS))
27+
CLEANSUBDIRS += $(dir $(wildcard */.depend))
28+
CLEANSUBDIRS += $(dir $(wildcard */.kconfig))
3029
CLEANSUBDIRS := $(sort $(CLEANSUBDIRS))
30+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
31+
CONFIGSUBDIRS := $(subst /,\,$(CONFIGSUBDIRS))
32+
CLEANSUBDIRS := $(subst /,\,$(CLEANSUBDIRS))
33+
endif
3134

3235
all: nothing
3336

Make.defs

+21-20
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,22 @@
2121
TOPDIR ?= $(APPDIR)/import
2222
include $(TOPDIR)/Make.defs
2323

24-
# The GNU make CURDIR will always be a POSIX-like path with forward slashes
25-
# as path segment separators. This is fine for the above inclusions but
26-
# will cause problems later for the native build. If we know that this is
27-
# a native build, then we need to fix up the APPDIR path for subsequent
28-
# use
29-
30-
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
31-
APPDIR := ${shell echo %CD%}
32-
endif
33-
3424
# Application Directories
3525

3626
# BUILDIRS is the list of top-level directories containing Make.defs files
3727
# CLEANDIRS is the list of all top-level directories containing Makefiles.
3828
# It is used only for cleaning.
3929

40-
BUILDIRS := $(dir $(wildcard $(APPDIR)$(DELIM)*$(DELIM)Make.defs))
41-
BUILDIRS := $(filter-out $(APPDIR)$(DELIM)import$(DELIM),$(BUILDIRS))
42-
CONFIGDIRS := $(filter-out $(APPDIR)$(DELIM)builtin$(DELIM),$(BUILDIRS))
43-
CONFIGDIRS := $(filter-out $(dir $(wildcard $(APPDIR)$(DELIM)*$(DELIM)Kconfig)),$(CONFIGDIRS))
44-
CLEANDIRS := $(dir $(wildcard $(APPDIR)$(DELIM)*$(DELIM)Makefile))
30+
BUILDIRS := $(dir $(wildcard $(APPDIR)/*/Make.defs))
31+
BUILDIRS := $(filter-out $(APPDIR)/import/,$(BUILDIRS))
32+
CONFIGDIRS := $(filter-out $(APPDIR)/builtin/,$(BUILDIRS))
33+
CONFIGDIRS := $(filter-out $(dir $(wildcard $(APPDIR)/*/Kconfig)),$(CONFIGDIRS))
34+
CLEANDIRS := $(dir $(wildcard $(APPDIR)/*/Makefile))
35+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
36+
BUILDIRS := $(subst /,\,$(BUILDIRS))
37+
CONFIGDIRS := $(subst /,\,$(CONFIGDIRS))
38+
CLEANDIRS := $(subst /,\,$(CLEANDIRS))
39+
endif
4540

4641
# CONFIGURED_APPS is the application directories that should be built in
4742
# the current configuration.
@@ -85,18 +80,24 @@ endif
8580
BUILTIN_REGISTRY = $(APPDIR)$(DELIM)builtin$(DELIM)registry
8681
DEPCONFIG = $(TOPDIR)$(DELIM).config
8782

83+
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
8884
define REGISTER
8985
$(Q) echo Register: $1
90-
$(Q) echo { \"$1\", $2, $3, $4 }, > "$(BUILTIN_REGISTRY)$(DELIM)$1.bdat"
86+
$(Q) echo { "$(subst ",,$(1))", $2, $3, $(subst ",,$(4)) }, > "$(BUILTIN_REGISTRY)$(DELIM)$1.bdat"
87+
$(Q) echo int $(subst ",,$(4))(int argc, char *argv[]); > "$(BUILTIN_REGISTRY)$(DELIM)$1.pdat"
88+
89+
$(Q) touch $(BUILTIN_REGISTRY)$(DELIM).updated"
90+
endef
91+
else
92+
define REGISTER
93+
$(Q) echo "Register: $1"
94+
$(Q) echo "{ \"$1\", $2, $3, $4 }," > "$(BUILTIN_REGISTRY)$(DELIM)$1.bdat"
9195
$(Q) if [ ! -z $4 ]; then \
9296
echo "int $4(int argc, char *argv[]);" > "$(BUILTIN_REGISTRY)$(DELIM)$1.pdat"; \
9397
fi;
9498
$(Q) touch "$(BUILTIN_REGISTRY)$(DELIM).updated"
9599
endef
96-
97-
define ARLOCK
98-
$(Q) flock $1.lock $(call ARCHIVE, $1, $(2))
99-
endef
100+
endif
100101

101102
# Standard include path
102103

0 commit comments

Comments
 (0)