test suite reviews and discussions
 help / color / mirror / Atom feed
From: DongJunX <junx.dong@intel.com>
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	[thread overview]
Message-ID: <20220125083836.2354-3-junx.dong@intel.com> (raw)
In-Reply-To: <20220125083836.2354-1-junx.dong@intel.com>

Signed-off-by: DongJunX <junx.dong@intel.com>
---
 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
-- 
2.33.1.windows.1


      parent reply	other threads:[~2022-01-25  8:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-25  8:38 [DTS][V2 0/2] Add function to support ASan test DongJunX
2022-01-25  8:38 ` [DTS][V2 1/2] framework/*: " DongJunX
2022-01-25 21:10   ` Owen Hilyard
2022-01-25  8:38 ` DongJunX [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220125083836.2354-3-junx.dong@intel.com \
    --to=junx.dong@intel.com \
    --cc=dts@dpdk.org \
    --cc=lijuan.tu@intel.com \
    --cc=qingx.sun@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).