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:
Bruce Evans 1997-12-19 21:37:18 +00:00
parent be08fbf9fb
commit a821e7134b
3 changed files with 30 additions and 3 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)