鲲鹏社区首页
中文
注册
我要评分
文档获取效率
文档正确性
内容完整性
文档易理解
在线提单
论坛求助

内存一致性检查

stage('memory-consistency-check') {
    
                            steps {
                                echo '====== 内存一致性检查 ======'
                                sh '''
if [ ! -d "./report_dir" ]; then mkdir -p ./report_dir; fi
/usr/bin/rm -rf ./report_dir/*.html
                                    devkit advisor mem-cons -i /opt/DevKit/testcase/affinity/weak_cons/test-mulbc_sort -f     
                                    opt/DevKit/testcase/affinity/weak_cons/bc_file -r html -o ./report_dir
                                    mv ./report_dir/mem-cons*.html ./report_dir/memory-consistency-check.html
                                '''
                            }
                            post {
                                always {
                                    publishHTML(target: [allowMissing: false,
                                                alwaysLinkToLastBuild: false,
                                                keepAll              : true,
                                                reportDir            : './report_dir',
                                                reportFiles          : 'memory-consistency-check.html',
                                                reportName           : 'memory-consistency-check Report']
                                                )
                                }
                            }
                        }

具体参数如表1所示。

表1 内存一致性检查参数说明

参数

参数选项

参数说明

-i/--input

package_path

必选参数。BC文件对应的源码文件路径。

例如:/home/test

-f/--bc-file

path

必选参数。BC文件路径,该路径下必须存在BC文件。

例如:/home/testbc

--autofix

true/false

可选参数。是否生成编译器配置文件,默认为false。

--autofix-dir

path

可选参数。编译器配置文件的存放地址,默认生成在工具目录下的源码文件夹下,使用--autofix且参数必须为true时才能生效。

-o/--output

output_path

可选参数。报告存放路径,报告默认存放在当前执行路径下,名称默认为“特性名称_时间戳”。

--set-timeout

time

可选参数。任务超时时间,默认无超时时间,任务将持续执行直到结束。

-l/--log-level

0,1,2,3

可选参数。设置日志等级,日志等级分类有0(DEBUG)、1(INFO)、2(WARNING)、3(ERROR),默认为1(INFO)。

-r/--report-type

all,json,html,csv

可选参数。扫描报告的格式,默认为all,即默认生成json、html、csv三种报告。

  • 使用内存一致性检查功能时,代码示例中需要添加BC文件对应的源码文件路径、BC文件路径、报告输出格式以及报告存放地址。

    格式:devkit advisor mem-cons -i BC文件对应的源码文件路径 -f BC文件路径(需要用户配合编写生成的BC文件脚本) -r html -o 报告存放地址

    示例:devkit advisor mem-cons -i /opt/DevKit/testcase/affinity/weak_cons/test-mulbc_sort -f /opt/DevKit/testcase/affinity/weak_cons/bc_file –r html -o ./report_dir

  • 使用内存一致性检查建议放在构建流程节点前。
  • 请使用DevKit自带的LLVM生成BC文件。