Avoid dispatching metrics if location (used as plugin instance) wasn't parsed
correctly. Such thing can occur when there are no machine check exceptions
reported by mcelog server. With csv plugin enabled, it was causing a creation of
unexpected mcelog directory with all files (metrics) filled out with 0's.
Change-Id: Ib01f355a986ee5c6191cd126e1b32ef956ffce1f
Signed-off-by: Przemyslaw Szczerbik <przemyslawx.szczerbik@intel.com>
mcelog_memory_rec_t memory_record = {0};
while (parse_memory_info(*pp_file, &memory_record)) {
+ /* Check if location was successfully parsed */
+ if (memory_record.location[0] == '\0') {
+ memset(&memory_record, 0, sizeof(memory_record));
+ continue;
+ }
notification_t n = {NOTIF_OKAY, cdtime(), "", "", MCELOG_PLUGIN,
"", "", "", NULL};
ssnprintf(n.message, sizeof(n.message), "Got memory errors info.");