phosphor-debug-collector: fix phosphor-dump-manager crash in multihost
cper patch and rebase patches.

Background:
On multi-host platforms, injecting crashdump/CPER error events on
secondary nodes (node 1, node 2) caused phosphor-dump-manager to
crash with segmentation faults (SEGV) and std::out_of_range exceptions.
This was caused by two main issues:
1. faultIdTable was defined as a global inline table shared across all
   host managers in the process. When one host looked up a faultId
   registered by another host, calling entries.at() on its own map threw
   std::out_of_range.

Solution:
1. Move faultIdTable from a global variable into an instance member of
   Manager, ensuring complete host isolation.
2. Replace unchecked entries.at() lookups with entries.find() and clean
   up stale entries if not found.

Changes Made:
- dump_manager_faultlog.hpp:
  - Add faultIdTable instance member to Manager.
- dump_manager_faultlog.cpp:
  - Update createDump() to pass &faultIdTable to faultlog::Entry.
  - Safe lookup in faultIdTable via entries.find() instead of at().
  - Fix faultLogFilePath construction using path operator/.
- faultlog_dump_entry.hpp:
  - Remove global faultIdTable and accept faultIdTableMap pointer in
    Entry constructor.
- faultlog_dump_entry.cpp:
  - Erase from faultIdTableMap before parentMap->erase(id).

Tested:
```
On server3 amd platform
Verified multi-host error injection across node 1 and node 2 on target.
Confirmed that crashdump and CPER fault log entries are
created, replaced, and deleted without crashing or memory corruption.
```

Fusion-Link:
platform5: https://fusion2.corp.google.com/24b076cd-6709-3973-9119-46a49784f9ec
platform15: https://fusion2.corp.google.com/fa4fd09b-f45c-31a7-b2b9-a85dc36eeb0f
platform18: https://fusion2.corp.google.com/20dcaf3d-8bd4-35e6-a94a-1f0598913f93
platform17: https://fusion2.corp.google.com/03c22596-6265-3169-bd40-b040256119ef
platform11+ext: https://fusion2.corp.google.com/49713010-0073-3960-839e-fdc8abc29d07
platform11: https://fusion2.corp.google.com/07a0f1c6-6bc0-3925-a0f4-1d2785b262e4
platform25: https://fusion2.corp.google.com/dc3636e4-3f72-31b7-ab64-4f33623c3b3d

Google-Bug-Id:553850432
Change-Id: If317aae9e394b82b402b108c3b2867e053354dc6
Signed-off-by: cmchang <cmchang@google.com>
diff --git a/recipes-phosphor/dump/phosphor-debug-collector/0003-phosphor-dump-manager-multihost-support.patch b/recipes-phosphor/dump/phosphor-debug-collector/0003-phosphor-dump-manager-multihost-support.patch
index 346e831..6cf5f7d 100644
--- a/recipes-phosphor/dump/phosphor-debug-collector/0003-phosphor-dump-manager-multihost-support.patch
+++ b/recipes-phosphor/dump/phosphor-debug-collector/0003-phosphor-dump-manager-multihost-support.patch
@@ -1,20 +1,20 @@
-From 3c91b950cb34b4fc085182d2b0c67f4658811810 Mon Sep 17 00:00:00 2001
+From 7a3c006e65d172f8d26fd30240904671ca27abd2 Mon Sep 17 00:00:00 2001
 From: Jimmy Chang <cmchang@google.com>
 Date: Mon, 8 Dec 2025 15:13:09 +0000
-Subject: [PATCH 1/3] phosphor dump manager multihost support
+Subject: [PATCH 1/5] phosphor dump manager multihost support
 
 ---
- dump_manager_faultlog.cpp | 224 ++++++++++++++++++++++++++++++++++----
- dump_manager_faultlog.hpp |  53 +++++++--
- dump_manager_main.cpp     |  26 +++--
- faultlog_dump_entry.cpp   |   4 +
- faultlog_dump_entry.hpp   |  29 +++--
+ dump_manager_faultlog.cpp | 247 ++++++++++++++++++++++++++++++++++----
+ dump_manager_faultlog.hpp |  56 +++++++--
+ dump_manager_main.cpp     |  26 ++--
+ faultlog_dump_entry.cpp   |   7 +-
+ faultlog_dump_entry.hpp   |  32 +++--
  meson.build               |   3 +
  meson.options             |   5 +
- 7 files changed, 299 insertions(+), 45 deletions(-)
+ 7 files changed, 328 insertions(+), 48 deletions(-)
 
 diff --git a/dump_manager_faultlog.cpp b/dump_manager_faultlog.cpp
-index c4e80be..246344e 100644
+index c4e80be..45b7f5b 100644
 --- a/dump_manager_faultlog.cpp
 +++ b/dump_manager_faultlog.cpp
 @@ -45,10 +45,13 @@ sdbusplus::message::object_path
@@ -32,7 +32,7 @@
  
      // To stay within the limit of MAX_NUM_FAULT_LOG_ENTRIES we need to remove
      // an entry from the fault log map to make room for creating a new entry
-@@ -60,6 +63,82 @@ sdbusplus::message::object_path
+@@ -60,6 +63,90 @@ sdbusplus::message::object_path
          saveEarliestEntry();
      }
  
