Daniel Carvalho has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/39077 )

Change subject: scons: Add an "All" compound debug flag
......................................................................

scons: Add an "All" compound debug flag

Add an "All" compound debug flag, which encapsulates all
debug flags.

Since this is the broadest compound flag, allowing users
to include it would imply in extremely generic includes.
Moreover, it is highly unlikely that any correct C++ code
would ever use all debug flags. Therefore, a header file
for this flag is not generated to force users to directly
include only the debug flags they need.

Change-Id: If40f2f708be1495fa2b2380266164d5d44d7cffa
Signed-off-by: Daniel R. Carvalho <oda...@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39077
Tested-by: kokoro <noreply+kok...@google.com>
Reviewed-by: Nathanael Premillieu <nathanael.premill...@huawei.com>
Maintainer: Bobby R. Bruce <bbr...@ucdavis.edu>
---
M src/SConscript
M src/python/m5/debug.py
2 files changed, 20 insertions(+), 1 deletion(-)

Approvals:
  Nathanael Premillieu: Looks good to me, approved
  Bobby R. Bruce: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/SConscript b/src/SConscript
index 6637b1f..81a1b4d 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -633,6 +633,19 @@
 def DebugFormatFlag(name, desc=None):
     DebugFlag(name, desc, True)

+# Create a compound debug flag that encapsulates all flags: "All". This
+# flag should not be used within C++ code - it is a compound meta flag
+def _createAllDebugFlag():
+    simple_flags = []
+    for name,flag in sorted(debug_flags.items()):
+        n, compound, desc, fmt = flag
+        assert n == name
+        if not compound and not fmt:
+            simple_flags.append(n)
+
+    CompoundFlag("All", simple_flags,
+        "Controls all debug flags. It should not be used within C++ code.")
+
 Export('DebugFlag')
 Export('CompoundFlag')
 Export('DebugFormatFlag')
@@ -1174,6 +1187,8 @@

     code.write(str(target[0]))

+# Generate the files for the debug and debug-format flags
+_createAllDebugFlag()
 for name,flag in sorted(debug_flags.items()):
     n, compound, desc, fmt = flag
     assert n == name
diff --git a/src/python/m5/debug.py b/src/python/m5/debug.py
index fbcb624..d808850 100644
--- a/src/python/m5/debug.py
+++ b/src/python/m5/debug.py
@@ -43,7 +43,11 @@
     for name, flag in filter(lambda kv: isinstance(kv[1], CompoundFlag),
                              sorted_flags):
         print("    %s: %s" % (name, flag.desc))
-        printList([ c.name for c in flag.kids() ], indent=8)
+        # The list of kids for flag "All" is too long, so it is not printed
+        if name != "All":
+            printList([ c.name for c in flag.kids() ], indent=8)
+        else:
+            print("        All Base Flags")
     print()
     print("Formatting Flags:")
     for name, flag in filter(lambda kv: isinstance(kv[1], SimpleFlag)



The change was submitted with unreviewed changes in the following files:

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/39077
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: If40f2f708be1495fa2b2380266164d5d44d7cffa
Gerrit-Change-Number: 39077
Gerrit-PatchSet: 7
Gerrit-Owner: Daniel Carvalho <oda...@yahoo.com.br>
Gerrit-Reviewer: Bobby R. Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Daniel Carvalho <oda...@yahoo.com.br>
Gerrit-Reviewer: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: Nathanael Premillieu <nathanael.premill...@huawei.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to