[rtems-tools commit] tester/gdb: Add lock timing and remote fetching registers.

Chris Johns chrisj at rtems.org
Sun Mar 29 23:03:46 UTC 2020


Module:    rtems-tools
Branch:    master
Commit:    753eb949b33d2feab6d27c98dfce13155d6e89d3
Changeset: http://git.rtems.org/rtems-tools/commit/?id=753eb949b33d2feab6d27c98dfce13155d6e89d3

Author:    Chris Johns <chrisj at rtems.org>
Date:      Mon Mar 30 09:52:57 2020 +1100

tester/gdb: Add lock timing and remote fetching registers.

- Add timing for the locks to aid performance profiling
- Remove fetching registers as the MI parser is slow on pyton2

Updates #3864

---

 tester/rt/gdb.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tester/rt/gdb.py b/tester/rt/gdb.py
index 15a3862..bfd3749 100644
--- a/tester/rt/gdb.py
+++ b/tester/rt/gdb.py
@@ -1,6 +1,6 @@
 #
 # RTEMS Tools Project (http://www.rtems.org/)
-# Copyright 2013-2014 Chris Johns (chrisj at rtems.org)
+# Copyright 2013,2014,2020 Chris Johns (chrisj at rtems.org)
 # All rights reserved.
 #
 # This file is part of the RTEMS Tools package in 'rtems-tools'.
@@ -34,6 +34,7 @@
 
 from __future__ import print_function
 
+import datetime
 import os
 try:
     import Queue
@@ -59,6 +60,7 @@ class gdb(object):
         self.trace = trace
         self.mi_trace = mi_trace
         self.lock_trace = False
+        self.lock_locked = None
         self.lock = threading.RLock()
         self.script = None
         self.script_line = 0
@@ -79,11 +81,13 @@ class gdb(object):
     def _lock(self, msg):
         if self.lock_trace:
             print('|[   LOCK:%s ]|' % (msg))
+            self.lock_locked = datetime.datetime.now()
         self.lock.acquire()
 
     def _unlock(self, msg):
         if self.lock_trace:
-            print('|] UNLOCK:%s [|' % (msg))
+            period = datetime.datetime.now() - self.lock_locked
+            print('|] UNLOCK:%s [| : %s' % (msg, period))
         self.lock.release()
 
     def _put(self, text):
@@ -228,7 +232,6 @@ class gdb(object):
             else:
                 if self.script_line == 0:
                     self._put('-gdb-set confirm no')
-                    self._put('-data-list-register-names')
                 line = self.script[self.script_line]
                 self.script_line += 1
                 self._put(line)



More information about the vc mailing list