diff --git a/README.md b/README.md index 5a759413db6f8ea8e6d4fb73c0da0b319eb99490..9e500a3ea3dd5c6720b0bf017a9124412f3c7189 100644 --- a/README.md +++ b/README.md @@ -27,14 +27,19 @@ The vendor provides the driver code of the chip architecture. ``` kernel/linux/patches -├── linux-4.19 # linux-4.19 patches -│ └── hi3516dv300_patch -│ ├── hi3516dv300.patch # linux-4.19 Hi3516D V300 SOC patches -│ └── hdf.patch # linux-4.19 Hi3516D V300 HDF patches +├── linux-4.19 # linux-4.19 patches +│   ├── common_patch +│   │ └── hdf.patch # linux-4.19 HDF patches +│   └── hi3516dv300_patch +│   └── hi3516dv300.patch # linux-4.19 Hi3516D V300 SOC patches └── linux-5.10 - └── hi3516dv300_patch - ├── hi3516dv300.patch # linux-5.10 Hi3516D V300 SOC patches - └── hdf.patch # linux-5.10 Hi3516D V300 HDF patches + ├── common_patch + │ └── hdf.patch # linux-5.10 HDF patches + └── hi3516dv300_patch + │ └── hi3516dv300.patch # linux-5.10 Hi3516D V300 SOC patches + └── rkrk3568_patch + ├── kernel.patch # linux-5.10 rk3568 SOC patches + └── hdf.patch # linux-5.10 rk3568 customized HDF patches ``` ## Usage @@ -44,7 +49,7 @@ kernel/linux/patches Apply the HDF kernel patches matching your kernel version. For details, see the method in **kernel.mk** in the **kernel/linux/build** repository. ``` - $(OHOS_BUILD_HOME)/drivers/hdf_core/adapter/khdf/linux/patch_hdf.sh $(OHOS_BUILD_HOME) $(KERNEL_SRC_TMP_PATH) $(HDF_PATCH_FILE) + $(OHOS_BUILD_HOME)/drivers/hdf_core/adapter/khdf/linux/patch_hdf.sh $(OHOS_BUILD_HOME) $(KERNEL_SRC_TMP_PATH) $(KERNEL_PATCH_PATH) $(DEVICE_NAME) ``` 2. Apply the chip driver patches. diff --git a/README_zh.md b/README_zh.md index 2f3b328f4a197878c7f3b063515d8a5dfa7fef23..c54c399fff071fa61027c25e4bb75a19a210a177 100644 --- a/README_zh.md +++ b/README_zh.md @@ -27,14 +27,19 @@ hi3516dv300_small.patch: 在Hi3516DV300芯片上支持arm架构的内核启动 ``` kernel/linux/patches -├── linux-4.19 # linux-4.19 相关patch -│ └── hi3516dv300_patch -│ ├── hi3516dv300.patch # linux-4.19 hi3516dv300 SOC patch -│ └── hdf.patch # linux-4.19 hi3516dv300 hdf patch +├── linux-4.19 # linux-4.19 相关patch +│   ├── common_patch +│   │ └── hdf.patch # linux-4.19 HDF patches +│   └── hi3516dv300_patch +│   └── hi3516dv300.patch # linux-4.19 Hi3516D V300 SOC patches └── linux-5.10 - └── hi3516dv300_patch - ├── hi3516dv300.patch # linux-5.10 hi3516dv300 SOC patch - └── hdf.patch # linux-5.10 hi3516dv300 hdf patch + ├── common_patch + │ └── hdf.patch # linux-5.10 HDF patches + └── hi3516dv300_patch + │ └── hi3516dv300.patch # linux-5.10 Hi3516D V300 SOC patches + └── rkrk3568_patch + ├── kernel.patch # linux-5.10 rk3568 SOC patches + └── hdf.patch # linux-5.10 rk3568 定制 HDF patches ``` ## 使用说明 @@ -44,7 +49,7 @@ kernel/linux/patches 在kernel/linux/build仓中,按照kernel.mk中HDF的补丁合入方法,合入不同内核版本对应的HDF内核补丁: ``` - $(OHOS_BUILD_HOME)/drivers/hdf_core/adapter/khdf/linux/patch_hdf.sh $(OHOS_BUILD_HOME) $(KERNEL_SRC_TMP_PATH) $(HDF_PATCH_FILE) + $(OHOS_BUILD_HOME)/drivers/hdf_core/adapter/khdf/linux/patch_hdf.sh $(OHOS_BUILD_HOME) $(KERNEL_SRC_TMP_PATH) $(KERNEL_PATCH_PATH) $(DEVICE_NAME) ``` 2. 合入芯片平台驱动补丁 diff --git a/kernel.mk b/kernel.mk old mode 100755 new mode 100644 index 585e1e93c73a471a44c71f424ac3373215b6af7f..04ebff08e2a1cbf687fcd32a093336973da69490 --- a/kernel.mk +++ b/kernel.mk @@ -64,10 +64,10 @@ ifneq ($(findstring $(BUILD_TYPE), small standard),) DEVICE_PATCH_DIR := $(OHOS_BUILD_HOME)/kernel/linux/patches/${KERNEL_VERSION}/$(DEVICE_NAME)_patch DEVICE_PATCH_FILE := $(DEVICE_PATCH_DIR)/$(DEVICE_NAME).patch PRODUCT_PATCH_FILE := $(OHOS_BUILD_HOME)/vendor/hisilicon/watchos/patches/$(DEVICE_NAME).patch -HDF_PATCH_FILE := $(DEVICE_PATCH_DIR)/hdf.patch SMALL_PATCH_FILE := $(DEVICE_PATCH_DIR)/$(DEVICE_NAME)_$(BUILD_TYPE).patch KERNEL_IMAGE_FILE := $(KERNEL_SRC_TMP_PATH)/arch/$(KERNEL_ARCH)/boot/$(KERNEL_IMAGE) DEFCONFIG_FILE := $(DEVICE_NAME)_$(BUILD_TYPE)_defconfig +NEWIP_PATCH_FILE := $(OHOS_BUILD_HOME)/foundation/communication/sfc/newip/apply_newip.sh export KBUILD_OUTPUT=$(KERNEL_OBJ_TMP_PATH) @@ -80,7 +80,7 @@ ifeq ($(DEVICE_NAME), hispark_phoenix) else $(hide) rm -rf $(KERNEL_SRC_TMP_PATH);mkdir -p $(KERNEL_SRC_TMP_PATH);cp -arfL $(KERNEL_SRC_PATH)/* $(KERNEL_SRC_TMP_PATH)/ endif - $(hide) $(OHOS_BUILD_HOME)/drivers/hdf_core/adapter/khdf/linux/patch_hdf.sh $(OHOS_BUILD_HOME) $(KERNEL_SRC_TMP_PATH) $(HDF_PATCH_FILE) + $(hide) $(OHOS_BUILD_HOME)/drivers/hdf_core/adapter/khdf/linux/patch_hdf.sh $(OHOS_BUILD_HOME) $(KERNEL_SRC_TMP_PATH) $(KERNEL_PATCH_PATH) $(DEVICE_NAME) ifeq ($(PRODUCT_PATH), vendor/hisilicon/watchos) $(hide) cd $(KERNEL_SRC_TMP_PATH) && patch -p1 < $(PRODUCT_PATCH_FILE) @@ -91,6 +91,10 @@ endif ifneq ($(findstring $(BUILD_TYPE), small),) $(hide) cd $(KERNEL_SRC_TMP_PATH) && patch -p1 < $(SMALL_PATCH_FILE) endif + +ifeq ($(NEWIP_PATCH_FILE), $(wildcard $(NEWIP_PATCH_FILE))) + $(hide) $(NEWIP_PATCH_FILE) $(OHOS_BUILD_HOME) $(KERNEL_SRC_TMP_PATH) $(DEVICE_NAME) ${KERNEL_VERSION} +endif $(hide) cp -rf $(KERNEL_CONFIG_PATH)/. $(KERNEL_SRC_TMP_PATH)/ $(hide) $(KERNEL_MAKE) -C $(KERNEL_SRC_TMP_PATH) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) distclean $(hide) $(KERNEL_MAKE) -C $(KERNEL_SRC_TMP_PATH) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) $(DEFCONFIG_FILE) diff --git a/test/fuzztest/memory/forceshrinkanon_fuzzer/forceshrinkanon_fuzzer.cpp b/test/fuzztest/memory/forceshrinkanon_fuzzer/forceshrinkanon_fuzzer.cpp index 9dcaa00c1d3423f9fd1d7b19b7a889167f57e61f..b890c748d97f34fe541da99dc366df5366fefec3 100644 --- a/test/fuzztest/memory/forceshrinkanon_fuzzer/forceshrinkanon_fuzzer.cpp +++ b/test/fuzztest/memory/forceshrinkanon_fuzzer/forceshrinkanon_fuzzer.cpp @@ -14,11 +14,9 @@ */ #include -#include #include #include #include -#include "memorycommon.h" namespace OHOS { bool ForceShrinkAnonFuzzer(const uint8_t *data, size_t size) diff --git a/test/moduletest/runtest/bin/enhancedswap_t_init.sh b/test/moduletest/runtest/bin/enhancedswap_t_init.sh index 4dcadcf84433e37a74e5bda1aac22c0eb45b4e43..404136da1d0a60944f17c556dda474b5f3ebd935 100644 --- a/test/moduletest/runtest/bin/enhancedswap_t_init.sh +++ b/test/moduletest/runtest/bin/enhancedswap_t_init.sh @@ -30,12 +30,24 @@ pre_condition() } +uninit_platform() +{ + losetup -d /dev/block/loop7 + echo ${hyperhold_device} > /proc/sys/kernel/hyperhold/device + echo ${hyperhold_enable} > /proc/sys/kernel/hyperhold/enable + echo ${zram0_group} > /sys/block/zram0/group + echo ${zram0_disksize} > /sys/block/zram0/disksize + rm -rf hpdisk + swapoff /dev/block/zram0 + echo 1 > /sys/block/zram0/reset +} + hp_init() { dd if=/dev/random of=hpdisk bs=4096 count=131072 - losetup /dev/block/loop6 hpdisk + losetup /dev/block/loop7 hpdisk hyperhold_device=$(cat /proc/sys/kernel/hyperhold/device) - echo /dev/block/loop6 > /proc/sys/kernel/hyperhold/device + echo /dev/block/loop7 > /proc/sys/kernel/hyperhold/device } hp_enable() @@ -58,14 +70,19 @@ zram_enable() swapon /dev/block/zram0 aa start -b com.ohos.settings -a com.ohos.settings.MainAbility aa start -b ohos.samples.airquality -a ohos.samples.airquality.default - aa start -b ohos.samples.ecg -a ohos.samples.ecg.default + aa start -b ohos.samples.ecg -a ohos.samples.ecg.MainAbility aa start -b ohos.samples.flashlight -a ohos.samples.flashlight.default aa start -b ohos.samples.clock -a ohos.samples.clock.default + aa start -b com.ohos.camera -a com.ohos.camera.MainAbility + aa start -b com.ohos.permissionmanager -a com.ohos.permissionmanager.MainAbility + aa start -b ohos.sample.shopping -a com.example.entry.MainAbility + aa start -b ohos.samples.distributedcalc -a ohos.samples.distributedcalc.MainAbility } echo "***************************ESWAP INIT START***************************" free -m +uninit_platform pre_condition hp_init hp_enable diff --git a/test/moduletest/runtest/bin/enhancedswap_t_uninit.sh b/test/moduletest/runtest/bin/enhancedswap_t_uninit.sh index e7a5e60bc5882e91f28f24c3bd8cfb09ae63ec5e..62360248bb9f1f88cd44b5e80af50d747c3fae32 100644 --- a/test/moduletest/runtest/bin/enhancedswap_t_uninit.sh +++ b/test/moduletest/runtest/bin/enhancedswap_t_uninit.sh @@ -27,7 +27,7 @@ uninit_platform() { - losetup -d /dev/block/loop6 + losetup -d /dev/block/loop7 echo ${hyperhold_device} > /proc/sys/kernel/hyperhold/device echo ${hyperhold_enable} > /proc/sys/kernel/hyperhold/enable echo ${zram0_group} > /sys/block/zram0/group diff --git a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug04.sh b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug04.sh index cdfcb09a7938679e4689307590739b3f142ac7c2..fabc90ef40fec4bbd5ddf589ccb38e3278534222 100644 --- a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug04.sh +++ b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug04.sh @@ -56,7 +56,7 @@ do_test() sh ../../../mem_debug_t_init.sh aa start -b com.ohos.settings -a com.ohos.settings.MainAbility aa start -b ohos.samples.airquality -a ohos.samples.airquality.default - aa start -b ohos.samples.ecg -a ohos.samples.ecg.default + aa start -b ohos.samples.ecg -a ohos.samples.ecg.MainAbility aa start -b ohos.samples.flashlight -a ohos.samples.flashlight.default aa start -b ohos.samples.clock -a ohos.samples.clock.default diff --git a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug05.sh b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug05.sh index c900e9ab5931c6390fd46855706dc01313346371..6287ab0cea107fb3a880302ee4da14cc292a3ff2 100644 --- a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug05.sh +++ b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug05.sh @@ -65,11 +65,12 @@ check_reclaim_efficiency() { local mem_type=$1 - local total_process_time=$(cat /proc/reclaim_efficiency | grep -A5 $mem_type | grep total_process | awk '{print $2}') - local drain_pages_time=$(cat /proc/reclaim_efficiency | grep -A5 $mem_type | grep drain_pages | awk '{print $2}') - local shrink_file_time=$(cat /proc/reclaim_efficiency | grep -A5 $mem_type | grep shrink_file | awk '{print $2}') - local shrink_anon_time=$(cat /proc/reclaim_efficiency | grep -A5 $mem_type | grep shrink_anon | awk '{print $2}') - local shrink_slab_time=$(cat /proc/reclaim_efficiency | grep -A5 $mem_type | grep shrink_slab | awk '{print $2}') + cat /proc/reclaim_efficiency > log.txt + local total_process_time=$(cat log.txt | grep -A5 $mem_type | grep total_process | awk '{print $2}') + local drain_pages_time=$(cat log.txt | grep -A5 $mem_type | grep drain_pages | awk '{print $2}') + local shrink_file_time=$(cat log.txt | grep -A5 $mem_type | grep shrink_file | awk '{print $2}') + local shrink_anon_time=$(cat log.txt | grep -A5 $mem_type | grep shrink_anon | awk '{print $2}') + local shrink_slab_time=$(cat log.txt | grep -A5 $mem_type | grep shrink_slab | awk '{print $2}') local sum_time_a=$(($drain_pages_time + $shrink_file_time)) local sum_time_b=$(($shrink_anon_time + $shrink_slab_time)) local sum_time=$(($sum_time_a + $sum_time_b)) @@ -80,9 +81,9 @@ check_reclaim_efficiency() tst_res TFAIL "total_process_time in $mem_type is less than sum of subprocess." fi - local total_process_freed=$(cat /proc/reclaim_efficiency | grep -A5 $mem_type | grep total_process | awk '{print $3}') - local shrink_file_freed=$(cat /proc/reclaim_efficiency | grep -A5 $mem_type | grep shrink_file | awk '{print $3}') - local shrink_anon_freed=$(cat /proc/reclaim_efficiency | grep -A5 $mem_type | grep shrink_anon | awk '{print $3}') + local total_process_freed=$(cat log.txt | grep -A5 $mem_type | grep total_process | awk '{print $3}') + local shrink_file_freed=$(cat log.txt | grep -A5 $mem_type | grep shrink_file | awk '{print $3}') + local shrink_anon_freed=$(cat log.txt | grep -A5 $mem_type | grep shrink_anon | awk '{print $3}') local sum_freed=$(($shrink_file_freed + $shrink_anon_freed)) if [ $sum_freed -eq $total_process_freed ]; then @@ -98,6 +99,7 @@ do_clean() kill -9 $pid echo $reclaim_acct_disable_def > $reclaim_acct_disable echo $avail_buffers_def $min_avail_buffers_def $high_avail_buffers_def $free_swap_threshold_def > $avail_buffers + rm -rf log.txt } do_setup diff --git a/test/moduletest/runtest/bin/mem_debug_t_init.sh b/test/moduletest/runtest/bin/mem_debug_t_init.sh index 91474c83fb79ce1b065e6acb2a47de0a052c5e5f..1455628e9000c32428249897bae1e5f8bd7b4a3e 100644 --- a/test/moduletest/runtest/bin/mem_debug_t_init.sh +++ b/test/moduletest/runtest/bin/mem_debug_t_init.sh @@ -58,7 +58,7 @@ zram_enable() swapon /dev/block/zram0 aa start -b com.ohos.settings -a com.ohos.settings.MainAbility aa start -b ohos.samples.airquality -a ohos.samples.airquality.default - aa start -b ohos.samples.ecg -a ohos.samples.ecg.default + aa start -b ohos.samples.ecg -a ohos.samples.ecg.MainAbility aa start -b ohos.samples.flashlight -a ohos.samples.flashlight.default aa start -b ohos.samples.clock -a ohos.samples.clock.default } diff --git a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg01.sh b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg01.sh index 429b78b32baac56a41bf0622ab58bf65f5ea1afd..6f273c16c2825321d847804dfb97fe90fb1a7c7e 100644 --- a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg01.sh +++ b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg01.sh @@ -29,7 +29,7 @@ source tst_oh.sh do_setup() { - aa start -b ohos.samples.ecg -a ohos.samples.ecg.default + aa start -b ohos.samples.ecg -a ohos.samples.ecg.MainAbility sleep 1 PID=$(ps -ef | grep ohos.samples.ecg | grep -v grep | awk '{print $2}') } @@ -65,7 +65,7 @@ do_test() fi local rtgid3=$(cat $sched_group_id) if [ $rtgid3 -eq 3 ]; then - tst_res TFAIL "process $PID switch rtgid 2 to 3 success unexpected!" + tst_res TFAIL "process $PID switch rtgid 2 to 3 sucess unexpected!" res=$(($res + 1)) fi @@ -96,4 +96,4 @@ do_clean() do_setup do_test do_clean -tst_exit +tst_exit \ No newline at end of file diff --git a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg02.sh b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg02.sh index 8ab1532584761eb5c4eef30121e482dc5c22110a..631283d2476937276db2c5f7d08b8a144e68dbcc 100644 --- a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg02.sh +++ b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg02.sh @@ -31,7 +31,7 @@ source tst_oh.sh do_setup() { - aa start -b ohos.samples.ecg -a ohos.samples.ecg.default + aa start -b ohos.samples.ecg -a ohos.samples.ecg.MainAbility sleep 1 PID=$(ps -ef | grep ohos.samples.ecg | grep -v grep | awk '{print $2}') } diff --git a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg03.sh b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg03.sh index 6c53aeb11bfa653ad3d7105042525ce64906699a..d9f1a6a64ea94b4a110e247eca021c091ae81f2f 100644 --- a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg03.sh +++ b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg03.sh @@ -29,7 +29,7 @@ source tst_oh.sh do_setup() { - aa start -b ohos.samples.ecg -a ohos.samples.ecg.default + aa start -b ohos.samples.ecg -a ohos.samples.ecg.MainAbility sleep 1 PID=$(ps -ef | grep ohos.samples.ecg | grep -v grep | awk '{print $2}') } diff --git a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg04.sh b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg04.sh index 56996f4302a40e9bf2b51c8cb37efa225b9e8591..0f77902023f8b7201bf665f0ccb08b87701e07f0 100644 --- a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg04.sh +++ b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg04.sh @@ -31,7 +31,7 @@ do_setup() { cpu_value=$(cat /sys/kernel/debug/tracing/events/rtg/find_rtg_cpu/enable) - aa start -b ohos.samples.ecg -a ohos.samples.ecg.default + aa start -b ohos.samples.ecg -a ohos.samples.ecg.MainAbility sleep 1 PID=$(ps -ef | grep ohos.samples.ecg | grep -v grep | awk '{print $2}') echo 1 > /sys/kernel/debug/tracing/events/rtg/find_rtg_cpu/enable diff --git a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg06.sh b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg06.sh index e69d87130c377ada2227e0f5ac33e8641d83ca83..91a301458bd796ca6716e7c6f5810886c8466419 100644 --- a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg06.sh +++ b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg06.sh @@ -65,8 +65,8 @@ stability_test() tst_res TINFO "kill 40 task processes...." ps -ef | grep "create_process" | grep -v "grep" | grep -v ${PPID} | cut -c 9-18 | xargs kill -9 sleep 5 - tst_res TINFO "kill process succeeded." - aa start -b ohos.samples.ecg -a ohos.samples.ecg.default && + tst_res TINFO "kill process successed." + aa start -b ohos.samples.ecg -a ohos.samples.ecg.MainAbility && sleep 1 && PID=$(ps -ef | grep ohos.samples.ecg | grep -v grep | awk '{print $2}') if [ $? -eq 0 ]; then @@ -147,4 +147,4 @@ do_clean() do_setup do_test do_clean -tst_exit +tst_exit \ No newline at end of file