From 4fa2c6a2174dcb83527f5938a77e224dd3eb738f Mon Sep 17 00:00:00 2001 From: Sparkle Vieswer <2874146120@qq.com> Date: Sat, 29 Jun 2024 16:12:10 +0800 Subject: [PATCH 1/3] 2024_0629; based on ARM --- src/content/posts/2024-01/Lsj .md | 29 ++ ...36\351\252\214\346\212\245\345\221\212.md" | 192 ++++++++ src/content/posts/autest_grafana.sh | 82 ++++ src/content/posts/autest_stratovirt.sh | 77 ++++ src/content/posts/perf_out.sh | 103 +++++ src/content/posts/table_grafana_backend.txt | 418 ++++++++++++++++++ src/content/posts/table_grafana_sql.txt | 418 ++++++++++++++++++ src/content/posts/table_stratovirt_mod.txt | 236 ++++++++++ src/content/posts/yarntest--watchAll.txt | 13 + 9 files changed, 1568 insertions(+) create mode 100644 src/content/posts/2024-01/Lsj .md create mode 100644 "src/content/posts/Lsj \345\256\236\351\252\214\346\212\245\345\221\212.md" create mode 100644 src/content/posts/autest_grafana.sh create mode 100644 src/content/posts/autest_stratovirt.sh create mode 100644 src/content/posts/perf_out.sh create mode 100644 src/content/posts/table_grafana_backend.txt create mode 100644 src/content/posts/table_grafana_sql.txt create mode 100644 src/content/posts/table_stratovirt_mod.txt create mode 100644 src/content/posts/yarntest--watchAll.txt diff --git a/src/content/posts/2024-01/Lsj .md b/src/content/posts/2024-01/Lsj .md new file mode 100644 index 0000000..b54941e --- /dev/null +++ b/src/content/posts/2024-01/Lsj .md @@ -0,0 +1,29 @@ +--- +title: 你的标题 +author: 你的名字 +pubDate: 2024-06-14 +categories: ['2024 年第一期'] +description: '在这里填写简单的描述,如果不想描述,删去这个字段。' +--- + + + +## Section 1 + +### Subsection 1 + +## Section 2 diff --git "a/src/content/posts/Lsj \345\256\236\351\252\214\346\212\245\345\221\212.md" "b/src/content/posts/Lsj \345\256\236\351\252\214\346\212\245\345\221\212.md" new file mode 100644 index 0000000..3c55c1e --- /dev/null +++ "b/src/content/posts/Lsj \345\256\236\351\252\214\346\212\245\345\221\212.md" @@ -0,0 +1,192 @@ +--- +title: 在ARM平台对stratovirt和grafana进行测试 +author: 林圣杰 +pubDate: 2024-06-29 +categories: ['2024 年第一期'] +description: '主要进行优先级1的测试;RISC-V平台暂未开放' +--- + + +*** + +## 1. stratovirt +源码仓库位于[stratovirt](https://github.com/openeuler-mirror/stratovirt/tree/master)。 + +在仓库中,测试文件位于`tests/`目录下,分为`hydropper`和`mod_test`两部分,各自的测试文件位于各自目录的`tests/`目录下。 + +`Cargo`会在tests目录下查找集成测试文件,进行集成测试时需要进入`hydropper`或`mod_test`目录,执行`cargo test ...`。 + +### 1.0 测试脚本 +脚本`autest_stratovirt.sh`,进行参数判断、日志目录创建、源码下载、构建、对测试项进行测试、保存测试结果。 + +- 执行结果 + - 将控制台输出保存到文件中 + - 修改`performance_counter_920.sh`脚本,将`perf`执行的相关结果以`markdown`的表格格式保存下来 + +- 小问题 + - 构建`stratovirt`时,需要以超级用户权限执行`make build` + - 要手动执行`Makefile`中目标`build`的命令`cargo build --workspace --bins --release` + - 要手动设置环境变量`STRATOVIRT_BINARY`为构建得到的`stratovirt`可执行文件路径 + +### 1.1 mod_test +目前进行集成测试,收集的是单个rs文件的测试信息,文件位于`tests/mod_test/tests`中,每个rs文件包含若干测试函数。 + +- perf执行结果以`markdown`表格的格式保存在文件`table_stratovirt_mod.txt`中。 + +- 测试项信息如下 + +| Test Name | Status | Run Details | +| - | - | - | +| balloon_test | 2 passed; 13 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | +| block_test | 0 passed; 21 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | +| fwcfg_test | 0 passed; 15 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | +| memory_test | 0 passed; 14 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | +| net_test | 0 passed; 14 failed | `eA` | +| pci_test | 0 passed; 40 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | +| pvpanic_test | 0 passed; 3 failed | `eline366`; Failed to open /dev/kvm: Error(13) | +| rng_test | 0 passed; 5 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | +| scream_test | 0 passed; 4 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | +| scsi_test | 0 passed; 14 failed | `eline 116` | +| serial_test | 0 passed; 7 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | +| usb_camera_test | 0 passed; 8 failed | `eline366`; Found argument '-cameradev' which wasn't expected, or isn't valid in the context. ; Failed to open log file /var/log/mst.log | +| usb_storage_test | 0 passed; 15 failed | `eline366` ; Permission denied (os error 13) Failed to open log file /var/log/mst.log | +| usb_test | 0 passed; 43 failed | `eline366` ; Permission denied (os error 13) Failed to open log file /var/log/mst.log | +| virtio_gpu_test | 0 passed; 12 failed | `eline366` | +| virtio_test | 0 passed; 28 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | +| virtiofs_test | 0 passed; 25 failed | `eB` | +| vnc_test | 0 passed; 9 failed | `eline366` ; Found argument '-vnc' which wasn't expected, or isn't valid in the context. | + + +报错原因及初步分析: + - 基本上所有测试都fail了 + - `eline366`: panicked at tests/mod_test/src/libtest.rs:366:82:called `Option::unwrap()` on a `None` value + - 大多因为`Failed to open /dev/kvm`;同时ARM平台上有`/dev/kvm`,或许因为没有权限。 + - 在usb的相关测试上遇到的是 os error + - `eA`: panicked at tests/mod_test/tests/net_test.rs:349:9:assertion failed: output.status.success() + - `eline 116`: panicked at tests/mod_test/src/utils.rs:116:5:assertion failed: output.status.success() + - `eB`: panicked at tests/mod_test/tests/virtiofs_test.rs:236:56:called `Result::unwrap()` on an `Err` value: NotPresent + + +### 1.2 hydropper +遵循README, 只在ARM平台上安装了相关软件包。 + +*** + +## 2. grafana +源码仓库位于[grafana](https://github.com/grafana/grafana/tree/main)。 + +### 2.0 测试脚本 +脚本`autest_grafana.sh`,进行参数判断、日志目录创建、源码下载、构建、对测试项进行测试、保存测试结果。 + +### 2.1 Run frontend tests +测试命令为`yarn test --watchAll` + +- perf执行结果保存在文件`yarntest--watchAll.txt`中 +- 运行结果总结 +``` +Test Suites: 1 failed, 1 skipped, 1377 passed, 1378 of 1379 total +Tests: 1 failed, 31 skipped, 12970 passed, 13002 total +Snapshots: 366 passed, 366 total +Time: 127.971 s, estimated 133 s +Ran all test suites. +``` + +### 2.2 Run backend tests +在包列表模式下进行测试,对`pkg/`目录下的包进行测试,该目录包含grafana的后端代码。 + +- 每个包的perf执行结果以`markdown`表格的格式保存在文件`table_grafana_backend.txt`中 + +- 测试项信息如下 + +| Test Name | Status | Run Details | +| - | - | - | +| api | ok | 2.693s coverage: 46.7% of statements | +| bus | ok | 0.028s coverage: 81.5% of statements | +| codegen | ok | 0.013s coverage: 13.0% of statements | +| expr | ok | 0.205s coverage: 60.3% of statements | +| middleware | ok | 0.104s coverage: 61.7% of statements | +| plugins | ok | 0.030s coverage: 33.8% of statements | +| promlib | ok | 0.021s coverage: 60.3% of statements | +| server | FAIL | 0.237s coverage: 5.7% of statements | +| setting | ok | 4.102s coverage: 80.6% of statements | +| util | ok | 0.463s coverage: 63.1% of statements | +| web | ok | 0.007s coverage: 14.1% of statements | + + +收集到每个包的所有测试项的测试信息,之后应当对这些测试项信息进行提取。 + +### 2.3 Run SQLite, PostgreSQL and MySQL integration tests +在包列表模式下进行测试。 + +- 每个包的perf执行结果以`markdown`表格的格式保存在文件`table_grafana_sql.txt`中 + +- 测试项信息如下 + +| Test Name | Status | Run Details | +| - | - | - | +| api | ok | 2.655s coverage: 46.7% of statements | +| bus | ok | 0.030s coverage: 81.5% of statements | +| codegen | ok | 0.015s coverage: 13.0% of statements | +| expr | ok | 0.196s coverage: 60.3% of statements | +| middleware | ok | 0.109s coverage: 61.7% of statements | +| plugins | ok | 0.027s coverage: 33.8% of statements | +| promlib | ok | 0.018s coverage: 60.3% of statements | +| server | FAIL | 0.231s coverage: 5.7% of statements | +| setting | ok | 3.233s coverage: 80.6% of statements | +| util | ok | 0.756s coverage: 63.1% of statements | +| web | ok | 0.007s coverage: 14.1% of statements | + + +收集到每个包的所有测试项的测试信息,之后应当对这些测试项信息进行提取。 + +### 2.4 Run end-to-end tests +测试命令为`yarn e2e` + +- 问题 + - 缺少Xvfb依赖, 于是`sudo dnf install xorg-x11-server-Xvfb -y` + - 未解决: + + 执行`yarn e2e`, 报错 + ``` + Can't run because you've entered an invalid browser name. + Browser: chrome was not found on your system or is not supported by Cypress. + Cypress supports the following browsers: + - electron + - chrome + - chromium + - chrome:canary + - edge + - firefox + You can also use a custom browser: https://on.cypress.io/customize-browsers + Available browsers found on your system are: + - electron + ``` + + 执行`yarn e2e electron`, 报错 + ``` + An invalid configuration value was set. + Expected video to be a boolean. + Instead the value was: + ``` + +*** + +## 下一步 + +- 在ARM平台上继续完成测试,对更细粒度的测试项进行提取,进一步分析失败测试项 +- 待RISC-V平台开放,完成相关测试 +- 学习perf、cargo、go的相关命令 diff --git a/src/content/posts/autest_grafana.sh b/src/content/posts/autest_grafana.sh new file mode 100644 index 0000000..79ce9f9 --- /dev/null +++ b/src/content/posts/autest_grafana.sh @@ -0,0 +1,82 @@ +#!/bin/bash + +if [ $# -ne 1 ]; then + echo "Usage: ./autest.sh parameter1" + exit 1 +fi + +if ! command -v go &> /dev/null; then + echo "== Download golang" + sudo dnf install go -y +fi + +LOG_DIR="${HOME}/logs/grafana" +if [ ! -d ${LOG_DIR} ]; then + echo "== Mkdir ${LOG_DIR}" + mkdir ${LOG_DIR} +fi + +PRO_DIR=$1 +cd $1 +PRO_DIR=$(pwd) +echo "== project directory is ${PRO_DIR}" +grafana_path="${PRO_DIR}/grafana-main" + +if [ ! -d "${grafana_path}" ]; then + echo "Clone grafana" + cd $PRO_DIR + git clone https://github.com/grafana/grafana.git grafana-main + + cd $grafana_path + yarn install --immutable + yarn start + +fi + + +# Run frontend tests +cd ${grafana_path} +# ../../performance_counter_920.sh "yarn test --watchAll" ${LOG_DIR} + + +TEST_DIR="${grafana_path}/pkg" +# Run backend tests +TABLE="${PRO_DIR}/table_grafana_backend.txt" +echo "| Test Name | Performance Name | Performance Value |" > ${TABLE} +echo "| --- | --- | --- |" >> ${TABLE} + +echo "== backend test" +cd ${TEST_DIR} +echo "entering $(pwd)" +mkdir ${LOG_DIR}/backend +for dir in *; do + if [ -d "$dir" ]; then + echo $dir + # -short -timeout=30m + ${PRO_DIR}/perf_out.sh "go test -v $(pwd)/${dir} -cover" ${LOG_DIR} ${TABLE} ${dir} &>${LOG_DIR}/backend/${dir}.log + fi +done + +# Run SQLite, PostgreSQL and MySQL integration tests +TABLE="${PRO_DIR}/table_grafana_sql.txt" +echo "| Test Name | Performance Name | Performance Value |" > ${TABLE} +echo "| --- | --- | --- |" >> ${TABLE} + +echo "== sql test" +cd ${TEST_DIR} +echo "entering $(pwd)" +mkdir ${LOG_DIR}/sql +for dir in *; do + if [ -d "$dir" ]; then + echo $dir + ${PRO_DIR}/perf_out.sh "go test -v $(pwd)/${dir} -cover -covermode=atomic -tags=integration" ${LOG_DIR} ${TABLE} ${dir} &>${LOG_DIR}/sql/${dir}.log + fi +done + + +# Run end-to-end tests +sudo dnf install xorg-x11-server-Xvfb -y + +cd ${grafana_path} +yarn e2e +../../performance_counter_920.sh "yarn e2e" ${LOG_DIR} diff --git a/src/content/posts/autest_stratovirt.sh b/src/content/posts/autest_stratovirt.sh new file mode 100644 index 0000000..4fdd826 --- /dev/null +++ b/src/content/posts/autest_stratovirt.sh @@ -0,0 +1,77 @@ +#!/bin/bash + +if [ $# -ne 1 ]; then + echo "Usage: ./autest.sh parameter1" + exit 1 +fi + +if ! command -v cargo &> /dev/null; then + echo "== Download cargo" + curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh +fi + +LOG_DIR="${HOME}/logs/stratovirt" +if [ ! -d ${LOG_DIR} ]; then + echo "== Mkdir ${LOG_DIR}" + mkdir ${LOG_DIR} +fi + +PRO_DIR=$1 +cd $1 +PRO_DIR=$(pwd) +echo "== project directory is ${PRO_DIR}" +strato_path="${PRO_DIR}/stratovirt" +if [ ! -d "${strato_path}" ]; then + echo "Clone stratovirt" + cd $PRO_DIR + git clone https://gitee.com/openeuler/stratovirt.git + + cd $strato_path + sudo make build + + cargo build --workspace --bins --release +fi +export STRATOVIRT_BINARY=${strato_path}/target/release/stratovirt +echo "STRATOVIRT_BINARY is ${STRATOVIRT_BINARY}" + +TEST_DIR="${PRO_DIR}/stratovirt/tests/mod_test" +cd ${TEST_DIR} +echo "entering $(pwd)" + +cd tests +TABLE="${PRO_DIR}/table_stratovirt_mod.txt" +echo "| Test Name | Performance Name | Performance Value |" > ${TABLE} +echo "| --- | --- | --- |" >> ${TABLE} +for file in *_test.rs; do + if [ -f "$file" ]; then + file=$(echo "$file" | sed 's:.*/::') + # grep -n "#\[test" $file | grep -o '^[0-9]\+' | awk '{print $1 + 1}' > ${LOG_DIR}/tmp.txt + echo "" + file=$(echo "$file" | sed 's:\.rs::') + echo "== Now test ${file}" + # ${PRO_DIR}/performance_counter_920.sh "cargo test --test ${file}" ${LOG_DIR} ${TABLE} ${file} 1>${LOG_DIR}/${file}_record_1.txt 2>${LOG_DIR}/${file}_record_2.txt + ${PRO_DIR}/perf_out.sh "cargo test --test ${file}" ${LOG_DIR} ${TABLE} ${file} &>${LOG_DIR}/${file}_record.txt + + # while IFS= read -r line; do + # # 把line的内容作为行号,提取 ${file} 的对应行 + # test_name=$(sed "${line}q;d" ${file}) + # echo "" + # echo "== Now test ${file}" + # file=$(echo "$file" | sed 's:\.rs::') + # done < ${LOG_DIR}/tmp.txt + # break + fi +done + +# echo "" > ${LOG_DIR}/record_1.txt +# echo "" > ${LOG_DIR}/record_2.txt +# TABLE="${PRO_DIR}/table_strato.txt" +# echo "| Test Name | Performance Name | Performance Value |" > ${TABLE} +# echo "| --- | --- | --- |" >> ${TABLE} +# while IFS= read -r line; do +# echo "== Now test $line" +# ${PRO_DIR}/performance_counter_920.sh "cargo test ${line}" ${LOG_DIR} ${TABLE} ${line} 1>>${LOG_DIR}/record_1.txt 2>>${LOG_DIR}/record_2.txt +# # break +# done < ${PRO_DIR}/test_names.txt + +# ./performance_counter_920.sh "go test -v -run TestQueryRange" /home/cloud1/k8s/perf \ No newline at end of file diff --git a/src/content/posts/perf_out.sh b/src/content/posts/perf_out.sh new file mode 100644 index 0000000..8dfa3b5 --- /dev/null +++ b/src/content/posts/perf_out.sh @@ -0,0 +1,103 @@ +#! /bin/sh + +# $1: Complete execution command $2: store folder for generated file +# eg: ./performance_counter.sh "./hackbench -s 512 -l 200 -g 15 -f 25 -P" /home +echo "---" + +if [ $# -ne 4 ]; then + echo "Usage: ./performance_counter.sh parameter1 parameter2 p3 p4" + exit 1 +fi +# test_name=$(echo $1 | grep -oP '(?<=--test ).*') +test_name=$4 + +echo "parameter1=$1" + +result=$(echo "$1" | sed 's:.*/::') + +file_name=$(echo "$result" | sed 's/ //g') +echo "file name : $file_name" + +if [ -f "performance.txt" ]; then + rm -f performance.txt + echo "performance.txt has been deleted" +fi + +perf stat --sync -e duration_time,task-clock,cycles,instructions,cache-references,cache-misses,branches,branch-misses,L1-dcache-loads,L1-dcache-load-misses,LLC-load-misses,LLC-loads -r 1 -o performance.txt $1 +#[macro_use] +echo "later process" + +awk '{print $1, $2, $3}' performance.txt > performance_tmp.txt + +mv performance_tmp.txt performance.txt + +duration_time=`cat performance.txt | grep "duration_time" | awk '{print $1}' | sed 's/,//g'` + +task_clock=`cat performance.txt | grep "task-clock" | awk '{print $1}' | sed 's/,//g'` + +cpu_cycle=`cat performance.txt | grep "cycles" | awk '{print $1}' | sed 's/,//g'` + +instruction=`cat performance.txt | grep "instructions" | awk '{print $1}' | sed 's/,//g'` + +cache_references=`cat performance.txt | grep "cache-references" | awk '{print $1}' | sed 's/,//g'` + +cache_misses=`cat performance.txt | grep "cache-misses" | awk '{print $1}' | sed 's/,//g'` + +branches=`cat performance.txt | grep "branches" | awk '{print $1}' | sed 's/,//g'` + +branch_misses=`cat performance.txt | grep "branch-misses" | awk '{print $1}' | sed 's/,//g'` + +L1_dcache_loads=`cat performance.txt | grep "L1-dcache-loads" | awk '{print $1}' | sed 's/,//g'` + +L1_dcache_load_misses=`cat performance.txt | grep "L1-dcache-load-misses" | awk '{print $1}' | sed 's/,//g'` + +LLC_load_misses=`cat performance.txt | grep "LLC-load-misses" | awk '{print $1}' | sed 's/,//g'` + +LLC_loads=`cat performance.txt | grep "LLC-loads" | awk '{print $1}' | sed 's/,//g'` + +IPC=`echo "scale=3; $instruction / $cpu_cycle" | bc` +printf "\n\n" + +# if [ -f "$file_name.txt" ]; then +# rm -f $file_name.txt +# echo "$file_name.txt has been deleted" +# fi + +# echo "Avg 10 times duration time: $duration_time">> $file_name.txt +# printf "Avg 10 times task clock: %.3f\n" $task_clock>> $file_name.txt +# echo "Avg 10 times cpu-cycles: $cpu_cycle">> $file_name.txt +# echo "Avg 10 times instructions: $instruction">> $file_name.txt +# echo "Avg 10 times cache references: $cache_references">> $file_name.txt +# echo "Avg 10 times cache misses: $cache_misses">> $file_name.txt +# echo "Avg 10 times branches: $branches">> $file_name.txt +# echo "Avg 10 times branch misses: $branch_misses">> $file_name.txt +# echo "Avg 10 times L1 dcache loads: $L1_dcache_loads">> $file_name.txt +# echo "Avg 10 times L1 dcache load misses: $L1_dcache_load_misses">> $file_name.txt +# echo "Avg 10 times LLC load misses: $LLC_load_misses">> $file_name.txt +# echo "Avg 10 times LLC load: $LLC_loads">> $file_name.txt +# printf "Avg 10 times IPC: %.3f\n" $IPC>> $file_name.txt +# mv $file_name.txt $2 + + +echo $3 +file_name=$3 #"perf_tabel.md" +# echo "| ${test_name} | duration time | $duration_time |" # >> $file_name +echo "| ${test_name} | duration time | $duration_time |" >> $file_name +echo "| ${test_name} | task clock | $task_clock |" >> $file_name +echo "| ${test_name} | cpu-cycles | $cpu_cycle |" >> $file_name +echo "| ${test_name} | instructions | $instruction |" >> $file_name +echo "| ${test_name} | cache references | $cache_references |" >> $file_name +echo "| ${test_name} | cache misses | $cache_misses |" >> $file_name +echo "| ${test_name} | branches | $branches |" >> $file_name +echo "| ${test_name} | branch_misses | $branch_misses |" >> $file_name +echo "| ${test_name} | L1 dcache loads | $L1_dcache_loads |" >> $file_name +echo "| ${test_name} | L1 dcache load misses | $L1_dcache_load_misses |" >> $file_name +echo "| ${test_name} | LLC load misses | $LLC_load_misses |" >> $file_name +echo "| ${test_name} | LLC load | $LLC_loads |" >> $file_name +printf "| ${test_name} | IPC | %.3f |\n" $IPC >> $file_name + +# mv $file_name $2 + + +rm -f performance.txt +# mv performance.txt diff --git a/src/content/posts/table_grafana_backend.txt b/src/content/posts/table_grafana_backend.txt new file mode 100644 index 0000000..2a262c5 --- /dev/null +++ b/src/content/posts/table_grafana_backend.txt @@ -0,0 +1,418 @@ +| Test Name | Performance Name | Performance Value | +| --- | --- | --- | +| api | duration time | 15605663902 | +| api | task clock | 73514.48 | +| api | cpu-cycles | 163048213181 | +| api | instructions | 76725379534 | +| api | cache references | 28574705314 | +| api | cache misses | 366828109 | +| api | branches | Date: Sat, 29 Jun 2024 18:52:32 +0800 Subject: [PATCH 2/3] first report --- .../posts/2024-01/lsj_stratovirt_grafana.md | 193 ++++++++++++++++++ 1 file changed, 193 insertions(+) create mode 100644 src/content/posts/2024-01/lsj_stratovirt_grafana.md diff --git a/src/content/posts/2024-01/lsj_stratovirt_grafana.md b/src/content/posts/2024-01/lsj_stratovirt_grafana.md new file mode 100644 index 0000000..c22b15e --- /dev/null +++ b/src/content/posts/2024-01/lsj_stratovirt_grafana.md @@ -0,0 +1,193 @@ +--- +title: 在ARM平台对stratovirt和grafana进行测试 +author: 林圣杰 +pubDate: 2024-06-29 +categories: ['2024 年第一期'] +description: '主要进行优先级1的测试;RISC-V平台暂未开放' +--- + + +*** + +## 1. stratovirt +源码仓库位于[stratovirt](https://github.com/openeuler-mirror/stratovirt/tree/master)。 + +在仓库中,测试文件位于`tests/`目录下,分为`hydropper`和`mod_test`两部分,各自的测试文件位于各自目录的`tests/`目录下。 + +`Cargo`会在tests目录下查找集成测试文件,进行集成测试时需要进入`hydropper`或`mod_test`目录,执行相应`cargo test`命令。 + +### 1.0 自动化脚本 +自动测试脚本为`autest_stratovirt.sh`,已经提交到 gitee 上,地址为[autest_stratovirt.sh](https://gitee.com/stever178/eulix-cloud-test/blob/master/autest_stratovirt.sh),通过脚本完成日志目录创建、源码下载、构建、进行测试、保存测试结果。 + +- 执行结果 + - 将控制台输出保存到文件中 + - 修改`performance_counter_920.sh`脚本,将`perf`执行的相关结果以`markdown`的表格格式保存下来 + +- 小问题 + - 构建`stratovirt`时,需要以超级用户权限执行`make build` + - 要手动执行`Makefile`中目标`build`的命令`cargo build --workspace --bins --release` + - 要手动设置环境变量`STRATOVIRT_BINARY`为构建得到的`stratovirt`可执行文件路径 + +### 1.1 mod_test +目前进行集成测试,收集的是单个rs文件的测试信息,文件位于`stratovirt/tests/mod_test/tests`中,每个rs文件包含若干测试函数。 + +- perf执行结果以`markdown`表格的格式保存在文件[table_stratovirt_mod.md](https://gitee.com/stever178/eulix-cloud-test/blob/master/table_stratovirt_mod.md)中。 + +- 测试项信息如下 + +| Test Name | Status | Run Details | +| - | - | - | +| balloon_test | 2 passed; 13 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | +| block_test | 0 passed; 21 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | +| fwcfg_test | 0 passed; 15 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | +| memory_test | 0 passed; 14 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | +| net_test | 0 passed; 14 failed | `eA` | +| pci_test | 0 passed; 40 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | +| pvpanic_test | 0 passed; 3 failed | `eline366`; Failed to open /dev/kvm: Error(13) | +| rng_test | 0 passed; 5 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | +| scream_test | 0 passed; 4 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | +| scsi_test | 0 passed; 14 failed | `eline 116` | +| serial_test | 0 passed; 7 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | +| usb_camera_test | 0 passed; 8 failed | `eline366`; Found argument '-cameradev' which wasn't expected, or isn't valid in the context. ; Failed to open log file /var/log/mst.log | +| usb_storage_test | 0 passed; 15 failed | `eline366` ; Permission denied (os error 13) Failed to open log file /var/log/mst.log | +| usb_test | 0 passed; 43 failed | `eline366` ; Permission denied (os error 13) Failed to open log file /var/log/mst.log | +| virtio_gpu_test | 0 passed; 12 failed | `eline366` | +| virtio_test | 0 passed; 28 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | +| virtiofs_test | 0 passed; 25 failed | `eB` | +| vnc_test | 0 passed; 9 failed | `eline366` ; Found argument '-vnc' which wasn't expected, or isn't valid in the context. | + + +报错原因及初步分析: + - 基本上所有测试都fail了 + - `eline366`: panicked at tests/mod_test/src/libtest.rs:366:82:called `Option::unwrap()` on a `None` value + - 大多因为`Failed to open /dev/kvm`;同时ARM平台上有`/dev/kvm`,或许因为没有权限。 + - 在usb的相关测试上遇到的是 os error + - `eA`: panicked at tests/mod_test/tests/net_test.rs:349:9:assertion failed: output.status.success() + - `eline 116`: panicked at tests/mod_test/src/utils.rs:116:5:assertion failed: output.status.success() + - `eB`: panicked at tests/mod_test/tests/virtiofs_test.rs:236:56:called `Result::unwrap()` on an `Err` value: NotPresent + + +### 1.2 hydropper +遵循README, 只在ARM平台上安装了相关软件包。 + +*** + +## 2. grafana + +源码仓库位于[grafana](https://github.com/grafana/grafana/tree/main)。 + +### 2.0 自动化脚本 +自动测试脚本为`autest_grafana.sh`,已经提交到 gitee 上,地址为[autest_grafana.sh](https://gitee.com/stever178/eulix-cloud-test/blob/master/autest_grafana.sh),通过脚本完成日志目录创建、源码下载、构建、进行测试、保存测试结果。 + +### 2.1 Run frontend tests +测试命令为`yarn test --watchAll` + +- perf执行结果保存在文件[yarntest--watchAll.md](https://gitee.com/stever178/eulix-cloud-test/blob/master/yarntest--watchAll.txt)中 +- 运行结果总结 +``` +Test Suites: 1 failed, 1 skipped, 1377 passed, 1378 of 1379 total +Tests: 1 failed, 31 skipped, 12970 passed, 13002 total +Snapshots: 366 passed, 366 total +Time: 127.971 s, estimated 133 s +Ran all test suites. +``` + +### 2.2 Run backend tests +在包列表模式下进行测试,对`pkg/`目录下的包进行测试,该目录包含grafana的后端代码。 + +- 每个包的perf执行结果以`markdown`表格的格式保存在文件[table_grafana_backend.md](https://gitee.com/stever178/eulix-cloud-test/blob/master/table_grafana_backend.md)中 + +- 测试项信息如下 + +| Test Name | Status | Run Details | +| - | - | - | +| api | ok | 2.693s coverage: 46.7% of statements | +| bus | ok | 0.028s coverage: 81.5% of statements | +| codegen | ok | 0.013s coverage: 13.0% of statements | +| expr | ok | 0.205s coverage: 60.3% of statements | +| middleware | ok | 0.104s coverage: 61.7% of statements | +| plugins | ok | 0.030s coverage: 33.8% of statements | +| promlib | ok | 0.021s coverage: 60.3% of statements | +| server | FAIL | 0.237s coverage: 5.7% of statements | +| setting | ok | 4.102s coverage: 80.6% of statements | +| util | ok | 0.463s coverage: 63.1% of statements | +| web | ok | 0.007s coverage: 14.1% of statements | + + +收集到每个包的所有测试项的测试信息,之后应当对这些测试项信息进行提取。 + +### 2.3 Run SQLite, PostgreSQL and MySQL integration tests +在包列表模式下进行测试。 + +- 每个包的perf执行结果以`markdown`表格的格式保存在文件[table_grafana_sql.md](https://gitee.com/stever178/eulix-cloud-test/blob/master/table_grafana_sql.md)中 + +- 测试项信息如下 + +| Test Name | Status | Run Details | +| - | - | - | +| api | ok | 2.655s coverage: 46.7% of statements | +| bus | ok | 0.030s coverage: 81.5% of statements | +| codegen | ok | 0.015s coverage: 13.0% of statements | +| expr | ok | 0.196s coverage: 60.3% of statements | +| middleware | ok | 0.109s coverage: 61.7% of statements | +| plugins | ok | 0.027s coverage: 33.8% of statements | +| promlib | ok | 0.018s coverage: 60.3% of statements | +| server | FAIL | 0.231s coverage: 5.7% of statements | +| setting | ok | 3.233s coverage: 80.6% of statements | +| util | ok | 0.756s coverage: 63.1% of statements | +| web | ok | 0.007s coverage: 14.1% of statements | + + +收集到每个包的所有测试项的测试信息,之后应当对这些测试项信息进行提取。 + +### 2.4 Run end-to-end tests +测试命令为`yarn e2e` + +- 问题 + - 缺少Xvfb依赖, 于是`sudo dnf install xorg-x11-server-Xvfb -y` + - 未解决: + + 执行`yarn e2e`, 报错 + ``` + Can't run because you've entered an invalid browser name. + Browser: chrome was not found on your system or is not supported by Cypress. + Cypress supports the following browsers: + - electron + - chrome + - chromium + - chrome:canary + - edge + - firefox + You can also use a custom browser: https://on.cypress.io/customize-browsers + Available browsers found on your system are: + - electron + ``` + + 执行`yarn e2e electron`, 报错 + ``` + An invalid configuration value was set. + Expected video to be a boolean. + Instead the value was: + ``` + +*** + +## 下一步 + +- 在ARM平台上继续完成测试,对更细粒度的测试项进行提取,进一步分析失败测试项 +- 待RISC-V平台开放,完成相关测试 +- 学习perf、cargo、go的相关命令 -- Gitee From 943614d8d322f5b3ee68bfb1ee1400610235c749 Mon Sep 17 00:00:00 2001 From: Sparkle Vieswer <2874146120@qq.com> Date: Sat, 29 Jun 2024 18:57:45 +0800 Subject: [PATCH 3/3] first report, again --- src/content/posts/2024-01/Lsj .md | 29 -- ...grafana.md => linsj_stratovirt_grafana.md} | 2 +- ...36\351\252\214\346\212\245\345\221\212.md" | 192 -------- src/content/posts/autest_grafana.sh | 82 ---- src/content/posts/autest_stratovirt.sh | 77 ---- src/content/posts/perf_out.sh | 103 ----- src/content/posts/table_grafana_backend.txt | 418 ------------------ src/content/posts/table_grafana_sql.txt | 418 ------------------ src/content/posts/table_stratovirt_mod.txt | 236 ---------- src/content/posts/yarntest--watchAll.txt | 13 - 10 files changed, 1 insertion(+), 1569 deletions(-) delete mode 100644 src/content/posts/2024-01/Lsj .md rename src/content/posts/2024-01/{lsj_stratovirt_grafana.md => linsj_stratovirt_grafana.md} (99%) delete mode 100644 "src/content/posts/Lsj \345\256\236\351\252\214\346\212\245\345\221\212.md" delete mode 100644 src/content/posts/autest_grafana.sh delete mode 100644 src/content/posts/autest_stratovirt.sh delete mode 100644 src/content/posts/perf_out.sh delete mode 100644 src/content/posts/table_grafana_backend.txt delete mode 100644 src/content/posts/table_grafana_sql.txt delete mode 100644 src/content/posts/table_stratovirt_mod.txt delete mode 100644 src/content/posts/yarntest--watchAll.txt diff --git a/src/content/posts/2024-01/Lsj .md b/src/content/posts/2024-01/Lsj .md deleted file mode 100644 index b54941e..0000000 --- a/src/content/posts/2024-01/Lsj .md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: 你的标题 -author: 你的名字 -pubDate: 2024-06-14 -categories: ['2024 年第一期'] -description: '在这里填写简单的描述,如果不想描述,删去这个字段。' ---- - - - -## Section 1 - -### Subsection 1 - -## Section 2 diff --git a/src/content/posts/2024-01/lsj_stratovirt_grafana.md b/src/content/posts/2024-01/linsj_stratovirt_grafana.md similarity index 99% rename from src/content/posts/2024-01/lsj_stratovirt_grafana.md rename to src/content/posts/2024-01/linsj_stratovirt_grafana.md index c22b15e..d2f76e1 100644 --- a/src/content/posts/2024-01/lsj_stratovirt_grafana.md +++ b/src/content/posts/2024-01/linsj_stratovirt_grafana.md @@ -190,4 +190,4 @@ Ran all test suites. - 在ARM平台上继续完成测试,对更细粒度的测试项进行提取,进一步分析失败测试项 - 待RISC-V平台开放,完成相关测试 -- 学习perf、cargo、go的相关命令 +- 学习perf命令、cargo和go的相关测试命令 diff --git "a/src/content/posts/Lsj \345\256\236\351\252\214\346\212\245\345\221\212.md" "b/src/content/posts/Lsj \345\256\236\351\252\214\346\212\245\345\221\212.md" deleted file mode 100644 index 3c55c1e..0000000 --- "a/src/content/posts/Lsj \345\256\236\351\252\214\346\212\245\345\221\212.md" +++ /dev/null @@ -1,192 +0,0 @@ ---- -title: 在ARM平台对stratovirt和grafana进行测试 -author: 林圣杰 -pubDate: 2024-06-29 -categories: ['2024 年第一期'] -description: '主要进行优先级1的测试;RISC-V平台暂未开放' ---- - - -*** - -## 1. stratovirt -源码仓库位于[stratovirt](https://github.com/openeuler-mirror/stratovirt/tree/master)。 - -在仓库中,测试文件位于`tests/`目录下,分为`hydropper`和`mod_test`两部分,各自的测试文件位于各自目录的`tests/`目录下。 - -`Cargo`会在tests目录下查找集成测试文件,进行集成测试时需要进入`hydropper`或`mod_test`目录,执行`cargo test ...`。 - -### 1.0 测试脚本 -脚本`autest_stratovirt.sh`,进行参数判断、日志目录创建、源码下载、构建、对测试项进行测试、保存测试结果。 - -- 执行结果 - - 将控制台输出保存到文件中 - - 修改`performance_counter_920.sh`脚本,将`perf`执行的相关结果以`markdown`的表格格式保存下来 - -- 小问题 - - 构建`stratovirt`时,需要以超级用户权限执行`make build` - - 要手动执行`Makefile`中目标`build`的命令`cargo build --workspace --bins --release` - - 要手动设置环境变量`STRATOVIRT_BINARY`为构建得到的`stratovirt`可执行文件路径 - -### 1.1 mod_test -目前进行集成测试,收集的是单个rs文件的测试信息,文件位于`tests/mod_test/tests`中,每个rs文件包含若干测试函数。 - -- perf执行结果以`markdown`表格的格式保存在文件`table_stratovirt_mod.txt`中。 - -- 测试项信息如下 - -| Test Name | Status | Run Details | -| - | - | - | -| balloon_test | 2 passed; 13 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | -| block_test | 0 passed; 21 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | -| fwcfg_test | 0 passed; 15 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | -| memory_test | 0 passed; 14 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | -| net_test | 0 passed; 14 failed | `eA` | -| pci_test | 0 passed; 40 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | -| pvpanic_test | 0 passed; 3 failed | `eline366`; Failed to open /dev/kvm: Error(13) | -| rng_test | 0 passed; 5 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | -| scream_test | 0 passed; 4 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | -| scsi_test | 0 passed; 14 failed | `eline 116` | -| serial_test | 0 passed; 7 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | -| usb_camera_test | 0 passed; 8 failed | `eline366`; Found argument '-cameradev' which wasn't expected, or isn't valid in the context. ; Failed to open log file /var/log/mst.log | -| usb_storage_test | 0 passed; 15 failed | `eline366` ; Permission denied (os error 13) Failed to open log file /var/log/mst.log | -| usb_test | 0 passed; 43 failed | `eline366` ; Permission denied (os error 13) Failed to open log file /var/log/mst.log | -| virtio_gpu_test | 0 passed; 12 failed | `eline366` | -| virtio_test | 0 passed; 28 failed | `eline366` ; Failed to open /dev/kvm: Error(13) | -| virtiofs_test | 0 passed; 25 failed | `eB` | -| vnc_test | 0 passed; 9 failed | `eline366` ; Found argument '-vnc' which wasn't expected, or isn't valid in the context. | - - -报错原因及初步分析: - - 基本上所有测试都fail了 - - `eline366`: panicked at tests/mod_test/src/libtest.rs:366:82:called `Option::unwrap()` on a `None` value - - 大多因为`Failed to open /dev/kvm`;同时ARM平台上有`/dev/kvm`,或许因为没有权限。 - - 在usb的相关测试上遇到的是 os error - - `eA`: panicked at tests/mod_test/tests/net_test.rs:349:9:assertion failed: output.status.success() - - `eline 116`: panicked at tests/mod_test/src/utils.rs:116:5:assertion failed: output.status.success() - - `eB`: panicked at tests/mod_test/tests/virtiofs_test.rs:236:56:called `Result::unwrap()` on an `Err` value: NotPresent - - -### 1.2 hydropper -遵循README, 只在ARM平台上安装了相关软件包。 - -*** - -## 2. grafana -源码仓库位于[grafana](https://github.com/grafana/grafana/tree/main)。 - -### 2.0 测试脚本 -脚本`autest_grafana.sh`,进行参数判断、日志目录创建、源码下载、构建、对测试项进行测试、保存测试结果。 - -### 2.1 Run frontend tests -测试命令为`yarn test --watchAll` - -- perf执行结果保存在文件`yarntest--watchAll.txt`中 -- 运行结果总结 -``` -Test Suites: 1 failed, 1 skipped, 1377 passed, 1378 of 1379 total -Tests: 1 failed, 31 skipped, 12970 passed, 13002 total -Snapshots: 366 passed, 366 total -Time: 127.971 s, estimated 133 s -Ran all test suites. -``` - -### 2.2 Run backend tests -在包列表模式下进行测试,对`pkg/`目录下的包进行测试,该目录包含grafana的后端代码。 - -- 每个包的perf执行结果以`markdown`表格的格式保存在文件`table_grafana_backend.txt`中 - -- 测试项信息如下 - -| Test Name | Status | Run Details | -| - | - | - | -| api | ok | 2.693s coverage: 46.7% of statements | -| bus | ok | 0.028s coverage: 81.5% of statements | -| codegen | ok | 0.013s coverage: 13.0% of statements | -| expr | ok | 0.205s coverage: 60.3% of statements | -| middleware | ok | 0.104s coverage: 61.7% of statements | -| plugins | ok | 0.030s coverage: 33.8% of statements | -| promlib | ok | 0.021s coverage: 60.3% of statements | -| server | FAIL | 0.237s coverage: 5.7% of statements | -| setting | ok | 4.102s coverage: 80.6% of statements | -| util | ok | 0.463s coverage: 63.1% of statements | -| web | ok | 0.007s coverage: 14.1% of statements | - - -收集到每个包的所有测试项的测试信息,之后应当对这些测试项信息进行提取。 - -### 2.3 Run SQLite, PostgreSQL and MySQL integration tests -在包列表模式下进行测试。 - -- 每个包的perf执行结果以`markdown`表格的格式保存在文件`table_grafana_sql.txt`中 - -- 测试项信息如下 - -| Test Name | Status | Run Details | -| - | - | - | -| api | ok | 2.655s coverage: 46.7% of statements | -| bus | ok | 0.030s coverage: 81.5% of statements | -| codegen | ok | 0.015s coverage: 13.0% of statements | -| expr | ok | 0.196s coverage: 60.3% of statements | -| middleware | ok | 0.109s coverage: 61.7% of statements | -| plugins | ok | 0.027s coverage: 33.8% of statements | -| promlib | ok | 0.018s coverage: 60.3% of statements | -| server | FAIL | 0.231s coverage: 5.7% of statements | -| setting | ok | 3.233s coverage: 80.6% of statements | -| util | ok | 0.756s coverage: 63.1% of statements | -| web | ok | 0.007s coverage: 14.1% of statements | - - -收集到每个包的所有测试项的测试信息,之后应当对这些测试项信息进行提取。 - -### 2.4 Run end-to-end tests -测试命令为`yarn e2e` - -- 问题 - - 缺少Xvfb依赖, 于是`sudo dnf install xorg-x11-server-Xvfb -y` - - 未解决: - - 执行`yarn e2e`, 报错 - ``` - Can't run because you've entered an invalid browser name. - Browser: chrome was not found on your system or is not supported by Cypress. - Cypress supports the following browsers: - - electron - - chrome - - chromium - - chrome:canary - - edge - - firefox - You can also use a custom browser: https://on.cypress.io/customize-browsers - Available browsers found on your system are: - - electron - ``` - - 执行`yarn e2e electron`, 报错 - ``` - An invalid configuration value was set. - Expected video to be a boolean. - Instead the value was: - ``` - -*** - -## 下一步 - -- 在ARM平台上继续完成测试,对更细粒度的测试项进行提取,进一步分析失败测试项 -- 待RISC-V平台开放,完成相关测试 -- 学习perf、cargo、go的相关命令 diff --git a/src/content/posts/autest_grafana.sh b/src/content/posts/autest_grafana.sh deleted file mode 100644 index 79ce9f9..0000000 --- a/src/content/posts/autest_grafana.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash - -if [ $# -ne 1 ]; then - echo "Usage: ./autest.sh parameter1" - exit 1 -fi - -if ! command -v go &> /dev/null; then - echo "== Download golang" - sudo dnf install go -y -fi - -LOG_DIR="${HOME}/logs/grafana" -if [ ! -d ${LOG_DIR} ]; then - echo "== Mkdir ${LOG_DIR}" - mkdir ${LOG_DIR} -fi - -PRO_DIR=$1 -cd $1 -PRO_DIR=$(pwd) -echo "== project directory is ${PRO_DIR}" -grafana_path="${PRO_DIR}/grafana-main" - -if [ ! -d "${grafana_path}" ]; then - echo "Clone grafana" - cd $PRO_DIR - git clone https://github.com/grafana/grafana.git grafana-main - - cd $grafana_path - yarn install --immutable - yarn start - -fi - - -# Run frontend tests -cd ${grafana_path} -# ../../performance_counter_920.sh "yarn test --watchAll" ${LOG_DIR} - - -TEST_DIR="${grafana_path}/pkg" -# Run backend tests -TABLE="${PRO_DIR}/table_grafana_backend.txt" -echo "| Test Name | Performance Name | Performance Value |" > ${TABLE} -echo "| --- | --- | --- |" >> ${TABLE} - -echo "== backend test" -cd ${TEST_DIR} -echo "entering $(pwd)" -mkdir ${LOG_DIR}/backend -for dir in *; do - if [ -d "$dir" ]; then - echo $dir - # -short -timeout=30m - ${PRO_DIR}/perf_out.sh "go test -v $(pwd)/${dir} -cover" ${LOG_DIR} ${TABLE} ${dir} &>${LOG_DIR}/backend/${dir}.log - fi -done - -# Run SQLite, PostgreSQL and MySQL integration tests -TABLE="${PRO_DIR}/table_grafana_sql.txt" -echo "| Test Name | Performance Name | Performance Value |" > ${TABLE} -echo "| --- | --- | --- |" >> ${TABLE} - -echo "== sql test" -cd ${TEST_DIR} -echo "entering $(pwd)" -mkdir ${LOG_DIR}/sql -for dir in *; do - if [ -d "$dir" ]; then - echo $dir - ${PRO_DIR}/perf_out.sh "go test -v $(pwd)/${dir} -cover -covermode=atomic -tags=integration" ${LOG_DIR} ${TABLE} ${dir} &>${LOG_DIR}/sql/${dir}.log - fi -done - - -# Run end-to-end tests -sudo dnf install xorg-x11-server-Xvfb -y - -cd ${grafana_path} -yarn e2e -../../performance_counter_920.sh "yarn e2e" ${LOG_DIR} diff --git a/src/content/posts/autest_stratovirt.sh b/src/content/posts/autest_stratovirt.sh deleted file mode 100644 index 4fdd826..0000000 --- a/src/content/posts/autest_stratovirt.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash - -if [ $# -ne 1 ]; then - echo "Usage: ./autest.sh parameter1" - exit 1 -fi - -if ! command -v cargo &> /dev/null; then - echo "== Download cargo" - curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh -fi - -LOG_DIR="${HOME}/logs/stratovirt" -if [ ! -d ${LOG_DIR} ]; then - echo "== Mkdir ${LOG_DIR}" - mkdir ${LOG_DIR} -fi - -PRO_DIR=$1 -cd $1 -PRO_DIR=$(pwd) -echo "== project directory is ${PRO_DIR}" -strato_path="${PRO_DIR}/stratovirt" -if [ ! -d "${strato_path}" ]; then - echo "Clone stratovirt" - cd $PRO_DIR - git clone https://gitee.com/openeuler/stratovirt.git - - cd $strato_path - sudo make build - - cargo build --workspace --bins --release -fi -export STRATOVIRT_BINARY=${strato_path}/target/release/stratovirt -echo "STRATOVIRT_BINARY is ${STRATOVIRT_BINARY}" - -TEST_DIR="${PRO_DIR}/stratovirt/tests/mod_test" -cd ${TEST_DIR} -echo "entering $(pwd)" - -cd tests -TABLE="${PRO_DIR}/table_stratovirt_mod.txt" -echo "| Test Name | Performance Name | Performance Value |" > ${TABLE} -echo "| --- | --- | --- |" >> ${TABLE} -for file in *_test.rs; do - if [ -f "$file" ]; then - file=$(echo "$file" | sed 's:.*/::') - # grep -n "#\[test" $file | grep -o '^[0-9]\+' | awk '{print $1 + 1}' > ${LOG_DIR}/tmp.txt - echo "" - file=$(echo "$file" | sed 's:\.rs::') - echo "== Now test ${file}" - # ${PRO_DIR}/performance_counter_920.sh "cargo test --test ${file}" ${LOG_DIR} ${TABLE} ${file} 1>${LOG_DIR}/${file}_record_1.txt 2>${LOG_DIR}/${file}_record_2.txt - ${PRO_DIR}/perf_out.sh "cargo test --test ${file}" ${LOG_DIR} ${TABLE} ${file} &>${LOG_DIR}/${file}_record.txt - - # while IFS= read -r line; do - # # 把line的内容作为行号,提取 ${file} 的对应行 - # test_name=$(sed "${line}q;d" ${file}) - # echo "" - # echo "== Now test ${file}" - # file=$(echo "$file" | sed 's:\.rs::') - # done < ${LOG_DIR}/tmp.txt - # break - fi -done - -# echo "" > ${LOG_DIR}/record_1.txt -# echo "" > ${LOG_DIR}/record_2.txt -# TABLE="${PRO_DIR}/table_strato.txt" -# echo "| Test Name | Performance Name | Performance Value |" > ${TABLE} -# echo "| --- | --- | --- |" >> ${TABLE} -# while IFS= read -r line; do -# echo "== Now test $line" -# ${PRO_DIR}/performance_counter_920.sh "cargo test ${line}" ${LOG_DIR} ${TABLE} ${line} 1>>${LOG_DIR}/record_1.txt 2>>${LOG_DIR}/record_2.txt -# # break -# done < ${PRO_DIR}/test_names.txt - -# ./performance_counter_920.sh "go test -v -run TestQueryRange" /home/cloud1/k8s/perf \ No newline at end of file diff --git a/src/content/posts/perf_out.sh b/src/content/posts/perf_out.sh deleted file mode 100644 index 8dfa3b5..0000000 --- a/src/content/posts/perf_out.sh +++ /dev/null @@ -1,103 +0,0 @@ -#! /bin/sh - -# $1: Complete execution command $2: store folder for generated file -# eg: ./performance_counter.sh "./hackbench -s 512 -l 200 -g 15 -f 25 -P" /home -echo "---" - -if [ $# -ne 4 ]; then - echo "Usage: ./performance_counter.sh parameter1 parameter2 p3 p4" - exit 1 -fi -# test_name=$(echo $1 | grep -oP '(?<=--test ).*') -test_name=$4 - -echo "parameter1=$1" - -result=$(echo "$1" | sed 's:.*/::') - -file_name=$(echo "$result" | sed 's/ //g') -echo "file name : $file_name" - -if [ -f "performance.txt" ]; then - rm -f performance.txt - echo "performance.txt has been deleted" -fi - -perf stat --sync -e duration_time,task-clock,cycles,instructions,cache-references,cache-misses,branches,branch-misses,L1-dcache-loads,L1-dcache-load-misses,LLC-load-misses,LLC-loads -r 1 -o performance.txt $1 -#[macro_use] -echo "later process" - -awk '{print $1, $2, $3}' performance.txt > performance_tmp.txt - -mv performance_tmp.txt performance.txt - -duration_time=`cat performance.txt | grep "duration_time" | awk '{print $1}' | sed 's/,//g'` - -task_clock=`cat performance.txt | grep "task-clock" | awk '{print $1}' | sed 's/,//g'` - -cpu_cycle=`cat performance.txt | grep "cycles" | awk '{print $1}' | sed 's/,//g'` - -instruction=`cat performance.txt | grep "instructions" | awk '{print $1}' | sed 's/,//g'` - -cache_references=`cat performance.txt | grep "cache-references" | awk '{print $1}' | sed 's/,//g'` - -cache_misses=`cat performance.txt | grep "cache-misses" | awk '{print $1}' | sed 's/,//g'` - -branches=`cat performance.txt | grep "branches" | awk '{print $1}' | sed 's/,//g'` - -branch_misses=`cat performance.txt | grep "branch-misses" | awk '{print $1}' | sed 's/,//g'` - -L1_dcache_loads=`cat performance.txt | grep "L1-dcache-loads" | awk '{print $1}' | sed 's/,//g'` - -L1_dcache_load_misses=`cat performance.txt | grep "L1-dcache-load-misses" | awk '{print $1}' | sed 's/,//g'` - -LLC_load_misses=`cat performance.txt | grep "LLC-load-misses" | awk '{print $1}' | sed 's/,//g'` - -LLC_loads=`cat performance.txt | grep "LLC-loads" | awk '{print $1}' | sed 's/,//g'` - -IPC=`echo "scale=3; $instruction / $cpu_cycle" | bc` -printf "\n\n" - -# if [ -f "$file_name.txt" ]; then -# rm -f $file_name.txt -# echo "$file_name.txt has been deleted" -# fi - -# echo "Avg 10 times duration time: $duration_time">> $file_name.txt -# printf "Avg 10 times task clock: %.3f\n" $task_clock>> $file_name.txt -# echo "Avg 10 times cpu-cycles: $cpu_cycle">> $file_name.txt -# echo "Avg 10 times instructions: $instruction">> $file_name.txt -# echo "Avg 10 times cache references: $cache_references">> $file_name.txt -# echo "Avg 10 times cache misses: $cache_misses">> $file_name.txt -# echo "Avg 10 times branches: $branches">> $file_name.txt -# echo "Avg 10 times branch misses: $branch_misses">> $file_name.txt -# echo "Avg 10 times L1 dcache loads: $L1_dcache_loads">> $file_name.txt -# echo "Avg 10 times L1 dcache load misses: $L1_dcache_load_misses">> $file_name.txt -# echo "Avg 10 times LLC load misses: $LLC_load_misses">> $file_name.txt -# echo "Avg 10 times LLC load: $LLC_loads">> $file_name.txt -# printf "Avg 10 times IPC: %.3f\n" $IPC>> $file_name.txt -# mv $file_name.txt $2 - - -echo $3 -file_name=$3 #"perf_tabel.md" -# echo "| ${test_name} | duration time | $duration_time |" # >> $file_name -echo "| ${test_name} | duration time | $duration_time |" >> $file_name -echo "| ${test_name} | task clock | $task_clock |" >> $file_name -echo "| ${test_name} | cpu-cycles | $cpu_cycle |" >> $file_name -echo "| ${test_name} | instructions | $instruction |" >> $file_name -echo "| ${test_name} | cache references | $cache_references |" >> $file_name -echo "| ${test_name} | cache misses | $cache_misses |" >> $file_name -echo "| ${test_name} | branches | $branches |" >> $file_name -echo "| ${test_name} | branch_misses | $branch_misses |" >> $file_name -echo "| ${test_name} | L1 dcache loads | $L1_dcache_loads |" >> $file_name -echo "| ${test_name} | L1 dcache load misses | $L1_dcache_load_misses |" >> $file_name -echo "| ${test_name} | LLC load misses | $LLC_load_misses |" >> $file_name -echo "| ${test_name} | LLC load | $LLC_loads |" >> $file_name -printf "| ${test_name} | IPC | %.3f |\n" $IPC >> $file_name - -# mv $file_name $2 - - -rm -f performance.txt -# mv performance.txt diff --git a/src/content/posts/table_grafana_backend.txt b/src/content/posts/table_grafana_backend.txt deleted file mode 100644 index 2a262c5..0000000 --- a/src/content/posts/table_grafana_backend.txt +++ /dev/null @@ -1,418 +0,0 @@ -| Test Name | Performance Name | Performance Value | -| --- | --- | --- | -| api | duration time | 15605663902 | -| api | task clock | 73514.48 | -| api | cpu-cycles | 163048213181 | -| api | instructions | 76725379534 | -| api | cache references | 28574705314 | -| api | cache misses | 366828109 | -| api | branches |