Attn: Revert back to local FFDC tuple function
PEL creation was failing when using the util::transformFFDC. Attention
handler was changed back to original code that uses the local function.
The util function was not removed.
Signed-off-by: Ben Tyner <ben.tyner@ibm.com>
Change-Id: Iab43155205c44311dba8bb9047b3c37de7e85c80
diff --git a/attn/attn_logging.cpp b/attn/attn_logging.cpp
index 3bdf1c2..014fc96 100644
--- a/attn/attn_logging.cpp
+++ b/attn/attn_logging.cpp
@@ -60,8 +60,7 @@
std::vector<util::FFDCFile> files{createFFDCFiles()};
// Create FFDC tuples used to pass FFDC files to D-Bus method
- std::vector<util::FFDCTuple> ffdcTuples{};
- util::transformFFDC(files, ffdcTuples);
+ std::vector<FFDCTuple> ffdcTuples{createFFDCTuples(files)};
// attach additional data
method.append(eventName,
@@ -289,4 +288,17 @@
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 659048c..8b5feba 100644
--- a/attn/attn_logging.hpp
+++ b/attn/attn_logging.hpp
@@ -48,6 +48,9 @@
/** @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.
*
@@ -69,4 +72,15 @@
*/
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