Add PrettyName and Log property to faultlog dump entry This patch adds the PrettyName and Log properties into the logs generated by CreateDump on single host platforms. This is provided as an option when these fields need to be specified as described in https://docs.google.com/document/d/16UcJpx76q0irOjvuBoFRThqIEq6qnn4HeHxMEWIOGeY/edit?resourcekey=0-wVY8Aq-D5fEOhSXyhZ442Q&tab=t.0 Google-Bug-Id: 548715074 Tested: https://paste.googleplex.com/4842358326820864 Fusion-Link: fusion2 n/a this is not tested by fusion Change-Id: I40e22180d8a056611fed850e6846554901bd6e27 Signed-off-by: David Tang <davtang@google.com>
diff --git a/recipes-phosphor/dump/phosphor-debug-collector/0007-Add-PrettyName-and-Log-property-to-faultlog-dump.patch b/recipes-phosphor/dump/phosphor-debug-collector/0007-Add-PrettyName-and-Log-property-to-faultlog-dump.patch new file mode 100644 index 0000000..b0b3b72 --- /dev/null +++ b/recipes-phosphor/dump/phosphor-debug-collector/0007-Add-PrettyName-and-Log-property-to-faultlog-dump.patch
@@ -0,0 +1,152 @@ +From a7ab75e73944539e567c8d8448b8a93f7178953d Mon Sep 17 00:00:00 2001 +From: David Tang <davtang@google.com> +Date: Thu, 20 Aug 2026 17:20:33 +0000 +Subject: [PATCH] Add PrettyName and Log property to faultlog dump entry + +Signed-off-by: David Tang <davtang@google.com> +--- + dump_manager_faultlog.cpp | 46 +++++++++++++++++++++++++++++++++++++-- + dump_manager_faultlog.hpp | 3 +++ + faultlog_dump_entry.hpp | 7 +++++- + 3 files changed, 53 insertions(+), 3 deletions(-) + +diff --git a/dump_manager_faultlog.cpp b/dump_manager_faultlog.cpp +index 28286db..96393f7 100644 +--- a/dump_manager_faultlog.cpp ++++ b/dump_manager_faultlog.cpp +@@ -58,12 +58,15 @@ sdbusplus::message::object_path + { + FaultLogTypes entryType = FaultLogTypes::Crashdump; + std::string primaryLogIdStr; ++ std::string prettyNameStr; ++ std::string logStr; + uint64_t faultId = 0; + uint64_t faultTimestamp = 0; + + log<level::INFO>("In dump_manager_faultlog.cpp createDump"); + + getAndCheckCreateDumpParams(params, entryType, primaryLogIdStr, ++ prettyNameStr, logStr, + faultId, faultTimestamp); + + // To stay within the limit of MAX_NUM_FAULT_LOG_ENTRIES we need to remove +@@ -212,7 +215,8 @@ sdbusplus::message::object_path + faultLogFilePath, + phosphor::dump::OperationStatus::Completed, + originatorId, originatorType, entryType, +- primaryLogIdStr, *this, &entries, faultId))); ++ primaryLogIdStr, prettyNameStr, logStr, ++ *this, &entries, faultId))); + } + catch (const std::invalid_argument& e) + { +@@ -706,7 +710,8 @@ void Manager::createDumpFromCrashdumpSignal(sdbusplus::message_t& msg) + + void Manager::getAndCheckCreateDumpParams( + const phosphor::dump::DumpCreateParams& params, FaultLogTypes& entryType, +- std::string& primaryLogIdStr, uint64_t& faultId, uint64_t& faultTimestamp) ++ std::string& primaryLogIdStr, std::string& prettyNameStr, ++ std::string& logStr, uint64_t& faultId, uint64_t& faultTimestamp) + { + using InvalidArgument = + sdbusplus::xyz::openbmc_project::Common::Error::InvalidArgument; +@@ -790,6 +795,43 @@ void Manager::getAndCheckCreateDumpParams( + primaryLogIdStr = value; + } + ++ iter = params.find("PrettyName"); ++ if (iter != params.end()) ++ { ++ try ++ { ++ prettyNameStr = std::get<std::string>(iter->second); ++ } ++ catch (const std::bad_variant_access& e) ++ { ++ log<level::ERR>( ++ std::format( ++ "An invalid PrettyName string is passed errormsg({})", ++ e.what()) ++ .c_str()); ++ elog<InvalidArgument>(Argument::ARGUMENT_NAME("PRETTYNAME"), ++ Argument::ARGUMENT_VALUE("INVALID INPUT")); ++ } ++ } ++ ++ iter = params.find("Log"); ++ if (iter != params.end()) ++ { ++ try ++ { ++ logStr = std::get<std::string>(iter->second); ++ } ++ catch (const std::bad_variant_access& e) ++ { ++ log<level::ERR>( ++ std::format("An invalid Log string is passed errormsg({})", ++ e.what()) ++ .c_str()); ++ elog<InvalidArgument>(Argument::ARGUMENT_NAME("LOG"), ++ Argument::ARGUMENT_VALUE("INVALID INPUT")); ++ } ++ } ++ + faultId = 0; + iter = params.find("Id"); + if (iter != params.end()) +diff --git a/dump_manager_faultlog.hpp b/dump_manager_faultlog.hpp +index a1d25f4..26aa131 100644 +--- a/dump_manager_faultlog.hpp ++++ b/dump_manager_faultlog.hpp +@@ -183,6 +183,8 @@ class Manager : + * @param[out] entryType - Log entry type (corresponding to type of data in + * primary fault data log) + * @param[out] primaryLogIdStr - Id of primary fault data log ++ * @param[out] prettyNameStr - Name of log entry (optional) ++ * @param[out] logStr - Full file path of the log file (optional) + * @param[out] faultId - Id of primary fault data log (adopted only in + * server3 / multi-host platforms, defaults to 0 if absent) + * @param[out] faultTimestamp - Timestamp of primary fault data log +@@ -192,6 +194,7 @@ class Manager : + void getAndCheckCreateDumpParams( + const phosphor::dump::DumpCreateParams& params, + FaultLogTypes& entryType, std::string& primaryLogIdStr, ++ std::string& prettyNameStr, std::string& logStr, + uint64_t& faultId, uint64_t& faultTimestamp); + + /** @brief Generate the current timestamp, adjusting as needed to ensure an +diff --git a/faultlog_dump_entry.hpp b/faultlog_dump_entry.hpp +index fc29ac9..25cc15d 100644 +--- a/faultlog_dump_entry.hpp ++++ b/faultlog_dump_entry.hpp +@@ -57,6 +57,8 @@ class Entry : virtual public phosphor::dump::Entry, virtual public EntryIfaces + * @param[in] status - status of the dump. + * @param[in] originatorId - Id of the originator of the dump + * @param[in] originatorType - Originator type ++ * @param[in] prettyNameStr - The name of the log entry. ++ * @param[in] logStr - The full path of the log file. + * @param[in] parent - The dump entry's parent. + * @param[in] faultId - Fault id (adopted only in server3 / multi-host + * platforms, defaults to 0 if not provided). +@@ -66,7 +68,8 @@ class Entry : virtual public phosphor::dump::Entry, virtual public EntryIfaces + const std::filesystem::path& file, + phosphor::dump::OperationStatus status, std::string originatorId, + originatorTypes originatorType, FaultLogTypes entryType, +- const std::string& primaryLogIdStr, phosphor::dump::Manager& parent, ++ const std::string& primaryLogIdStr, const std::string& prettyNameStr, ++ const std::string& logStr, phosphor::dump::Manager& parent, + std::map<uint32_t, std::unique_ptr<phosphor::dump::Entry>>* parentMap, + uint64_t faultId = 0) : + phosphor::dump::Entry(bus, objPath.c_str(), dumpId, timeStamp, fileSize, +@@ -77,6 +80,8 @@ class Entry : virtual public phosphor::dump::Entry, virtual public EntryIfaces + { + type(entryType); + primaryLogId(primaryLogIdStr); ++ prettyName(prettyNameStr); ++ log(logStr); + if (faultId != 0) + { + faultIdTable.emplace(faultId, dumpId); +-- +2.55.0.860.g4b6b3295ed-goog +
diff --git a/recipes-phosphor/dump/phosphor-debug-collector_%.bbappend b/recipes-phosphor/dump/phosphor-debug-collector_%.bbappend index fcb64e3..a446243 100644 --- a/recipes-phosphor/dump/phosphor-debug-collector_%.bbappend +++ b/recipes-phosphor/dump/phosphor-debug-collector_%.bbappend
@@ -8,6 +8,7 @@ file://0004-add-iliad-cper-signal-handler.patch \ file://0005-dump-harden-against-concurrent-file-deletions.patch \ file://0006-use-sdbusplus-enum-converter-for-faultlog-types.patch \ + file://0007-Add-PrettyName-and-Log-property-to-faultlog-dump.patch \ " SRC_URI:append = " \