[Skiboot] [PATCH] external/mambo: conditionally source qtrace script

Nicholas Piggin npiggin at gmail.com
Wed Aug 8 22:13:09 AEST 2018


This automatically gives qtrace commads if the simulator provides
the capability.

Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
---
 external/mambo/qtrace_utils.tcl | 16 +++++++++-------
 external/mambo/skiboot.tcl      |  1 +
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/external/mambo/qtrace_utils.tcl b/external/mambo/qtrace_utils.tcl
index bfea8d81..8080ae40 100644
--- a/external/mambo/qtrace_utils.tcl
+++ b/external/mambo/qtrace_utils.tcl
@@ -1,10 +1,12 @@
-source $env(LIB_DIR)/perf/qtrace.tcl
+if { [file exists $env(LIB_DIR)/perf/qtrace.tcl] == 1} {
+    source $env(LIB_DIR)/perf/qtrace.tcl
 
-proc start_qtrace { { qtfile qtrace.qt } } {
-    QTrace::Initialize p9 mysim
-    QTrace::Start $qtfile mysim
-}
+    proc start_qtrace { { qtfile qtrace.qt } } {
+        QTrace::Initialize p9 mysim
+        QTrace::Start $qtfile mysim
+    }
 
-proc stop_qtrace { } {
-    QTrace::Stop mysim
+    proc stop_qtrace { } {
+        QTrace::Stop mysim
+    }
 }
diff --git a/external/mambo/skiboot.tcl b/external/mambo/skiboot.tcl
index 7f92a53e..df4dda27 100644
--- a/external/mambo/skiboot.tcl
+++ b/external/mambo/skiboot.tcl
@@ -1,5 +1,6 @@
 # need to get images path defined early
 source $env(LIB_DIR)/ppc/util.tcl
+source qtrace_utils.tcl
 
 #
 # Call tclreadline's Loop to move to friendlier
-- 
2.17.0



More information about the Skiboot mailing list