@@ -88,26 +88,34 @@
 +        auto it = faultIdTable.find(faultId);
 +        if (it != faultIdTable.end())
 +        {
-+            auto& entry = dynamic_cast<faultlog::Entry&>(*entries.at(it->second));
-+            switch (decide(entry))
++            auto entryIt = entries.find(it->second);
++            if (entryIt != entries.end())
 +            {
-+                case Action::Duplicate:
-+                    lg2::info("Duplicate faultlog detected");
-+                    return (std::filesystem::path(baseEntryPath) /
-+                            std::to_string(entry.getDumpId()))
-+                        .string();
++                auto& entry = dynamic_cast<faultlog::Entry&>(*entryIt->second);
++                switch (decide(entry))
++                {
++                    case Action::Duplicate:
++                        lg2::info("Duplicate faultlog detected");
++                        return (std::filesystem::path(baseEntryPath) /
++                                std::to_string(entry.getDumpId()))
++                            .string();
 +
-+                case Action::Ignore:
-+                    lg2::info("Ignore lower priority faultlog");
-+                    return (std::filesystem::path(baseEntryPath) /
-+                            std::to_string(entry.getDumpId()))
-+                        .string();
++                    case Action::Ignore:
++                        lg2::info("Ignore lower priority faultlog");
++                        return (std::filesystem::path(baseEntryPath) /
++                                std::to_string(entry.getDumpId()))
++                            .string();
 +
-+                case Action::Replace:
-+                    isEntryReplaced = true;
-+                    id = it->second;
-+                    entry.delete_();
-+                    break;
++                    case Action::Replace:
++                        isEntryReplaced = true;
++                        id = it->second;
++                        entry.delete_();
++                        break;
++                }
++            }
++            else
++            {
++                faultIdTable.erase(it);
 +            }
 +        }
 +    }
@@ -115,7 +123,7 @@
      // Get the originator id and type from params
      std::string originatorId;
      originatorTypes originatorType;
-@@ -67,8 +146,6 @@ sdbusplus::message::object_path
+@@ -67,8 +154,6 @@ sdbusplus::message::object_path
      phosphor::dump::extractOriginatorProperties(params, originatorId,
                                                  originatorType);
  
@@ -124,18 +132,19 @@
      auto idString = std::to_string(id);
      auto objPath = std::filesystem::path(baseEntryPath) / idString;
  
-@@ -76,8 +153,9 @@ sdbusplus::message::object_path
+@@ -76,8 +161,9 @@ sdbusplus::message::object_path
          std::format("next entry id: {}, entries.size(): {}", id, entries.size())
              .c_str());
  
-+    const std::string hostprefix = IsMultiHost() ? hostId + "_" : "";
-     std::filesystem::path faultLogFilePath(std::string(FAULTLOG_DUMP_PATH) +
+-    std::filesystem::path faultLogFilePath(std::string(FAULTLOG_DUMP_PATH) +
 -                                           idString);
-+                                           hostprefix + idString);
++    const std::string hostprefix = IsMultiHost() ? hostId + "_" : "";
++    std::filesystem::path faultLogFilePath =
++        std::filesystem::path(FAULTLOG_DUMP_PATH) / (hostprefix + idString);
      std::ofstream faultLogFile;
  
      errno = 0;
-@@ -87,10 +165,18 @@ sdbusplus::message::object_path
+@@ -87,10 +173,18 @@ sdbusplus::message::object_path
  
      if (faultLogFile.is_open())
      {
@@ -157,7 +166,7 @@
  
          faultLogFile.close();
      }
-@@ -107,14 +193,14 @@ sdbusplus::message::object_path
+@@ -107,14 +201,15 @@ sdbusplus::message::object_path
      try
      {
          lg2::info("dump_manager_faultlog.cpp: add faultlog entry");
@@ -176,11 +185,12 @@
 +                                   faultLogFilePath,
 +                                   phosphor::dump::OperationStatus::Completed,
 +                                   originatorId, originatorType, entryType,
-+                                   primaryLogIdStr, *this, &entries, faultId)));
++                                   primaryLogIdStr, *this, &entries,
++                                   &faultIdTable, faultId)));
      }
      catch (const std::invalid_argument& e)
      {
-@@ -124,7 +210,10 @@ sdbusplus::message::object_path
+@@ -124,7 +219,10 @@ sdbusplus::message::object_path
          elog<InternalFailure>();
      }
  
@@ -192,7 +202,15 @@
  
      lg2::info("End of dump_manager_faultlog.cpp createDump");
      return objPath.string();
