size);
}
+static void get_timestamp(struct trace_seq *s, struct tep_record *record,
+ struct ras_events *ras, char *ts_ptr, uint16_t size)
+{
+ time_t now;
+ struct tm *tm;
+
+ now = record->ts / user_hz + ras->uptime_diff;
+ tm = localtime(&now);
+ if (tm)
+ strftime(ts_ptr, size, "%Y-%m-%d %H:%M:%S %z", tm);
+ else
+ strncpy(ts_ptr, "1970-01-01 00:00:00 +0000", size);
+}
+
/* Poison List: Payload out flags */
#define CXL_POISON_FLAG_MORE BIT(0)
#define CXL_POISON_FLAG_OVERFLOW BIT(1)
int len;
unsigned long long val;
struct ras_events *ras = context;
- time_t now;
- struct tm *tm;
struct ras_cxl_poison_event ev;
- now = record->ts / user_hz + ras->uptime_diff;
- tm = localtime(&now);
- if (tm)
- strftime(ev.timestamp, sizeof(ev.timestamp),
- "%Y-%m-%d %H:%M:%S %z", tm);
- else
- strncpy(ev.timestamp, "1970-01-01 00:00:00 +0000", sizeof(ev.timestamp));
+ get_timestamp(s, record, ras, (char *)&ev.timestamp, sizeof(ev.timestamp));
if (trace_seq_printf(s, "%s ", ev.timestamp) <= 0)
return -1;
{
int len, i;
unsigned long long val;
- time_t now;
- struct tm *tm;
struct ras_events *ras = context;
struct ras_cxl_aer_ue_event ev;
memset(&ev, 0, sizeof(ev));
- now = record->ts / user_hz + ras->uptime_diff;
- tm = localtime(&now);
- if (tm)
- strftime(ev.timestamp, sizeof(ev.timestamp),
- "%Y-%m-%d %H:%M:%S %z", tm);
- else
- strncpy(ev.timestamp, "1970-01-01 00:00:00 +0000", sizeof(ev.timestamp));
+ get_timestamp(s, record, ras, (char *)&ev.timestamp, sizeof(ev.timestamp));
if (trace_seq_printf(s, "%s ", ev.timestamp) <= 0)
return -1;
{
int len;
unsigned long long val;
- time_t now;
- struct tm *tm;
struct ras_events *ras = context;
struct ras_cxl_aer_ce_event ev;
- now = record->ts / user_hz + ras->uptime_diff;
- tm = localtime(&now);
- if (tm)
- strftime(ev.timestamp, sizeof(ev.timestamp),
- "%Y-%m-%d %H:%M:%S %z", tm);
- else
- strncpy(ev.timestamp, "1970-01-01 00:00:00 +0000", sizeof(ev.timestamp));
+ get_timestamp(s, record, ras, (char *)&ev.timestamp, sizeof(ev.timestamp));
if (trace_seq_printf(s, "%s ", ev.timestamp) <= 0)
return -1;