Messages in this thread | | | Date | Sat, 17 Nov 2012 18:04:59 -0800 | From | Anton Vorontsov <> | Subject | Re: [PATCH v3 4/9] pstore: allow storing different type id's in ram backend |
| |
On Thu, Oct 18, 2012 at 02:06:02PM +0300, dragos.tatulea@intel.com wrote: > From: Dragos Tatulea <dragos.tatulea@intel.com> > > 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 <dragos.tatulea@intel.com> > --- [...] > -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.
| |