Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223677
b: refs/heads/master
c: 1873bb8
h: refs/heads/master
i:
  223675: 6bccc57
v: v3
  • Loading branch information
Ahmed S. Darwish authored and Linus Torvalds committed Dec 28, 2010
1 parent ac1e08e commit 1918e73
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ffc96d628b651b69b39909fc3e9e8f465df1eed3
refs/heads/master: 1873bb8115e678ad9fd0aac9dbbc68383bc36e06
12 changes: 7 additions & 5 deletions trunk/drivers/char/ramoops.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <linux/ramoops.h>

#define RAMOOPS_KERNMSG_HDR "===="
#define RAMOOPS_HEADER_SIZE (5 + sizeof(struct timeval))

#define RECORD_SIZE 4096

Expand Down Expand Up @@ -65,24 +64,27 @@ static void ramoops_do_dump(struct kmsg_dumper *dumper,
struct ramoops_context, dump);
unsigned long s1_start, s2_start;
unsigned long l1_cpy, l2_cpy;
int res;
char *buf;
int res, hdr_size;
char *buf, *buf_orig;
struct timeval timestamp;

/* Only dump oopses if dump_oops is set */
if (reason == KMSG_DUMP_OOPS && !dump_oops)
return;

buf = (char *)(cxt->virt_addr + (cxt->count * RECORD_SIZE));
buf_orig = buf;

memset(buf, '\0', RECORD_SIZE);
res = sprintf(buf, "%s", RAMOOPS_KERNMSG_HDR);
buf += res;
do_gettimeofday(&timestamp);
res = sprintf(buf, "%lu.%lu\n", (long)timestamp.tv_sec, (long)timestamp.tv_usec);
buf += res;

l2_cpy = min(l2, (unsigned long)(RECORD_SIZE - RAMOOPS_HEADER_SIZE));
l1_cpy = min(l1, (unsigned long)(RECORD_SIZE - RAMOOPS_HEADER_SIZE) - l2_cpy);
hdr_size = buf - buf_orig;
l2_cpy = min(l2, (unsigned long)(RECORD_SIZE - hdr_size));
l1_cpy = min(l1, (unsigned long)(RECORD_SIZE - hdr_size) - l2_cpy);

s2_start = l2 - l2_cpy;
s1_start = l1 - l1_cpy;
Expand Down

0 comments on commit 1918e73

Please sign in to comment.