From bfb3cfdd9e22dc7c416f0379bdf4243be54be34f Mon Sep 17 00:00:00 2001 From: Stephen Sun Date: Thu, 13 Jul 2023 08:51:57 +0000 Subject: [PATCH] Adjust debug info Signed-off-by: Stephen Sun --- orchagent/pfcwdorch.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/orchagent/pfcwdorch.cpp b/orchagent/pfcwdorch.cpp index 54695b0a493..7c78f81d6ba 100644 --- a/orchagent/pfcwdorch.cpp +++ b/orchagent/pfcwdorch.cpp @@ -921,7 +921,6 @@ void PfcWdSwOrch::doTask(swss::NotificationConsumer if (!info.empty()) { info.pop_back(); - info = "(" + info + ")"; } sai_object_id_t queueId = SAI_NULL_OBJECT_ID; @@ -958,13 +957,26 @@ void PfcWdSwOrch::report_pfc_storm( { "queue_id", to_string(id) }, { "port_id", to_string(entry->portId) }}; - SWSS_LOG_NOTICE( - "PFC Watchdog detected PFC storm on port %s, queue index %d, queue id 0x%" PRIx64 " and port id 0x%" PRIx64 "%s.", + if (info.empty()) + { + SWSS_LOG_NOTICE( + "PFC Watchdog detected PFC storm on port %s, queue index %d, queue id 0x%" PRIx64 " and port id 0x%" PRIx64, + entry->portAlias.c_str(), + entry->index, + id, + entry->portId); + } + else + { + SWSS_LOG_NOTICE( + "PFC Watchdog detected PFC storm on port %s, queue index %d, queue id 0x%" PRIx64 " and port id 0x%" PRIx64 ", additional info: %s.", entry->portAlias.c_str(), entry->index, id, entry->portId, info.c_str()); + params["additional_info"] = info; + } event_publish(g_events_handle, "pfc-storm", ¶ms); }