From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D1185A034D; Thu, 10 Feb 2022 03:50:04 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9604F41153; Thu, 10 Feb 2022 03:50:04 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 204FB40041 for ; Thu, 10 Feb 2022 03:50:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644461403; x=1675997403; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Jkgkrucx+LPhg+9lGKl1crnbf21b42OKW8PNo7JTrXo=; b=Of1uV8WMEXztyXD2U0EfBJTvM2OZR+0TNxqdAZHeLDyA/sCUUsq55pWR yIvePU5NDjkuPenV+a1ei9vDSMxzvADItWs1kmkVZ4mPa1L9mB4CfsM1c N+El4dXugvHi6u0I8sv1qVY7dO7Bp1SFUGR11Km5JuMCrQX/RR349FNo0 LwgyokwHaKm3uOVQqVwrVtTbK+gXQ+k3o2bHSYoG90eJT9/bWM1XhV3LE RNpV0w84sMyVgX9YmM1T+dIj3xE1LilibQUSvIUWWWZVEm83bQ+GmlkW1 BpX26G6SSTw+opK4LV7X8hIgUyIrr8mgXIT/t4HuRTjtrdJGNY5umfmzi A==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="232961551" X-IronPort-AV: E=Sophos;i="5.88,357,1635231600"; d="scan'208";a="232961551" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2022 18:50:02 -0800 X-IronPort-AV: E=Sophos;i="5.88,357,1635231600"; d="scan'208";a="629529191" Received: from shwdenpg197.ccr.corp.intel.com ([10.253.109.70]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2022 18:50:01 -0800 From: Jun Dong To: dts@dpdk.org Cc: lijuan.tu@intel.com, qingx.sun@intel.com, junx.dong@intel.com Subject: [dts][V3 2/2] doc/*: Add ASan test user guide Date: Thu, 10 Feb 2022 10:49:52 +0800 Message-Id: <20220210024952.2876-3-junx.dong@intel.com> X-Mailer: git-send-email 2.33.1.windows.1 In-Reply-To: <20220210024952.2876-1-junx.dong@intel.com> References: <20220210024952.2876-1-junx.dong@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 V3: - Move Manual generate ASan report scene V2: - Modify filter bound format V1: - Add ASan test user guide Signed-off-by: Jun Dong --- doc/dts_gsg/usr_guide/asan_test.rst | 59 +++++++++++++++++++++++++++++ doc/dts_gsg/usr_guide/index.rst | 1 + 2 files changed, 60 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..65de3a7f --- /dev/null +++ b/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 diff --git a/doc/dts_gsg/usr_guide/index.rst b/doc/dts_gsg/usr_guide/index.rst index 04a71dc7..f34d0dcf 100644 --- a/doc/dts_gsg/usr_guide/index.rst +++ b/doc/dts_gsg/usr_guide/index.rst @@ -41,3 +41,4 @@ User Guide trex ixia igb_uio + asan_test -- 2.33.1.windows.1