From owner-freebsd-current@FreeBSD.ORG Mon Nov 6 11:24:36 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DA76816A407 for ; Mon, 6 Nov 2006 11:24:36 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id A4D1C43D7B for ; Mon, 6 Nov 2006 11:24:20 +0000 (GMT) (envelope-from pyunyh@gmail.com) Received: by nz-out-0102.google.com with SMTP id o37so683980nzf for ; Mon, 06 Nov 2006 03:24:19 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=nXGDCiMJ/vn9bt26vzmCia5+DiRd6i1c3FBP7mwmreqopEQcIviobvPVO+Xd3Nkh3cX36E8KRs4vZv3XDJYdLUkak3+/+0AGmX7P1eGGyZPG6glf0Ti1s4DhB7SoTwJeHpzcnUKDBz/6a7h9cAK02eMrgzj6h6ytOHK+NitI76k= Received: by 10.35.93.19 with SMTP id v19mr452884pyl.1162812259415; Mon, 06 Nov 2006 03:24:19 -0800 (PST) Received: from michelle.cdnetworks.co.kr ( [211.53.35.84]) by mx.google.com with ESMTP id 17sm14981049nzo.2006.11.06.03.24.17; Mon, 06 Nov 2006 03:24:19 -0800 (PST) Received: from michelle.cdnetworks.co.kr (localhost.cdnetworks.co.kr [127.0.0.1]) by michelle.cdnetworks.co.kr (8.13.5/8.13.5) with ESMTP id kA6BRdTt084849 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 6 Nov 2006 20:27:39 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id kA6BRVBE084848; Mon, 6 Nov 2006 20:27:31 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Mon, 6 Nov 2006 20:27:31 +0900 From: Pyun YongHyeon To: Dmitry Pryanishnikov Message-ID: <20061106112731.GA78511@cdnetworks.co.kr> References: <1155864187.00584864.1155853201@10.7.7.3> <1155882183.00584920.1155870001@10.7.7.3> <44E5C008.9010008@icyb.net.ua> <20060818204915.S42981@atlantis.atlantis.dp.ua> <44E5FFF3.9040908@icyb.net.ua> <20061105025754.M20747@atlantis.atlantis.dp.ua> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="PNTmBPCT7hxwcZjr" Content-Disposition: inline In-Reply-To: <20061105025754.M20747@atlantis.atlantis.dp.ua> User-Agent: Mutt/1.4.2.1i Cc: Jeremie Le Hen , freebsd-current@freebsd.org, "Devon H. O'Dell" , Andriy Gapon Subject: Re: no kld in minidumps X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2006 11:24:36 -0000 --PNTmBPCT7hxwcZjr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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@. > root@homelynx# asf -kf /boot/kernel my.asf > root@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 --PNTmBPCT7hxwcZjr Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="fdc.patch" 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); --PNTmBPCT7hxwcZjr--