-@@ -205,9 +294,10 @@ void Manager::registerCrashdumpAddedMatch()
+@@ -173,6 +271,7 @@ void Manager::deleteAll()
+ 
+     deleteAllSavedEntries(savedCperLogEntries);
+     deleteAllSavedEntries(savedCrashdumpEntries);
++    faultIdTable.clear();
+ }
+ 
+ void Manager::registerFaultLogMatches()
+@@ -205,9 +304,10 @@ void Manager::registerCrashdumpAddedMatch()
      }
      else if (std::string(CRASHDUMP_FORMAT) == "AMD")
      {
@@ -204,7 +222,7 @@
      }
      else
      {
-@@ -412,21 +502,66 @@ void Manager::registerCperLogMatch()
+@@ -412,21 +512,75 @@ void Manager::registerCperLogMatch()
  void Manager::createDumpFromCrashdumpSignal(sdbusplus::message_t& msg)
  {
      std::string objpath = msg.get_path();
@@ -266,7 +284,17 @@
 +    crashdumpMap.insert(std::pair<std::string, std::string>("PrimaryLogId",
 +                                                             filename));
  
-     createDump(crashdumpMap);
+-    createDump(crashdumpMap);
++    try
++    {
++        createDump(crashdumpMap);
++    }
++    catch (const std::exception& e)
++    {
++        lg2::error(
++            "Failed to create fault log dump from crashdump signal, errormsg: {ERROR}",
++            "ERROR", e);
++    }
  }
  
  void Manager::getAndCheckCreateDumpParams(
@@ -276,7 +304,7 @@
  {
      using InvalidArgument =
          sdbusplus::xyz::openbmc_project::Common::Error::InvalidArgument;
-@@ -507,6 +642,51 @@ void Manager::getAndCheckCreateDumpParams(
+@@ -507,6 +661,51 @@ void Manager::getAndCheckCreateDumpParams(
  
          primaryLogIdStr = value;
      }
@@ -329,7 +357,7 @@
  
  uint64_t Manager::generateTimestamp()
 diff --git a/dump_manager_faultlog.hpp b/dump_manager_faultlog.hpp
-index db65e0f..3af2e32 100644
+index db65e0f..87a818b 100644
 --- a/dump_manager_faultlog.hpp
 +++ b/dump_manager_faultlog.hpp
 @@ -10,6 +10,7 @@
@@ -405,8 +433,13 @@
    private:
      static constexpr uint32_t MAX_NUM_FAULT_LOG_ENTRIES =
          MAX_TOTAL_FAULT_LOG_ENTRIES - MAX_NUM_SAVED_CRASHDUMP_ENTRIES -
-@@ -99,6 +128,10 @@ class Manager :
+@@ -97,8 +126,15 @@ class Manager :
+     std::map<uint32_t, std::unique_ptr<phosphor::dump::Entry>>
+         savedCrashdumpEntries;
  
++    /** @brief Table mapping fault ID to dump ID */
++    std::unordered_map<uint64_t, uint32_t> faultIdTable;
++
      /** @brief Path to the dump file*/
      std::string dumpDir;
 +    /** @brief host Id of this manager */
@@ -416,7 +449,7 @@
  
      /** @brief D-Bus match for signal indicating crashdump was added*/
      std::unique_ptr<sdbusplus::bus::match_t> crashdumpAddedMatch;
-@@ -139,10 +172,16 @@ class Manager :
+@@ -139,10 +175,16 @@ 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
@@ -472,37 +505,33 @@
  
          // Restore dbus objects of all dumps
 diff --git a/faultlog_dump_entry.cpp b/faultlog_dump_entry.cpp
-index f9b25a5..daa0a6d 100644
+index f9b25a5..75a22de 100644
 --- a/faultlog_dump_entry.cpp
 +++ b/faultlog_dump_entry.cpp
-@@ -24,6 +24,10 @@ void Entry::delete_()
+@@ -22,7 +22,12 @@ void Entry::delete_()
+         lg2::error("Failed to delete dump file, errormsg: {ERROR}", "ERROR", e);
+     }
  
-     // Remove Dump entry D-bus object
-     parentMap->erase(id);
-+    if (this->faultId != 0)
+-    // Remove Dump entry D-bus object
++    if (this->faultId != 0 && this->faultIdTableMap != nullptr)
 +    {
-+        faultIdTable.erase(this->faultId);
++        this->faultIdTableMap->erase(this->faultId);
 +    }
++
++    // Remove Dump entry D-bus object (this deallocates `this`)
+     parentMap->erase(id);
  }
  
- } // namespace faultlog
 diff --git a/faultlog_dump_entry.hpp b/faultlog_dump_entry.hpp
-index 0d49dfd..fc29ac9 100644
+index 0d49dfd..60198ae 100644
 --- a/faultlog_dump_entry.hpp
 +++ b/faultlog_dump_entry.hpp
-@@ -27,6 +27,8 @@ using EntryIfaces = sdbusplus::server::object_t<
- using FaultLogTypes = sdbusplus::common::xyz::openbmc_project::common::
-     FaultLogType::FaultLogTypes;
- 
-+inline std::unordered_map<uint64_t, uint32_t> faultIdTable;
-+
- class Manager;
- 
- /** @class Entry
-@@ -56,23 +58,29 @@ class Entry : virtual public phosphor::dump::Entry, virtual public EntryIfaces
+@@ -56,23 +56,32 @@ class Entry : virtual public phosphor::dump::Entry, virtual public EntryIfaces
       *  @param[in] originatorId - Id of the originator of the dump
       *  @param[in] originatorType - Originator type
       *  @param[in] parent - The dump entry's parent.
++     *  @param[in] parentMap - Fault log map containing this entry.
++     *  @param[in] faultIdTableMap - Table mapping fault ID to dump ID.
 +     *  @param[in] faultId - Fault id (adopted only in server3 / multi-host
 +     * platforms, defaults to 0 if not provided).
       */
@@ -521,27 +550,30 @@
 +          originatorTypes originatorType, FaultLogTypes entryType,
 +          const std::string& primaryLogIdStr, phosphor::dump::Manager& parent,
 +          std::map<uint32_t, std::unique_ptr<phosphor::dump::Entry>>* parentMap,
++          std::unordered_map<uint64_t, uint32_t>* faultIdTableMap = nullptr,
 +          uint64_t faultId = 0) :
          phosphor::dump::Entry(bus, objPath.c_str(), dumpId, timeStamp, fileSize,
                                file, status, originatorId, originatorType,
                                parent),
          EntryIfaces(bus, objPath.c_str(), EntryIfaces::action::defer_emit),
 -        parentMap(parentMap)
