Skip to content

Commit

Permalink
cpuload: add cpulad test case
Browse files Browse the repository at this point in the history
Change-Id: I8ed08bebffb0f44078a4a2b667a87313f37e618c
  • Loading branch information
GUIDINGLI authored and openvela-robot committed Nov 20, 2024
1 parent 8a05548 commit c9c0e9d
Show file tree
Hide file tree
Showing 354 changed files with 22,573 additions and 24,893 deletions.
55 changes: 36 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ on:
- 'releases/*'
tags:

permissions:
contents: read

concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
Expand Down Expand Up @@ -59,13 +62,13 @@ jobs:
# Determine the repo and leave that unset to use the normal checkout behavior
# of using the merge commit instead of HEAD
case $GITHUB_REPOSITORY in
"apache/incubator-nuttx")
"apache/nuttx")
# OS
echo "Triggered by change in OS"
APPS_REF=$REF_NAME
;;
"apache/incubator-nuttx-apps" )
"apache/nuttx-apps" )
# APPS
OS_REF=$REF_NAME
echo "Triggered by change in APPS"
Expand All @@ -83,7 +86,7 @@ jobs:
- name: Checkout nuttx repo
uses: actions/checkout@v3
with:
repository: apache/incubator-nuttx
repository: apache/nuttx
ref: ${{ steps.gittargets.outputs.os_ref }}
path: sources/nuttx
fetch-depth: 1
Expand All @@ -93,13 +96,14 @@ jobs:
- name: Checkout apps repo
uses: actions/checkout@v3
with:
repository: apache/incubator-nuttx-apps
repository: apache/nuttx-apps
ref: ${{ steps.gittargets.outputs.apps_ref }}
path: sources/apps
fetch-depth: 1

- name: Tar sources
run: tar zcf sources.tar.gz sources

- name: Archive Source Bundle
uses: actions/upload-artifact@v3
with:
Expand All @@ -114,43 +118,50 @@ jobs:

strategy:
matrix:
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]
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]

steps:
- name: Download Source Artifact
uses: actions/download-artifact@v3
with:
name: source-bundle
path: .

- name: Extract sources
run: tar zxf sources.tar.gz

- name: Docker Login
uses: azure/docker-login@v1
uses: docker/login-action@v2
with:
login-server: ghcr.io
username: ${GITHUB_ACTOR}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker Pull
run: docker pull ghcr.io/apache/incubator-nuttx/apache-nuttx-ci-linux
run: docker pull ghcr.io/apache/nuttx/apache-nuttx-ci-linux

- name: Export NuttX Repo SHA
run: echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV

- name: Run builds
uses: ./sources/nuttx/.github/actions/ci-container
env:
BLOBDIR: /tools/blobs
with:
run: |
echo "::add-matcher::sources/nuttx/.github/gcc.json"
export CCACHE_DIR=`pwd`/ccache
mkdir $CCACHE_DIR
export ARTIFACTDIR=`pwd`/buildartifacts
git config --global --add safe.directory /github/workspace/sources/nuttx
git config --global --add safe.directory /github/workspace/sources/apps
cd sources/nuttx/tools/ci
./cibuild.sh -A -c testlist/${{matrix.boards}}.dat
ccache -s
if [ "X${{matrix.boards}}" = "Xcodechecker" ]; then
./cibuild.sh -c -A -R --codechecker testlist/${{matrix.boards}}.dat
else
./cibuild.sh -c -A -R testlist/${{matrix.boards}}.dat
fi
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: linux-builds
path: buildartifacts/
Expand All @@ -159,7 +170,7 @@ jobs:
macOS:
permissions:
contents: none
runs-on: macos-10.15
runs-on: macos-12
needs: Fetch-Source
strategy:
matrix:
Expand All @@ -170,28 +181,34 @@ jobs:
with:
name: source-bundle
path: .

- name: Extract sources
run: tar zxf sources.tar.gz

- name: Restore Tools Cache
id: cache-tools
uses: actions/cache@v3
env:
cache-name: ${{ runner.os }}-cache-tools
with:
path: prebuilt
path: ./sources/tools
key: ${{ runner.os }}-tools-${{ hashFiles('./sources/nuttx/tools/ci/cibuild.sh') }}

- name: Export NuttX Repo SHA
run: echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV

