From 105b2c8914946867f040caf6a8ff7da3c5d028d7 Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Tue, 8 Oct 2019 14:31:47 +0100 Subject: base: add the --debug-flag to DPRINTF output with FmtFlag This makes it easier to determine which messages come from which flags when enabling multiple flags at once. This commit covers the bulk of the debug messages, which use the DPRINTF* family of macros. There however macros that use DTRACE to check for enable, those will be covered in future patches. Change-Id: I6738b18f08ccfd1e11f2874b426c1827b42e82a2 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22004 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- util/systemc/gem5_within_systemc/sc_logger.cc | 6 +++--- util/systemc/gem5_within_systemc/sc_logger.hh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'util/systemc/gem5_within_systemc') diff --git a/util/systemc/gem5_within_systemc/sc_logger.cc b/util/systemc/gem5_within_systemc/sc_logger.cc index a8b9020f4..195a0cbaf 100644 --- a/util/systemc/gem5_within_systemc/sc_logger.cc +++ b/util/systemc/gem5_within_systemc/sc_logger.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 ARM Limited + * Copyright (c) 2014, 2019 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -79,7 +79,7 @@ class CuttingStreambuf : public std::streambuf void CuttingStreambuf::outputLine() { - logger->logMessage((Tick)-1, "gem5", line.str()); + logger->logMessage((Tick)-1, "gem5", "", line.str()); line.clear(); line.str(""); } @@ -133,7 +133,7 @@ Logger::~Logger() /** Log a single message as a single sc_report call */ void Logger::logMessage(Tick when, const std::string &name, - const std::string &message) + const std::string &flag, const std::string &message) { /* Need to chop the newline off the message */ std::string message_without_nl = message; diff --git a/util/systemc/gem5_within_systemc/sc_logger.hh b/util/systemc/gem5_within_systemc/sc_logger.hh index 4143f8bb8..0f9c6a18f 100644 --- a/util/systemc/gem5_within_systemc/sc_logger.hh +++ b/util/systemc/gem5_within_systemc/sc_logger.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 ARM Limited + * Copyright (c) 2014, 2019 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -70,7 +70,7 @@ class Logger : public Trace::Logger /** Log a single message as a single sc_report call */ void logMessage(Tick when, const std::string &name, - const std::string &message); + const std::string &flag, const std::string &message) override; std::ostream &getOstream(); }; -- cgit v1.2.3