From patchwork Tue Jan 25 08:38:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Dong X-Patchwork-Id: 106476 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 77A13A04A9; Tue, 25 Jan 2022 09:38:48 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7371041C27; Tue, 25 Jan 2022 09:38:48 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 28A874013F for ; Tue, 25 Jan 2022 09:38:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643099926; x=1674635926; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XdRHi2QwQnDqjdt5VUrbKt/eyFtXG8L7O26FLR+4bTI=; b=oCz/e2ooecPMQFVHUMiP+PKnP8CBb1k1IWEW90aTnvHXu/yH0f9dxEDt 4ys7SY5L2I+QDhkrM+4VHIZIY8/3w8C7ovgh8RjO23o5kw6CAYEmwgpg1 B60bFn1DrWX3xAnnTFrbLO+3P2fw6EMBjAqKfbYgHKMnMDSuhi7JtaFAS tJPhFabTfWz0xC+uS2m5IQ1yWCJ3qhyfaUog2ImFP72jFl4nUlmqMAzPD oKeIPzsiuCpWT/aBOIzTT5dABA03PhPnTNoy2GmAXZqEmoz8pf96wi7/9 IESQTLLvuPaBFqrX8+YBYIj4yuoHMFygBs2UkoUG2TORSi0qR7rH1TjKa Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10237"; a="226232177" X-IronPort-AV: E=Sophos;i="5.88,314,1635231600"; d="scan'208";a="226232177" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2022 00:38:45 -0800 X-IronPort-AV: E=Sophos;i="5.88,314,1635231600"; d="scan'208";a="617542714" Received: from shwdenpg197.ccr.corp.intel.com ([10.253.109.35]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2022 00:38:44 -0800 From: DongJunX To: dts@dpdk.org Cc: lijuan.tu@intel.com, qingx.sun@intel.com, junx.dong@intel.com Subject: [DTS][V2 2/2] doc/*: Add ASan test user guide Date: Tue, 25 Jan 2022 16:38:36 +0800 Message-Id: <20220125083836.2354-3-junx.dong@intel.com> X-Mailer: git-send-email 2.33.1.windows.1 In-Reply-To: <20220125083836.2354-1-junx.dong@intel.com> References: <20220125083836.2354-1-junx.dong@intel.com> MIME-Version: 1.0 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Signed-off-by: DongJunX --- doc/dts_gsg/usr_guide/asan_test.rst | 67 +++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 doc/dts_gsg/usr_guide/asan_test.rst diff --git a/doc/dts_gsg/usr_guide/asan_test.rst b/doc/dts_gsg/usr_guide/asan_test.rst new file mode 100644 index 00000000..8852ac6a --- /dev/null +++ b/doc/dts_gsg/usr_guide/asan_test.rst @@ -0,0 +1,67 @@ +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. + +The detail of ASan test way as follow. + +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 + +(optional scene) Manual generate ASan report +-------------------------------------------- + +In some scene, we need analyze special filter bounds and generate new report after DTS execute finished. + + - Modify ASan config file as above. + - Run asan_test module in DTS root path: python3 ./framework/asan_test.py + - Obtain ASan test report as above. \ No newline at end of file