Wed 01 May 2013 01:04:38 AM UTC, comment #3:
This has been fixed in the FreeIPMI trunk.
A new function ipmi_timestamp_string() was added into libfreeipmi and was used appropriately throughout FreeIPMI (in ipmi-fru, ipmi-sel, ipmi-sensors, ipmi-oem, ipmi-dcmi, and bmc-device).
|
Thu 25 Apr 2013 10:29:12 PM UTC, comment #1:
Here's a patch for one instance of this problem. A more generic "IPMI timestamp" display function should be created and used through-out the IPMI/DCMI code to address this problem globally:
Index: bmc-device/bmc-device.c
===================================================================
--- bmc-device/bmc-device.c (revision 9608)
+++ bmc-device/bmc-device.c (working copy)
@@ -1274,15 +1274,26 @@
goto cleanup;
}
- /* Posix says individual calls need not clear/set all portions of
- * 'struct tm', thus passing 'struct tm' between functions could
- * have issues. So we need to memset.
- */
- memset (&tm, '\0', sizeof(struct tm));
+/* Per IPMI 2.0 section 37.1: */
+#define IPMI_TIMESTAMP_UNSPECIFIED 0xffffffff
+#define IPMI_TIMESTAMP_POST_INIT 0x20000000
+ if (val == IPMI_TIMESTAMP_UNSPECIFIED)
+ snprintf (timestr, sizeof (timestr), "Unspecified");
+ else if (val <= IPMI_TIMESTAMP_POST_INIT)
+ snprintf (timestr, sizeof (timestr), "%u seconds since initialization", (unsigned)val);
+ else
+ {
+ /* Posix says individual calls need not clear/set all portions of
+ * 'struct tm', thus passing 'struct tm' between functions could
+ * have issues. So we need to memset.
+ */
+ memset (&tm, '\0', sizeof(struct tm));
- t = val;
- localtime_r (&t, &tm);
- strftime (timestr, sizeof (timestr), "%m/%d/%Y - %H:%M:%S", &tm);
+ t = val;
+ localtime_r (&t, &tm);
+ strftime (timestr, sizeof (timestr), "%m/%d/%Y - %H:%M:%S", &tm);
+ }
+
pstdout_printf (state_data->pstate,
"SEL Time : %s\n",
timestr);
|
Mon 22 Apr 2013 04:38:24 AM UTC, original submission:
IPMI 2.0 section 37.1 ("Special Timestamp values") states that the timestamp values 0xffffffff and values 0x00000000 through 0x20000000 are to be treat specially, yet ipmi-sel and bmc-device do not treat these timestamp values (e.g. from SEL or SDR repository) any different than any other timestamp values.
To be compliant with IPMI 2.0 section 37.1:
Timestamp value 0xffffffff should be displayed to the user as "unknown" or "unspecified".
Timestamp values 0x00000000 through 0x20000000 should be displayed as "seconds since initialization" and not interpreted/displayed as an actual wall-clock date/time.
|