-+        parentMap(parentMap), faultId(faultId)
++        parentMap(parentMap), faultIdTableMap(faultIdTableMap), faultId(faultId)
      {
          type(entryType);
          primaryLogId(primaryLogIdStr);
-+        if (faultId != 0)
++        if (faultId != 0 && faultIdTableMap != nullptr)
 +        {
-+            faultIdTable.emplace(faultId, dumpId);
++            faultIdTableMap->emplace(faultId, dumpId);
 +        }
  
          // Emit deferred signal.
          this->phosphor::dump::faultlog::EntryIfaces::emit_object_added();
-@@ -86,6 +94,9 @@ class Entry : virtual public phosphor::dump::Entry, virtual public EntryIfaces
+@@ -86,6 +95,11 @@ class Entry : virtual public phosphor::dump::Entry, virtual public EntryIfaces
      /** @brief Fault log map containing this entry (e.g. the main fault log map
       * or a saved entries map) */
      std::map<uint32_t, std::unique_ptr<phosphor::dump::Entry>>* parentMap;
++    /** @brief Table mapping fault ID to dump ID */
++    std::unordered_map<uint64_t, uint32_t>* faultIdTableMap;
 +    /** @brief Fault ID of primary fault data log (adopted only in server3 /
 +     * multi-host platforms) */
 +    uint64_t faultId;
@@ -579,5 +611,5 @@
          value : '/run/bmcweb/redfish/v1/Systems/system/LogServices/',
          description : 'File system path containing CPER logs'
 -- 
-2.55.0.679.g6767b8d81c-goog
+2.55.0.897.gb25b4bd76c-goog
 
diff --git a/recipes-phosphor/dump/phosphor-debug-collector/0004-add-iliad-cper-signal-handler.patch b/recipes-phosphor/dump/phosphor-debug-collector/0004-add-iliad-cper-signal-handler.patch
index a48fabb..6b4f297 100644
--- a/recipes-phosphor/dump/phosphor-debug-collector/0004-add-iliad-cper-signal-handler.patch
+++ b/recipes-phosphor/dump/phosphor-debug-collector/0004-add-iliad-cper-signal-handler.patch
@@ -1,7 +1,7 @@
-From 54cf95f9ef7e7c48988e5c2df9367105c0581c4a Mon Sep 17 00:00:00 2001
+From 44be7fffd541ff2c144052a193c31509d4aca6a1 Mon Sep 17 00:00:00 2001
 From: Changming Liu <cmliu@google.com>
 Date: Wed, 12 Nov 2025 19:12:01 +0000
-Subject: [PATCH 2/3] add iliad cper signal handler
+Subject: [PATCH 2/5] add iliad cper signal handler
 
 adapt to IliadCPER type for faultlog entry addition and deletion
 
@@ -14,7 +14,7 @@
  4 files changed, 177 insertions(+), 2 deletions(-)
 
 diff --git a/dump_manager_faultlog.cpp b/dump_manager_faultlog.cpp
-index 246344e..35bd5b8 100644
+index 45b7f5b..3fafe02 100644
 --- a/dump_manager_faultlog.cpp
 +++ b/dump_manager_faultlog.cpp
 @@ -40,6 +40,16 @@ using ChangedPropertiesType =
@@ -34,7 +34,7 @@
  sdbusplus::message::object_path
      Manager::createDump(phosphor::dump::DumpCreateParams params)
  {
-@@ -174,6 +184,10 @@ sdbusplus::message::object_path
+@@ -182,6 +192,10 @@ sdbusplus::message::object_path
          {
              logType = "CPER";
          }
@@ -45,7 +45,7 @@
  
          faultLogFile << "Fault log file type " << logType << " id "
                       << primaryLogIdStr << std::endl;
-@@ -270,6 +284,7 @@ void Manager::registerFaultLogMatches()
+@@ -280,6 +294,7 @@ void Manager::registerFaultLogMatches()
  
      registerAllCrashdumpMatches();
      registerCperLogMatch();
@@ -53,7 +53,7 @@
  }
  
  void Manager::registerAllCrashdumpMatches()
-@@ -499,6 +514,138 @@ void Manager::registerCperLogMatch()
+@@ -509,6 +524,138 @@ void Manager::registerCperLogMatch()
          });
  }
  
