From patchwork Wed Apr 6 15:10:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Juraj_Linke=C5=A1?= X-Patchwork-Id: 109279 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A6A51A0508; Wed, 6 Apr 2022 17:12:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BD4BF428E4; Wed, 6 Apr 2022 17:11:30 +0200 (CEST) Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20]) by mails.dpdk.org (Postfix) with ESMTP id 3515D428D0 for ; Wed, 6 Apr 2022 17:11:27 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lb.pantheon.sk (Postfix) with ESMTP id 281F6184FE9; Wed, 6 Apr 2022 17:11:26 +0200 (CEST) X-Virus-Scanned: amavisd-new at siecit.sk Received: from lb.pantheon.sk ([127.0.0.1]) by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZX6FFZobJozw; Wed, 6 Apr 2022 17:11:25 +0200 (CEST) Received: from entguard.lab.pantheon.local (unknown [46.229.239.141]) by lb.pantheon.sk (Postfix) with ESMTP id 5856F184FF9; Wed, 6 Apr 2022 17:11:13 +0200 (CEST) From: =?utf-8?q?Juraj_Linke=C5=A1?= To: thomas@monjalon.net, david.marchand@redhat.com, Honnappa.Nagarahalli@arm.com, ohilyard@iol.unh.edu, lijuan.tu@intel.com Cc: dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= Subject: [RFC PATCH v1 13/24] dts: merge DTS doc/dts_gsg/usr_guide/asan_test.rst to DPDK Date: Wed, 6 Apr 2022 15:10:55 +0000 Message-Id: <20220406151106.2915304-14-juraj.linkes@pantheon.tech> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220406151106.2915304-1-juraj.linkes@pantheon.tech> References: <20220406151106.2915304-1-juraj.linkes@pantheon.tech> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org --- dts/doc/dts_gsg/usr_guide/asan_test.rst | 59 +++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 dts/doc/dts_gsg/usr_guide/asan_test.rst diff --git a/dts/doc/dts_gsg/usr_guide/asan_test.rst b/dts/doc/dts_gsg/usr_guide/asan_test.rst new file mode 100644 index 0000000000..65de3a7f80 --- /dev/null +++ b/dts/doc/dts_gsg/usr_guide/asan_test.rst @@ -0,0 +1,59 @@ +About ASan +=========== + +AddressSanitizer a.k.a. ASan is a widely-used debugging tool to detect memory access errors. +It helps to detect issues like use-after-free, various kinds of buffer overruns in C/C++ +programs, and other similar errors, as well as printing out detailed debug information whenever +an error is detected. + +ASan is integrated with gcc and clang and can be enabled via a meson option: -Db_sanitize=address, +See the documentation for details (especially regarding clang). + +About ASan test +=============== + +DTS adds one parameter named asan to control ASan test, support through added asan parameter, +otherwise not support. It contains three steps on the whole: + + - Append ASan build parameters to meson build options. this may open the function of ASan detect + memory access errors. if occuring memory access errors, the stack info will recorded in DTS log + + - After all cases tested finish, analyze DTS log and redefine case test result according to whether + case log contain memory access error info. modify the result to failed if contain otherwise inherit + the original result. + + - Generate ASan report to distinguish it from the original report. + +ASan test steps +======================= + +Check ASan test config +---------------------- + +ASan config file is placed in conf/asan.cfg + +Firstly, check the log filter bounds pairs, customer can modify the pairs if need, and use colon split +bounds, use comma split pairs, there are two pairs key word default as follow: + + - filter_bounds=LeakSanitizer:SUMMARY,AddressSanitizer:SUMMARY + +Secondly, check the meson build parameter options pair, there is a list of parameters default as follow: + + - build_param=-Dbuildtype=debug -Db_lundef=false -Db_sanitize=address + +Launch DTS +---------- + + ./dts --asan + +When launch DTS, there are two parameters need attention: + - provide --asan parameter, means support ASan test. + - Don't provide -s parameter to skip build DPDK package. ASan test need rebuild DPDK package. + +Obtain the ASan test report +--------------------------- + +ASan report located at DTS output directory also, and provided three format as follow: + - Json format named asan_test_results.json + - Excel format named asan_test_results.xls + - Statistics information of txt format named asan_statistics.txt \ No newline at end of file