no kld in minidumps
Pyun YongHyeon
pyunyh at gmail.com
Mon Nov 6 11:24:36 UTC 2006
On Sun, Nov 05, 2006 at 03:43:25AM +0200, Dmitry Pryanishnikov wrote:
>
> Hello!
>
> Well, maybe it's a little late to reply now, but anyway...
>
> On Fri, 18 Aug 2006, Andriy Gapon wrote:
> >on 18/08/2006 20:50 Dmitry Pryanishnikov said the following:
> >>>BTW, has anyone contemplated or even done this - some sort of a script
> >>>to automatically add all modules that were loaded at a time of crash ?
> >>
> >> Hmm, isn't this the task for asf(8). If not, what is asf(8) for?
> >
> >This is a very nice command, thank you!
> >But it does not seem to be directly applicable to postmortem situation
> >i.e. crash dump debugging.
>
> Actually asf(8) _can_ be useful during crash dump analysis in the limited
> yet quite common case when currently loaded kernel and modules are the same
> as they were during the crash. E.g. I've booted to singleuser mode with
> fdc.ko loaded as a module, established crash dump device and then crashed
> the system with 'kldunload fdc.ko' (see kern/104079). After reboot I've got
> a core dump which can't be analyzed corectly w/o symbols from fdc.ko:
>
Hmm, it seems that I fixed the bug in sparc64 fdc(4) support code.
Try attached patch.
I'm not familiar with geom(4) so it needs review from geom guru so
I've CCed to pjd at .
> root at homelynx# asf -kf /boot/kernel my.asf
> root at homelynx# kgdb /boot/kernel/kernel.debug vmcore.7
> ...
> (here 'bt' doesn't show frames which belong to fdc.ko and above)
> ...
> (kgdb) source my.asf
>
> Now 'bt' correctly shows all frames.
>
--
Regards,
Pyun YongHyeon
-------------- next part --------------
Index: fdc.c
===================================================================
RCS file: /pool/ncvs/src/sys/dev/fdc/fdc.c,v
retrieving revision 1.313
diff -u -r1.313 fdc.c
--- fdc.c 8 Sep 2006 21:46:00 -0000 1.313
+++ fdc.c 6 Nov 2006 11:26:40 -0000
@@ -426,7 +426,7 @@
step += step;
DELAY(step);
}
- return (fdc_err(fdc, bootverbose? "input ready timeout\n": 0));
+ return (fdc_err(fdc, bootverbose? "input ready timeout\n": NULL));
}
static int
@@ -446,7 +446,7 @@
step += step;
DELAY(step);
}
- return (fdc_err(fdc, bootverbose? "output ready timeout\n": 0));
+ return (fdc_err(fdc, bootverbose? "output ready timeout\n": NULL));
}
/*
@@ -470,7 +470,7 @@
i = va_arg(ap, int);
if (n == 0)
cmd = i;
- if (fdc_out(fdc, i) < 0) {
+ if (fdc_out(fdc, i)) {
char msg[50];
snprintf(msg, sizeof(msg),
"cmd %x failed at out byte %d of %d\n",
@@ -483,7 +483,7 @@
n_in = va_arg(ap, int);
for (n = 0; n < n_in; n++) {
int *ptr = va_arg(ap, int *);
- if (fdc_in(fdc, ptr) < 0) {
+ if (fdc_in(fdc, ptr)) {
char msg[50];
snprintf(msg, sizeof(msg),
"cmd %02x failed at in byte %d of %d\n",
@@ -577,7 +577,7 @@
return (FD_NOT_VALID);
}
- if (fdc_in(fdc, &cyl) < 0)
+ if (fdc_in(fdc, &cyl))
return fdc_err(fdc, "can't get cyl num\n");
if (cylp)
@@ -1014,7 +1014,7 @@
fdc_pio(fdc);
}
- switch(bp->bio_cmd) {
+ switch (bp->bio_cmd) {
case BIO_FMT:
/* formatting */
finfo = (struct fd_formb *)bp->bio_data;
@@ -1142,7 +1142,7 @@
return (1);
}
/* All OK */
- switch(bp->bio_cmd) {
+ switch (bp->bio_cmd) {
case BIO_RDID:
/* copy out ID field contents */
idp = (struct fdc_readid *)bp->bio_data;
@@ -1537,9 +1537,7 @@
break;
}
return (error);
-};
-
-
+}
/*
* Configuration/initialization stuff, per controller.
@@ -1998,16 +1996,24 @@
fd_detach(device_t dev)
{
struct fd_data *fd;
+ struct g_provider *gp;
+ int error;
+ error = 0;
fd = device_get_softc(dev);
+ DROP_GIANT();
g_topology_lock();
- g_wither_geom(fd->fd_geom, ENXIO);
+ gp = fd->fd_provider;
+ KASSERT(gp != NULL, ("NULL provider"));
+ if (gp->acr > 0 || gp->acw > 0 || gp->ace > 0)
+ error = EBUSY;
+ if (error == 0)
+ g_wither_geom(fd->fd_geom, ENXIO);
g_topology_unlock();
- while (device_get_state(dev) == DS_BUSY)
- tsleep(fd, PZERO, "fdd", hz/10);
callout_drain(&fd->toffhandle);
+ PICKUP_GIANT();
- return (0);
+ return (error);
}
static device_method_t fd_methods[] = {
@@ -2031,8 +2037,7 @@
fdc_modevent(module_t mod, int type, void *data)
{
- g_modevent(NULL, type, &g_fd_class);
- return (0);
+ return (g_modevent(NULL, type, &g_fd_class));
}
DRIVER_MODULE(fd, fdc, fd_driver, fd_devclass, fdc_modevent, 0);
More information about the freebsd-current
mailing list