@@ -192,7 +192,7 @@
  void Manager::createDumpFromCrashdumpSignal(sdbusplus::message_t& msg)
  {
      std::string objpath = msg.get_path();
-@@ -600,9 +747,15 @@ void Manager::getAndCheckCreateDumpParams(
+@@ -619,9 +766,15 @@ void Manager::getAndCheckCreateDumpParams(
          {
              entryType = FaultLogTypes::CPER;
          }
@@ -210,7 +210,7 @@
                                    Argument::ARGUMENT_VALUE("UNEXPECTED TYPE"));
          }
 diff --git a/dump_manager_faultlog.hpp b/dump_manager_faultlog.hpp
-index 3af2e32..a1d25f4 100644
+index 87a818b..8190222 100644
 --- a/dump_manager_faultlog.hpp
 +++ b/dump_manager_faultlog.hpp
 @@ -71,7 +71,6 @@ class Manager :
@@ -221,7 +221,7 @@
          registerFaultLogMatches();
      }
  
-@@ -139,6 +138,10 @@ class Manager :
+@@ -142,6 +141,10 @@ class Manager :
      std::unique_ptr<sdbusplus::bus::match_t> crashdumpRemovedMatch;
      /** @brief D-Bus match for signal indicating all crashdumps were deleted*/
      std::unique_ptr<sdbusplus::bus::match_t> crashdumpDeleteAllMatch;
@@ -232,7 +232,7 @@
  
      /** @brief D-Bus match for CPER log added signal */
      std::unique_ptr<sdbusplus::bus::match_t> cperLogMatch;
-@@ -159,13 +162,21 @@ class Manager :
+@@ -162,13 +165,21 @@ class Manager :
      void registerCrashdumpDeleteAllMatch();
      /** @brief Register D-Bus match rules to detect CPER logs */
      void registerCperLogMatch();
@@ -288,5 +288,5 @@
  
  # System dump options
 -- 
-2.55.0.679.g6767b8d81c-goog
+2.55.0.897.gb25b4bd76c-goog
 
diff --git a/recipes-phosphor/dump/phosphor-debug-collector/0005-dump-harden-against-concurrent-file-deletions.patch b/recipes-phosphor/dump/phosphor-debug-collector/0005-dump-harden-against-concurrent-file-deletions.patch
index e74430b..6ec8f0e 100644
--- a/recipes-phosphor/dump/phosphor-debug-collector/0005-dump-harden-against-concurrent-file-deletions.patch
+++ b/recipes-phosphor/dump/phosphor-debug-collector/0005-dump-harden-against-concurrent-file-deletions.patch
@@ -1,7 +1,7 @@
-From 0ee9150bfcfef3f1e86308bedfb4e159a4686041 Mon Sep 17 00:00:00 2001
+From 2318f0451db71bed8d64235947d16cd4765c3e1f Mon Sep 17 00:00:00 2001
 From: Andy Sun <andysunmh@google.com>
 Date: Sun, 7 Jun 2026 14:36:26 +0000
-Subject: [PATCH 3/3] dump: harden against concurrent file deletions
+Subject: [PATCH 3/5] dump: harden against concurrent file deletions
 
 phosphor-dump-manager crashed (SIGABRT) during frequent coredumps when
 concurrent file deletions by dreport caused uncaught filesystem_error
@@ -118,5 +118,5 @@
  
      return 0;
 -- 
-2.55.0.679.g6767b8d81c-goog
+2.55.0.897.gb25b4bd76c-goog
 
diff --git a/recipes-phosphor/dump/phosphor-debug-collector/0006-use-sdbusplus-enum-converter-for-faultlog-types.patch b/recipes-phosphor/dump/phosphor-debug-collector/0006-use-sdbusplus-enum-converter-for-faultlog-types.patch
index abe233a..84ec290 100644
--- a/recipes-phosphor/dump/phosphor-debug-collector/0006-use-sdbusplus-enum-converter-for-faultlog-types.patch
+++ b/recipes-phosphor/dump/phosphor-debug-collector/0006-use-sdbusplus-enum-converter-for-faultlog-types.patch
@@ -1,5 +1,18 @@
+From cb0de867ee9fe2ef314b5809532ebef01af47006 Mon Sep 17 00:00:00 2001
+From: Ron Vered <ronvered@google.com>
+Date: Thu, 23 Jul 2026 20:23:20 +0000
+Subject: [PATCH 4/5] Use FaultLogType converter and introduce new MetisCPER
+ type
+
+---
+ dump_manager_faultlog.cpp   |  44 +++++-------
+ test/faultlog_dump_test.cpp | 140 ++++++++++++++++++++++++++++++++++++
+ test/meson.build            |  37 ++++++++++
+ 3 files changed, 196 insertions(+), 25 deletions(-)
+ create mode 100644 test/faultlog_dump_test.cpp
+
 diff --git a/dump_manager_faultlog.cpp b/dump_manager_faultlog.cpp
-index 49c1b3e..ab277ff 100644
+index 3fafe02..f2fd2f1 100644
 --- a/dump_manager_faultlog.cpp
 +++ b/dump_manager_faultlog.cpp
 @@ -40,6 +40,9 @@ using ChangedPropertiesType =
