pldm: Trace out BIOS attribute change

To remove "setBIOSTable:: updateBaseBIOSTableProperty()"
trace. Instead add trace to indicate which attribute
changed, what is the new value it is changed to and
who is it set by.

TESTED:
* Value not set by BMC
pldmtool bios SetBIOSAttributeCurrentValue -a fw_boot_side_current -d Temp
{
    "Response": "SUCCESS"
}
BIOS:fw_boot_side_current, updated to value: Temp(42), by BMC: false

* Value set by BMC
busctl set-property xyz.openbmc_project.BIOSConfigManager /xyz/openbmc_project/bios_config/manager xyz.openbmc_project.BIOSConfig.Manager PendingAttributes a{s\(sv\)} 1 "fw_boot_side_current" "xyz.openbmc_project.BIOSConfig.Manager.AttributeType.Enumeration" s "Temp"

BIOS:fw_boot_side_current, updated to value: Temp(42), by BMC: true

Signed-off-by: Sagar Srinivas <sagar.srinivas@ibm.com>
Change-Id: I70e31b730026941a9973b1eb1118d8c300be5a54
diff --git a/libpldmresponder/bios_config.hpp b/libpldmresponder/bios_config.hpp
index af214ab..867ff38 100644
--- a/libpldmresponder/bios_config.hpp
+++ b/libpldmresponder/bios_config.hpp
@@ -23,7 +23,6 @@
 {
 namespace bios
 {
-
 enum class BoundType
 {
     LowerBound,
@@ -84,14 +83,15 @@
     /** @brief Set attribute value on dbus and attribute value table
      *  @param[in] entry - attribute value entry
      *  @param[in] size - size of the attribute value entry
+     *  @param[in] isBMC - indicates if the attribute is set by BMC
      *  @param[in] updateDBus          - update Attr value D-Bus property
      *                                   if this is set to true
      *  @param[in] updateBaseBIOSTable - update BaseBIOSTable D-Bus property
      *                                   if this is set to true
      *  @return pldm_completion_codes
      */
-    int setAttrValue(const void* entry, size_t size, bool updateDBus = true,
-                     bool updateBaseBIOSTable = true);
+    int setAttrValue(const void* entry, size_t size, bool isBMC,
+                     bool updateDBus = true, bool updateBaseBIOSTable = true);
 
     /** @brief Remove the persistent tables */
     void removeTables();
@@ -244,6 +244,38 @@
      */
     std::optional<Table> loadTable(const fs::path& path);
 
+    /** @brief Method to decode the attribute name from the string handle
+     *
+     *  @param[in] stringEntry - string entry from string table
+     *  @return the decoded string
+     */
+    std::string decodeStringFromStringEntry(
+        const pldm_bios_string_table_entry* stringEntry);
+
+    /** @brief Method to print the string Handle by passing the attribute Handle
+     *         of the bios attribute that got updated
+     *
+     *  @param[in] handle - the Attribute handle of the bios attribute
+     *  @param[in] index - index to the possible value handles
+     *  @param[in] attrTable - the attribute table
+     *  @param[in] stringTable - the string table
+     *  @return string handle from the string table and decoded string to the
+     * name handle
+     */
+    std::string displayStringHandle(uint16_t handle, uint8_t index,
+                                    const std::optional<Table>& attrTable,
+                                    const std::optional<Table>& stringTable);
+
+    /** @brief Method to trace the bios attribute which got changed
+     *
+     *  @param[in] attrValueEntry - The attribute value entry to update
+     *  @param[in] attrEntry - The attribute table entry
+     *  @param[in] isBMC - indicates if the attribute is set by BMC
+     */
+    void traceBIOSUpdate(const pldm_bios_attr_val_table_entry* attrValueEntry,
+                         const pldm_bios_attr_table_entry* attrEntry,
+                         bool isBMC);
+
     /** @brief Check the attribute value to update
      *  @param[in] attrValueEntry - The attribute value entry to update
      *  @param[in] attrEntry - The attribute table entry