On Thu, Oct 18, 2012 at 02:06:02PM +0300, [email protected] wrote:
> From: Dragos Tatulea <[email protected]>
>
> Added pstore_type_id in message header when storing to ram.
> On write, take into account the contents of this header and
> set the type accordingly.
>
> Signed-off-by: Dragos Tatulea <[email protected]>
> ---
[...]
> -static size_t ramoops_write_kmsg_hdr(struct persistent_ram_zone *prz)
> +static size_t ramoops_write_kmsg_hdr(struct persistent_ram_zone *prz,
> + enum pstore_type_id type)
> {
> char *hdr;
> struct timeval timestamp;
> size_t len;
>
> do_gettimeofday(×tamp);
> - hdr = kasprintf(GFP_ATOMIC, RAMOOPS_KERNMSG_HDR "%lu.%lu\n",
> - (long)timestamp.tv_sec, (long)timestamp.tv_usec);
> + hdr = kasprintf(GFP_ATOMIC, "%u" RAMOOPS_KERNMSG_HDR "%lu.%lu\n",
> + type, (long)timestamp.tv_sec, (long)timestamp.tv_usec);
This will probably break scripts (and the main purpose for the header is
to make it somewhat scripts-parsable). It's safer to change it to
RAMOOPS_KERNMSG_HDR "%lu.%lu %u"
Thanks,
Anton.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/