python: Add missing defines import

The _check_tracing helper function in depends on defines to
check if tracing has been enabled at compile time. This module is
imported in main() but not at the module level, which breaks this

Change-Id: I26d65a4320da8618e0e552553695884fd2c880e0
Signed-off-by: Andreas Sandberg <>
Reviewed-by: Giacomo Travaglini <>
diff --git a/src/python/m5/ b/src/python/m5/
index 8a259f3..08b1464 100644
--- a/src/python/m5/
+++ b/src/python/m5/
@@ -193,6 +193,8 @@
 def _check_tracing():
+    import defines
     if defines.TRACING_ON: