Exec dmesg and awk to print everything in the message buffer
following "panic:" or "Fatal trap". `panicstr' is still printed, although it is redundant if there is a valid message buffer and incomplete if it contains `%'s. I think the awk command belongs here and not in a script since a standard format with complete messages is good for bug reports.
This commit is contained in:
parent
be08fbf9fb
commit
a821e7134b
@ -338,7 +338,16 @@ kcore_open (filename, from_tty)
|
||||
*cp = '?';
|
||||
*cp = '\0';
|
||||
if (buf[0] != '\0')
|
||||
printf ("panic: %s\n", buf);
|
||||
printf ("panicstr: %s\n", buf);
|
||||
|
||||
printf ("panic messages:\n---\n");
|
||||
snprintf (buf, sizeof buf,
|
||||
"/sbin/dmesg -M %s | \
|
||||
/usr/bin/awk '/^(panic:|Fatal trap) / { printing = 1 } \
|
||||
{ if (printing) print $0 }'",
|
||||
filename);
|
||||
system (buf);
|
||||
printf ("---\n");
|
||||
}
|
||||
|
||||
if (!ontop)
|
||||
|
@ -338,7 +338,16 @@ kcore_open (filename, from_tty)
|
||||
*cp = '?';
|
||||
*cp = '\0';
|
||||
if (buf[0] != '\0')
|
||||
printf ("panic: %s\n", buf);
|
||||
printf ("panicstr: %s\n", buf);
|
||||
|
||||
printf ("panic messages:\n---\n");
|
||||
snprintf (buf, sizeof buf,
|
||||
"/sbin/dmesg -M %s | \
|
||||
/usr/bin/awk '/^(panic:|Fatal trap) / { printing = 1 } \
|
||||
{ if (printing) print $0 }'",
|
||||
filename);
|
||||
system (buf);
|
||||
printf ("---\n");
|
||||
}
|
||||
|
||||
if (!ontop)
|
||||
|
@ -338,7 +338,16 @@ kcore_open (filename, from_tty)
|
||||
*cp = '?';
|
||||
*cp = '\0';
|
||||
if (buf[0] != '\0')
|
||||
printf ("panic: %s\n", buf);
|
||||
printf ("panicstr: %s\n", buf);
|
||||
|
||||
printf ("panic messages:\n---\n");
|
||||
snprintf (buf, sizeof buf,
|
||||
"/sbin/dmesg -M %s | \
|
||||
/usr/bin/awk '/^(panic:|Fatal trap) / { printing = 1 } \
|
||||
{ if (printing) print $0 }'",
|
||||
filename);
|
||||
system (buf);
|
||||
printf ("---\n");
|
||||
}
|
||||
|
||||
if (!ontop)
|
||||
|
Loading…
Reference in New Issue
Block a user