@@ -12,7 +25,7 @@
  static std::string getTypeFromPath(const std::filesystem::path& path)
  {
      return path.parent_path().parent_path().filename();
-@@ -99,17 +102,12 @@ sdbusplus::message::object_path
+@@ -184,17 +187,12 @@ sdbusplus::message::object_path
      if (faultLogFile.is_open())
      {
          std::string logType = "Invalid";
@@ -21,21 +34,21 @@
 -            logType = "Crashdump";
 -        }
 -        else if (entryType == FaultLogTypes::CPER)
+-        {
+-            logType = "CPER";
+-        }
+-        else if (entryType == FaultLogTypes::IliadCPER)
 +        auto converted = sdbusplus::common::xyz::openbmc_project::common::
 +            FaultLogType::convertFaultLogTypesToString(entryType);
 +        if (converted.starts_with(faultLogTypePrefix))
          {
--            logType = "CPER";
--        }
--        else if (entryType == FaultLogTypes::IliadCPER)
--        {
 -            logType = "IliadCPER";
 +            logType = converted.substr(
 +                std::string_view(faultLogTypePrefix).length());
          }
  
          faultLogFile << "Fault log file type " << logType << " id "
-@@ -643,26 +641,22 @@ void Manager::getAndCheckCreateDumpParams(
+@@ -758,26 +756,22 @@ void Manager::getAndCheckCreateDumpParams(
                                    Argument::ARGUMENT_VALUE("INVALID INPUT"));
          }
  
@@ -44,6 +57,14 @@
 -            entryType = FaultLogTypes::Crashdump;
 -        }
 -        else if (value == "CPER")
+-        {
+-            entryType = FaultLogTypes::CPER;
+-        }
+-        else if (value == "IliadCPER")
+-        {
+-            entryType = FaultLogTypes::IliadCPER;
+-        }
+-        else
 +        std::string fullTypeStr =
 +            value.starts_with(faultLogTypePrefix) ? value : faultLogTypePrefix + value;
 +
@@ -51,32 +72,23 @@
 +            FaultLogType::convertStringToFaultLogTypes(fullTypeStr);
 +        if (!parsed.has_value())
          {
--            entryType = FaultLogTypes::CPER;
-+            log<level::ERR>(
-+                std::format("Unexpected entry type: {}", value).c_str());
-+            elog<InvalidArgument>(Argument::ARGUMENT_NAME("TYPE"),
-+                                  Argument::ARGUMENT_VALUE("UNEXPECTED TYPE"));
-         }
--        else if (value == "IliadCPER")
-+        else
-         {
--            entryType = FaultLogTypes::IliadCPER;
-+            entryType = *parsed;
-         }
--        else
--        {
--            log<level::ERR>(
+             log<level::ERR>(
 -                std::format("Unexpected entry type '{}', not handled", value)
 -                    .c_str());
--            elog<InvalidArgument>(Argument::ARGUMENT_NAME("TYPE"),
--                                  Argument::ARGUMENT_VALUE("UNEXPECTED TYPE"));
--        }
++                std::format("Unexpected entry type: {}", value).c_str());
+             elog<InvalidArgument>(Argument::ARGUMENT_NAME("TYPE"),
+                                   Argument::ARGUMENT_VALUE("UNEXPECTED TYPE"));
+         }
++        else
++        {
++            entryType = *parsed;
++        }
      }
  
      iter = params.find("PrimaryLogId");
 diff --git a/test/faultlog_dump_test.cpp b/test/faultlog_dump_test.cpp
 new file mode 100644
-index 0000000..fbb5208
+index 0000000..39f3cbf
 --- /dev/null
 +++ b/test/faultlog_dump_test.cpp
 @@ -0,0 +1,140 @@
@@ -221,7 +233,7 @@
 +} // namespace dump
 +} // namespace phosphor
 diff --git a/test/meson.build b/test/meson.build
-index a8cb358..04896e6 100644
+index a8cb358..e9a2f7b 100644
 --- a/test/meson.build
 +++ b/test/meson.build
 @@ -40,3 +40,40 @@ foreach t : tests
@@ -265,3 +277,6 @@
 +    test('faultlog_dump_test', faultlog_dump_test_exe,
 +         workdir: meson.current_source_dir())
 +endif
+-- 
+2.55.0.897.gb25b4bd76c-goog
+
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
index b0b3b72..50358d0 100644
--- 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
@@ -1,17 +1,17 @@
-From a7ab75e73944539e567c8d8448b8a93f7178953d Mon Sep 17 00:00:00 2001
+From 4d58c7d0d02ea4507ec93f48717bba37fa08af2f 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
+Subject: [PATCH 5/5] 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.cpp | 47 ++++++++++++++++++++++++++++++++++++---
  dump_manager_faultlog.hpp |  3 +++
  faultlog_dump_entry.hpp   |  7 +++++-
- 3 files changed, 53 insertions(+), 3 deletions(-)
+ 3 files changed, 53 insertions(+), 4 deletions(-)
 
 diff --git a/dump_manager_faultlog.cpp b/dump_manager_faultlog.cpp
-index 28286db..96393f7 100644
+index f2fd2f1..0874182 100644
 --- a/dump_manager_faultlog.cpp
 +++ b/dump_manager_faultlog.cpp
 @@ -58,12 +58,15 @@ sdbusplus::message::object_path
@@ -30,17 +30,18 @@
                                  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
