Re: [PATCH] Info dump on Oops or panic()

Andi Kleen
2007-06-29T00:20:17Z

Joshua Wise <jwise@google.com> writes:

You are aware that oops screen estate is very precious on standard
systems without serial console?

> +/*
> + * Dump out UTS info on oops / panic.
> + */
> + +static int dump_utsname(struct notifier_block *self, unsigned long
> v, void *p)
> +{
> + printk ("%s %s %s %s %s %s\n",
> + utsname()->sysname,
> + utsname()->nodename,
> + utsname()->release,
> + utsname()->version,

release / version is already printed for oopses. I frankly don't see
the point of the rest of the UTS information because that should be
implicit in the log files (you surely know to which machine the log
belongs)

> +static int dump_uptime(struct notifier_block *self, unsigned long v, void *p)
> +{
> + struct timespec uptime;
> + /* The logic below is very much like how kernel + *
> prepares /proc/uptime. + */
> + do_posix_clock_monotonic_gettime(&uptime);
> + printk("Uptime(seconds): %lu.%02lu\n",
> + (unsigned long) uptime.tv_sec,
> + (uptime.tv_nsec / (NSEC_PER_SEC / 100)));

Wouldn't it be better to just print the time at boot up? If you
have full log files you surely got the boot messages too and
then you can get it from there. Ok it might be tricky if you
don't know when the oops got logged, but surely that is a simple
exercise in text processing to handle this on the console server?

It can be already done with CONFIG_PRINTK_TIME BTW which
will event print it for every line.

-Andi