test suite reviews and discussions
 help / color / mirror / Atom feed
From: Yong Liu <yong.liu@intel.com>
To: dts@dpdk.org
Subject: [dts] [PATCH] framework: add argument for debug mode enable and disable
Date: Mon, 11 May 2015 14:25:01 +0800	[thread overview]
Message-ID: <1431325501-15737-1-git-send-email-yong.liu@intel.com> (raw)
In-Reply-To: <1430232992-6798-1-git-send-email-yong.liu@intel.com>

From: Marvin Liu <yong.liu@intel.com>

When debug mode enable, before and after every send_expect function will
change signal handler. Althrough it only toke 0.x second, hundreds call of
send_expect will also take few minutes. This patch add one argument of dts to
enable and disable debug mode, and default debug mode will be disabled.

Signed-off-by: Marvin Liu <yong.liu@intel.com>

diff --git a/framework/debugger.py b/framework/debugger.py
index a2bfe7f..a5f3e84 100644
--- a/framework/debugger.py
+++ b/framework/debugger.py
@@ -131,6 +131,9 @@ def ignore_keyintr():
     """
     Temporary disable interrupt handler.
     """
+    if dts.debug_mode is False:
+        return
+
     global debug_cmd
     signal.siginterrupt(signal.SIGINT, True)
     # if there's waiting request, first handler it
@@ -144,4 +147,7 @@ def aware_keyintr():
     """
     Reenable interrupt handler.
     """
+    if dts.debug_mode is False:
+        return
+
     return signal.signal(signal.SIGINT, keyboard_handle)
diff --git a/framework/dts.py b/framework/dts.py
index ae12dc9..c9ecccb 100644
--- a/framework/dts.py
+++ b/framework/dts.py
@@ -58,6 +58,7 @@ reload(sys)
 sys.setdefaultencoding('UTF8')
 
 
+debug_mode = False
 config = None
 table = None
 results_table_rows = []
@@ -385,7 +386,7 @@ def dts_run_suite(crbInst, test_suites, target, nic):
 
 def run_all(config_file, pkgName, git, patch, skip_setup,
             read_cache, project, suite_dir, test_cases,
-            base_dir, output_dir, verbose):
+            base_dir, output_dir, verbose, debug):
     """
     Main process of DTS, it will run all test suites in the config file.
     """
@@ -398,6 +399,7 @@ def run_all(config_file, pkgName, git, patch, skip_setup,
     global excel_report
     global stats
     global log_handler
+    global debug_mode
 
     # prepare the output folder
     if not os.path.exists(output_dir):
@@ -408,6 +410,10 @@ def run_all(config_file, pkgName, git, patch, skip_setup,
         sys.path.append(folder)
     sys.path.append(suite_dir)
 
+    # enable debug mode
+    if debug is True:
+        debug_mode = True
+
     # init log_handler handler
     if verbose is True:
         logger.set_verbose()
diff --git a/framework/main.py b/framework/main.py
index 11b7513..3e467d0 100755
--- a/framework/main.py
+++ b/framework/main.py
@@ -117,6 +117,10 @@ parser.add_argument('-v', '--verbose',
                     action='store_true',
                     help='enable verbose output, all message output on screen')
 
+parser.add_argument('--debug',
+                    action='store_true',
+                    help='enable debug mode, user can enter debug mode in process')
+
 args = parser.parse_args()
 
 
@@ -132,4 +136,4 @@ if args.git is not None:
 dts.run_all(args.config_file, args.snapshot, args.git,
             args.patch, args.skip_setup, args.read_cache,
             args.project, args.suite_dir, args.test_cases,
-            args.dir, args.output, args.verbose)
+            args.dir, args.output, args.verbose, args.debug)
-- 
1.9.3

      parent reply	other threads:[~2015-05-11  6:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-28 14:56 [dts] [PATCH 0/4] Support debug mode in DTS Yong Liu
2015-04-28 14:56 ` [dts] [PATCH 1/4] framework: add debugger module for enable debug in the running process Yong Liu
2015-04-28 14:56 ` [dts] [PATCH 2/4] framework: maintain connected session list and disable debug mode in send_expect Yong Liu
2015-04-28 14:56 ` [dts] [PATCH 3/4] framework: change alt session name for easy to distinguish Yong Liu
2015-04-28 14:56 ` [dts] [PATCH 4/4] framework: enlarge hugepage number for dpdk2.0 request more memory Yong Liu
2015-05-11  6:25 ` Yong Liu [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=1431325501-15737-1-git-send-email-yong.liu@intel.com \
    --to=yong.liu@intel.com \
    --cc=dts@dpdk.org \
    /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).