+@@ -220,8 +223,8 @@ sdbusplus::message::object_path
                                     faultLogFilePath,
                                     phosphor::dump::OperationStatus::Completed,
                                     originatorId, originatorType, entryType,
--                                   primaryLogIdStr, *this, &entries, faultId)));
+-                                   primaryLogIdStr, *this, &entries,
+-                                   &faultIdTable, faultId)));
 +                                   primaryLogIdStr, prettyNameStr, logStr,
-+                                   *this, &entries, faultId)));
++                                   *this, &entries, &faultIdTable, faultId)));
      }
      catch (const std::invalid_argument& e)
      {
-@@ -706,7 +710,8 @@ void Manager::createDumpFromCrashdumpSignal(sdbusplus::message_t& msg)
+@@ -725,7 +728,8 @@ void Manager::createDumpFromCrashdumpSignal(sdbusplus::message_t& msg)
  
  void Manager::getAndCheckCreateDumpParams(
      const phosphor::dump::DumpCreateParams& params, FaultLogTypes& entryType,
@@ -50,7 +51,7 @@
  {
      using InvalidArgument =
          sdbusplus::xyz::openbmc_project::Common::Error::InvalidArgument;
-@@ -790,6 +795,43 @@ void Manager::getAndCheckCreateDumpParams(
+@@ -809,6 +813,43 @@ void Manager::getAndCheckCreateDumpParams(
          primaryLogIdStr = value;
      }
  
@@ -95,10 +96,10 @@
      iter = params.find("Id");
      if (iter != params.end())
 diff --git a/dump_manager_faultlog.hpp b/dump_manager_faultlog.hpp
-index a1d25f4..26aa131 100644
+index 8190222..f58afb5 100644
 --- a/dump_manager_faultlog.hpp
 +++ b/dump_manager_faultlog.hpp
-@@ -183,6 +183,8 @@ class Manager :
+@@ -186,6 +186,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
@@ -107,7 +108,7 @@
       *  @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 :
+@@ -195,6 +197,7 @@ class Manager :
      void getAndCheckCreateDumpParams(
          const phosphor::dump::DumpCreateParams& params,
          FaultLogTypes& entryType, std::string& primaryLogIdStr,
@@ -116,18 +117,18 @@
  
      /** @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
+index 60198ae..405b557 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
+@@ -55,6 +55,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).
+      *  @param[in] parentMap - Fault log map containing this entry.
+      *  @param[in] faultIdTableMap - Table mapping fault ID to dump ID.
 @@ -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,
@@ -136,17 +137,17 @@
 +          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,
+           std::unordered_map<uint64_t, uint32_t>* faultIdTableMap = nullptr,
            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
+@@ -78,6 +81,8 @@ class Entry : virtual public phosphor::dump::Entry, virtual public EntryIfaces
      {
          type(entryType);
          primaryLogId(primaryLogIdStr);
 +        prettyName(prettyNameStr);
 +        log(logStr);
-         if (faultId != 0)
+         if (faultId != 0 && faultIdTableMap != nullptr)
          {
-             faultIdTable.emplace(faultId, dumpId);
+             faultIdTableMap->emplace(faultId, dumpId);
 -- 
-2.55.0.860.g4b6b3295ed-goog
+2.55.0.897.gb25b4bd76c-goog
 
diff --git a/recipes-phosphor/dump/phosphor-debug-collector/0008-Add-DumpPrefix-property-to-faultlog-dump.patch b/recipes-phosphor/dump/phosphor-debug-collector/0008-Add-DumpPrefix-property-to-faultlog-dump.patch
index 7c8e581..10d2e37 100644
--- a/recipes-phosphor/dump/phosphor-debug-collector/0008-Add-DumpPrefix-property-to-faultlog-dump.patch
+++ b/recipes-phosphor/dump/phosphor-debug-collector/0008-Add-DumpPrefix-property-to-faultlog-dump.patch
@@ -15,13 +15,13 @@
 Google-Bug-Id: 559785933
 Signed-off-by: Jasmine Cha <chajasmine@google.com>
 ---
- dump_manager_faultlog.cpp | 29 ++++++++++++++++++++++++++---
+ dump_manager_faultlog.cpp | 31 ++++++++++++++++++++++++++++---
  dump_manager_faultlog.hpp |  2 ++
  faultlog_dump_entry.hpp   |  5 ++++-
- 3 files changed, 32 insertions(+), 4 deletions(-)
+ 3 files changed, 34 insertions(+), 4 deletions(-)
 
 diff --git a/dump_manager_faultlog.cpp b/dump_manager_faultlog.cpp
-index 96393f7..5333e0f 100644
+index 0874182..93db6a6 100644
 --- a/dump_manager_faultlog.cpp
 +++ b/dump_manager_faultlog.cpp
 @@ -60,13 +60,14 @@ sdbusplus::message::object_path
@@ -40,16 +40,17 @@
                                  faultId, faultTimestamp);
  
      // To stay within the limit of MAX_NUM_FAULT_LOG_ENTRIES we need to remove
-@@ -216,7 +217,7 @@ sdbusplus::message::object_path
+@@ -224,7 +225,8 @@ sdbusplus::message::object_path
                                     phosphor::dump::OperationStatus::Completed,
                                     originatorId, originatorType, entryType,
                                     primaryLogIdStr, prettyNameStr, logStr,
--                                   *this, &entries, faultId)));
-+                                   dumpPrefixStr, *this, &entries, faultId)));
+-                                   *this, &entries, &faultIdTable, faultId)));
++                                   dumpPrefixStr, *this, &entries,
++                                   &faultIdTable, faultId)));
      }
      catch (const std::invalid_argument& e)
      {
-@@ -704,6 +705,9 @@ void Manager::createDumpFromCrashdumpSignal(sdbusplus::message_t& msg)
+@@ -713,6 +715,9 @@ void Manager::createDumpFromCrashdumpSignal(sdbusplus::message_t& msg)
  
      crashdumpMap.insert(std::pair<std::string, std::string>("PrimaryLogId",
                                                               filename));
@@ -57,9 +58,9 @@
 +                         (std::string(CRASHDUMP_FORMAT) == "AMD") ? "amd_"
 +                                                                  : "intel_");
  
-     createDump(crashdumpMap);
- }
-@@ -711,7 +715,8 @@ void Manager::createDumpFromCrashdumpSignal(sdbusplus::message_t& msg)
+     try
+     {
+@@ -729,7 +734,8 @@ void Manager::createDumpFromCrashdumpSignal(sdbusplus::message_t& msg)
  void Manager::getAndCheckCreateDumpParams(
      const phosphor::dump::DumpCreateParams& params, FaultLogTypes& entryType,
      std::string& primaryLogIdStr, std::string& prettyNameStr,
@@ -69,7 +70,7 @@
  {
      using InvalidArgument =
          sdbusplus::xyz::openbmc_project::Common::Error::InvalidArgument;
-@@ -832,6 +837,25 @@ void Manager::getAndCheckCreateDumpParams(
+@@ -850,6 +856,25 @@ void Manager::getAndCheckCreateDumpParams(
          }
      }
  
@@ -96,10 +97,10 @@
      iter = params.find("Id");
      if (iter != params.end())
 diff --git a/dump_manager_faultlog.hpp b/dump_manager_faultlog.hpp
-index 26aa131..d3d2bbb 100644
+index f58afb5..6ff04ae 100644
 --- a/dump_manager_faultlog.hpp
 +++ b/dump_manager_faultlog.hpp
-@@ -185,6 +185,7 @@ class Manager :
+@@ -188,6 +188,7 @@ class Manager :
       *  @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)
@@ -107,7 +108,7 @@
       *  @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
-@@ -195,6 +196,7 @@ class Manager :
+@@ -198,6 +199,7 @@ class Manager :
          const phosphor::dump::DumpCreateParams& params,
          FaultLogTypes& entryType, std::string& primaryLogIdStr,
          std::string& prettyNameStr, std::string& logStr,
@@ -116,17 +117,17 @@
  
      /** @brief Generate the current timestamp, adjusting as needed to ensure an
 diff --git a/faultlog_dump_entry.hpp b/faultlog_dump_entry.hpp
-index 25cc15d..33610d8 100644
+index 405b557..f804c0f 100644
 --- a/faultlog_dump_entry.hpp
 +++ b/faultlog_dump_entry.hpp
-@@ -59,6 +59,7 @@ class Entry : virtual public phosphor::dump::Entry, virtual public EntryIfaces
+@@ -57,6 +57,7 @@ class Entry : virtual public phosphor::dump::Entry, virtual public EntryIfaces
       *  @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] dumpPrefixStr - The prefix of the dump 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).
+      *  @param[in] parentMap - Fault log map containing this entry.
+      *  @param[in] faultIdTableMap - Table mapping fault ID to dump ID.
 @@ -69,7 +70,8 @@ class Entry : virtual public phosphor::dump::Entry, virtual public EntryIfaces
            phosphor::dump::OperationStatus status, std::string originatorId,
            originatorTypes originatorType, FaultLogTypes entryType,
@@ -135,15 +136,16 @@
 +          const std::string& logStr, const std::string& dumpPrefixStr,
 +          phosphor::dump::Manager& parent,
            std::map<uint32_t, std::unique_ptr<phosphor::dump::Entry>>* parentMap,
+           std::unordered_map<uint64_t, uint32_t>* faultIdTableMap = nullptr,
            uint64_t faultId = 0) :
-         phosphor::dump::Entry(bus, objPath.c_str(), dumpId, timeStamp, fileSize,
-@@ -82,6 +84,7 @@ class Entry : virtual public phosphor::dump::Entry, virtual public EntryIfaces
+@@ -83,6 +85,7 @@ class Entry : virtual public phosphor::dump::Entry, virtual public EntryIfaces
          primaryLogId(primaryLogIdStr);
          prettyName(prettyNameStr);
          log(logStr);
 +        dumpPrefix(dumpPrefixStr);
-         if (faultId != 0)
+         if (faultId != 0 && faultIdTableMap != nullptr)
          {
-             faultIdTable.emplace(faultId, dumpId);
+             faultIdTableMap->emplace(faultId, dumpId);
 -- 
-2.55.0.860.g4b6b3295ed-goog
+2.56.0.rc1.315.gc6ed9934b7-goog
+