|
@@ -27,7 +27,6 @@
|
|
|
#include <linux/module.h>
|
|
|
#include <linux/version.h>
|
|
|
#include <linux/pstore.h>
|
|
|
-#include <linux/time.h>
|
|
|
#include <linux/io.h>
|
|
|
#include <linux/ioport.h>
|
|
|
#include <linux/platform_device.h>
|
|
@@ -356,20 +355,15 @@ out:
|
|
|
}
|
|
|
|
|
|
static size_t ramoops_write_kmsg_hdr(struct persistent_ram_zone *prz,
|
|
|
- bool compressed)
|
|
|
+ struct pstore_record *record)
|
|
|
{
|
|
|
char *hdr;
|
|
|
- struct timespec timestamp;
|
|
|
size_t len;
|
|
|
|
|
|
- /* Report zeroed timestamp if called before timekeeping has resumed. */
|
|
|
- if (__getnstimeofday(×tamp)) {
|
|
|
- timestamp.tv_sec = 0;
|
|
|
- timestamp.tv_nsec = 0;
|
|
|
- }
|
|
|
hdr = kasprintf(GFP_ATOMIC, RAMOOPS_KERNMSG_HDR "%lu.%lu-%c\n",
|
|
|
- (long)timestamp.tv_sec, (long)(timestamp.tv_nsec / 1000),
|
|
|
- compressed ? 'C' : 'D');
|
|
|
+ record->time.tv_sec,
|
|
|
+ record->time.tv_nsec / 1000,
|
|
|
+ record->compressed ? 'C' : 'D');
|
|
|
WARN_ON_ONCE(!hdr);
|
|
|
len = hdr ? strlen(hdr) : 0;
|
|
|
persistent_ram_write(prz, hdr, len);
|
|
@@ -440,7 +434,7 @@ static int notrace ramoops_pstore_write(struct pstore_record *record)
|
|
|
prz = cxt->dprzs[cxt->dump_write_cnt];
|
|
|
|
|
|
/* Build header and append record contents. */
|
|
|
- hlen = ramoops_write_kmsg_hdr(prz, record->compressed);
|
|
|
+ hlen = ramoops_write_kmsg_hdr(prz, record);
|
|
|
size = record->size;
|
|
|
if (size + hlen > prz->buffer_size)
|
|
|
size = prz->buffer_size - hlen;
|