Re: [PATCH 5/7 v6] trace, RAS: Add eMCA trace event interface

From: Borislav Petkov
Date: Wed May 28 2014 - 12:35:04 EST


On Wed, May 28, 2014 at 11:28:32AM -0400, Steven Rostedt wrote:
> > +static void __trace_mem_error(const uuid_le *fru_id, char *fru_text,
> > + u32 err_number, u8 severity,
> > + struct cper_sec_mem_err *mem)
> > +{
> > + u8 etype = ~0, pa_mask_lsb = ~0;
> > + u64 pa = ~0ull;
> > +
> > + if (mem->validation_bits & CPER_MEM_VALID_ERROR_TYPE)
> > + etype = mem->error_type;
> > +
> > + if (mem->validation_bits & CPER_MEM_VALID_PA)
> > + pa = mem->physical_addr;
> > +
> > + if (mem->validation_bits & CPER_MEM_VALID_PA_MASK)
> > + pa_mask_lsb = (u8)__ffs64(mem->physical_addr_mask);
> > +
> > + memset(mem_location, 0, CPER_REC_LEN);
> > + cper_mem_err_location(mem, mem_location);
> > + memset(dimm_location, 0, CPER_REC_LEN);
> > + cper_dimm_err_location(mem, dimm_location);
> > + trace_extlog_mem_event(err_number, etype, severity, pa, pa_mask_lsb,
> > + fru_id, dimm_location, mem_location, fru_text);
>
> This seems like a lot of work for a tracepoint. Why all the strings?
> Ideally, you want to record in the fast path the minimum raw data and
> reconstruct it at the time it is read.

Well, they're constructed from a bunch of values which are checked for
validity first:

http://lkml.kernel.org/r/1400142646-10127-4-git-send-email-gong.chen@xxxxxxxxxxxxxxx

We probably could get rid of the fru* things by reading them out from
ACPI and enumerating them and issuing only an index here which the slow
path decodes.

The others we can split into fields again which should definitely make
the record smaller. Fields are defined in struct cper_sec_mem_err.

The thing is, this TP needs to be designed properly before we expose it
to the world and so that hoperfully most future uses are covered.

Thanks.

--
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/