# Released version of Cython has issues with Python 11. Set runner to use Python 3.10
# https://github.com/cython/cython/issues/4500
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Run Builds
run: |
echo "::add-matcher::sources/nuttx/.github/gcc.json"
export CCACHE_DIR=`pwd`/ccache
mkdir $CCACHE_DIR
export ARTIFACTDIR=`pwd`/buildartifacts
cd sources/nuttx/tools/ci
./cibuild.sh -i -A -c testlist/${{matrix.boards}}.dat
ccache -s
./cibuild.sh -i -c -A -R testlist/${{matrix.boards}}.dat
- uses: actions/upload-artifact@v3
with:
name: macos-builds
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ permissions:

jobs:
check:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest

steps:
- name: Checkout nuttx repo
uses: actions/checkout@v3
with:
repository: apache/incubator-nuttx
repository: apache/nuttx
path: nuttx
fetch-depth: 0

- name: Checkout apps repo
uses: actions/checkout@v3
with:
repository: apache/incubator-nuttx-apps
repository: apache/nuttx-apps
path: apps
fetch-depth: 0

Expand Down
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,16 @@
*.src
*.swp
*.sym
*.su
*~
.built
.context
.depend
.kconfig
/*.lock
/bin
/boot_romfsimg.h
/external
/Kconfig
/romfs.img
/staging
/symtab_apps.c
cscope.out
Make.dep
Expand Down
30 changes: 14 additions & 16 deletions Application.mk
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,9 @@ else
CWD = $(CURDIR)
endif

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

LDLIBS += $(call CONVERT_PATH,$(BIN))

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

SUFFIX = $(subst $(DELIM),.,$(CWD))
PROGNAME := $(shell echo $(PROGNAME))

PROGNAME := $(subst ",,$(PROGNAME))

# Object files

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

ifneq ($(BUILD_MODULE),y)
OBJS += $(MAINCOBJ) $(MAINCXXOBJ) $(MAINRUSTOBJ) $(MAINZIGOBJS)
OBJS += $(MAINCOBJ) $(MAINCXXOBJ) $(MAINRUSTOBJ) $(MAINZIGOBJ)
endif

DEPPATH += --dep-path .
Expand All @@ -101,7 +100,7 @@ VPATH += :.

# Targets follow

all:: .built
all:: $(OBJS)
.PHONY: clean depend distclean
.PRECIOUS: $(BIN)

Expand All @@ -126,8 +125,9 @@ define ELFCOMPILERUST
endef

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

define ELFLD
Expand Down Expand Up @@ -159,9 +159,8 @@ $(ZIGOBJS): %$(ZIGEXT)$(SUFFIX)$(OBJEXT): %$(ZIGEXT)
$(if $(and $(CONFIG_BUILD_LOADABLE), $(CELFFLAGS)), \
$(call ELFCOMPILEZIG, $<, $@), $(call COMPILEZIG, $<, $@))

.built: $(OBJS)
$(call ARLOCK, $(call CONVERT_PATH,$(BIN)), $^)
$(Q) touch $@
archive:
$(call ARCHIVE_ADD, $(call CONVERT_PATH,$(BIN)), $(OBJS))

ifeq ($(BUILD_MODULE),y)

Expand Down Expand Up @@ -226,7 +225,7 @@ ifneq ($(PROGNAME),)
REGLIST := $(addprefix $(BUILTIN_REGISTRY)$(DELIM),$(addsuffix .bdat,$(PROGNAME)))
APPLIST := $(PROGNAME)

$(REGLIST): $(DEPCONFIG) $(firstword $(MAKEFILE_LIST))
$(REGLIST): $(DEPCONFIG) Makefile
$(call REGISTER,$(firstword $(APPLIST)),$(firstword $(PRIORITY)),$(firstword $(STACKSIZE)),$(if $(BUILD_MODULE),,$(firstword $(APPLIST))_main))
$(eval APPLIST=$(filter-out $(firstword $(APPLIST)),$(APPLIST)))
$(if $(filter-out $(firstword $(PRIORITY)),$(PRIORITY)),$(eval PRIORITY=$(filter-out $(firstword $(PRIORITY)),$(PRIORITY))))
Expand All @@ -237,7 +236,7 @@ else
register::
endif

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

clean::
$(call DELFILE, .built)
$(call CLEAN)

distclean:: clean
Expand Down
6 changes: 0 additions & 6 deletions DISCLAIMER

This file was deleted.

13 changes: 8 additions & 5 deletions Directory.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ include $(APPDIR)/Make.defs

# Sub-directories that have been built or configured.

SUBDIRS := $(dir $(wildcard *$(DELIM)Makefile))
CONFIGSUBDIRS := $(filter-out $(dir $(wildcard *$(DELIM)Kconfig)),$(SUBDIRS))
CLEANSUBDIRS := $(dir $(wildcard *$(DELIM).built))
CLEANSUBDIRS += $(dir $(wildcard *$(DELIM).depend))
CLEANSUBDIRS += $(dir $(wildcard *$(DELIM).kconfig))
SUBDIRS := $(dir $(wildcard */Makefile))
CONFIGSUBDIRS := $(filter-out $(dir $(wildcard */Kconfig)),$(SUBDIRS))
CLEANSUBDIRS += $(dir $(wildcard */.depend))
CLEANSUBDIRS += $(dir $(wildcard */.kconfig))
CLEANSUBDIRS := $(sort $(CLEANSUBDIRS))
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
CONFIGSUBDIRS := $(subst /,\,$(CONFIGSUBDIRS))
CLEANSUBDIRS := $(subst /,\,$(CLEANSUBDIRS))
endif

