utility to transform an FFDCFile list for PEL consumption
Signed-off-by: Zane Shelley <zshelle@us.ibm.com>
Change-Id: Iae1bc8ed1a1eea9f9d7593e59c21a861a8236a34
diff --git a/attn/attn_logging.cpp b/attn/attn_logging.cpp
index 014fc96..3bdf1c2 100644
--- a/attn/attn_logging.cpp
+++ b/attn/attn_logging.cpp
@@ -60,7 +60,8 @@
std::vector<util::FFDCFile> files{createFFDCFiles()};
// Create FFDC tuples used to pass FFDC files to D-Bus method
- std::vector<FFDCTuple> ffdcTuples{createFFDCTuples(files)};
+ std::vector<util::FFDCTuple> ffdcTuples{};
+ util::transformFFDC(files, ffdcTuples);
// attach additional data
method.append(eventName,
@@ -288,17 +289,4 @@
return files;
}
-/** create tuples of FFDC files */
-std::vector<FFDCTuple> createFFDCTuples(std::vector<util::FFDCFile>& files)
-{
- std::vector<FFDCTuple> ffdcTuples{};
- for (util::FFDCFile& file : files)
- {
- ffdcTuples.emplace_back(
- file.getFormat(), file.getSubType(), file.getVersion(),
- sdbusplus::message::unix_fd(file.getFileDescriptor()));
- }
- return ffdcTuples;
-}
-
} // namespace attn
diff --git a/attn/attn_logging.hpp b/attn/attn_logging.hpp
index 8b5feba..659048c 100644
--- a/attn/attn_logging.hpp
+++ b/attn/attn_logging.hpp
@@ -48,9 +48,6 @@
/** @brief commit attention handler failure event to log */
void eventAttentionFail(int i_error);
-using FFDCTuple =
- std::tuple<util::FFDCFormat, uint8_t, uint8_t, sdbusplus::message::unix_fd>;
-
/**
* Create an FFDCFile object containing the specified lines of text data.
*
@@ -72,15 +69,4 @@
*/
std::vector<util::FFDCFile> createFFDCFiles();
-/**
- * Create FFDCTuple objects corresponding to the specified FFDC files.
- *
- * The D-Bus method to create an error log requires a vector of tuples to
- * pass in the FFDC file information.
- *
- * @param files FFDC files
- * @return vector of FFDCTuple objects
- */
-std::vector<FFDCTuple> createFFDCTuples(std::vector<util::FFDCFile>& files);
-
} // namespace attn