sim,python: add activate option and method

With --debug-activate option, user can add the target names into
activate list of debug log.

For example, with "--debug-activate=system.AAA.bus --debug-flags=IOXBar"
We can enable the logs of a specified bus.

Change-Id: I89ce87d784ae9736708bbc976a6bad58732bd5da
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/70618
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
This commit is contained in:
Yan Lee
2023-05-15 00:32:32 -07:00
parent b923cbe840
commit 48ae255762
3 changed files with 21 additions and 1 deletions

View File

@@ -67,6 +67,14 @@ output(const char *filename)
trace::setDebugLogger(new trace::OstreamLogger(*file_stream->stream()));
}
static void
activate(const char *expr)
{
ObjectMatch activate(expr);
trace::getDebugLogger()->addActivate(activate);
}
static void
ignore(const char *expr)
{
@@ -121,6 +129,7 @@ pybind_init_debug(py::module_ &m_native)
py::module_ m_trace = m_native.def_submodule("trace");
m_trace
.def("output", &output)
.def("activate", &activate)
.def("ignore", &ignore)
.def("enable", &trace::enable)
.def("disable", &trace::disable)