all: nothing

Expand Down
41 changes: 21 additions & 20 deletions Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,22 @@
TOPDIR ?= $(APPDIR)/import
include $(TOPDIR)/Make.defs

# The GNU make CURDIR will always be a POSIX-like path with forward slashes
# as path segment separators. This is fine for the above inclusions but
# will cause problems later for the native build. If we know that this is
# a native build, then we need to fix up the APPDIR path for subsequent
# use

ifeq ($(CONFIG_WINDOWS_NATIVE),y)
APPDIR := ${shell echo %CD%}
endif

# Application Directories

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

BUILDIRS := $(dir $(wildcard $(APPDIR)$(DELIM)*$(DELIM)Make.defs))
BUILDIRS := $(filter-out $(APPDIR)$(DELIM)import$(DELIM),$(BUILDIRS))
CONFIGDIRS := $(filter-out $(APPDIR)$(DELIM)builtin$(DELIM),$(BUILDIRS))
CONFIGDIRS := $(filter-out $(dir $(wildcard $(APPDIR)$(DELIM)*$(DELIM)Kconfig)),$(CONFIGDIRS))
CLEANDIRS := $(dir $(wildcard $(APPDIR)$(DELIM)*$(DELIM)Makefile))
BUILDIRS := $(dir $(wildcard $(APPDIR)/*/Make.defs))
BUILDIRS := $(filter-out $(APPDIR)/import/,$(BUILDIRS))
CONFIGDIRS := $(filter-out $(APPDIR)/builtin/,$(BUILDIRS))
CONFIGDIRS := $(filter-out $(dir $(wildcard $(APPDIR)/*/Kconfig)),$(CONFIGDIRS))
CLEANDIRS := $(dir $(wildcard $(APPDIR)/*/Makefile))
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
BUILDIRS := $(subst /,\,$(BUILDIRS))
CONFIGDIRS := $(subst /,\,$(CONFIGDIRS))
CLEANDIRS := $(subst /,\,$(CLEANDIRS))
endif

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

ifeq ($(CONFIG_WINDOWS_NATIVE),y)
define REGISTER
$(Q) echo Register: $1
$(Q) echo { \"$1\", $2, $3, $4 }, > "$(BUILTIN_REGISTRY)$(DELIM)$1.bdat"
$(Q) echo { "$(subst ",,$(1))", $2, $3, $(subst ",,$(4)) }, > "$(BUILTIN_REGISTRY)$(DELIM)$1.bdat"
$(Q) echo int $(subst ",,$(4))(int argc, char *argv[]); > "$(BUILTIN_REGISTRY)$(DELIM)$1.pdat"

$(Q) touch $(BUILTIN_REGISTRY)$(DELIM).updated"
endef
else
define REGISTER
$(Q) echo "Register: $1"
$(Q) echo "{ \"$1\", $2, $3, $4 }," > "$(BUILTIN_REGISTRY)$(DELIM)$1.bdat"
$(Q) if [ ! -z $4 ]; then \
echo "int $4(int argc, char *argv[]);" > "$(BUILTIN_REGISTRY)$(DELIM)$1.pdat"; \
fi;
$(Q) touch "$(BUILTIN_REGISTRY)$(DELIM).updated"
endef

define ARLOCK
$(Q) flock $1.lock $(call ARCHIVE, $1, $(2))
endef
endif

# Standard include path

Expand Down
Loading

0 comments on commit c9c0e9d

Please sign in to comment.