From owner-freebsd-usb@FreeBSD.ORG Thu Dec 2 10:39:29 2004 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6B2F116A4CE for ; Thu, 2 Dec 2004 10:39:29 +0000 (GMT) Received: from dastardly.newsbastards.org.72.27.172.IN-addr.ARPA.NOSPAM.dyndns.dk (84-72-27-39.dclient.hispeed.ch [84.72.27.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id 835CA43D48 for ; Thu, 2 Dec 2004 10:39:25 +0000 (GMT) (envelope-from bounce@NOSPAM.dyndns.dk) Received: from Mail.NOSPAM.DynDNS.dK (ipv6.NOSPAM.dyndns.dk [2002:5448:1b27:0:220:afff:fed4:dbcb]) (8.11.6/8.11.6-SPAMMERS-DeLiGHt) with ESMTP id iB2AdKR20084 verified NO) for ; Thu, 2 Dec 2004 11:39:23 +0100 (CET) (envelope-from bounce@NOSPAM.dyndns.dk) Received: (from beer@localhost) by Mail.NOSPAM.DynDNS.dK (8.11.6/FNORD) id iB2AdJc20083; Thu, 2 Dec 2004 11:39:20 +0100 (CET) (envelope-from bounce@NOSPAM.dyndns.dk) Date: Thu, 2 Dec 2004 11:39:20 +0100 (CET) Message-Id: <200412021039.iB2AdJc20083@Mail.NOSPAM.DynDNS.dK> X-Authentication-Warning: localhost.newsbastards.org.72.27.172.IN-addr.A: beer set sender to bounce@NOSPAM.dyndns.dk using -f X-Authentication-Warning: localhost.newsbastards.org.72.27.172.IN-addr.A: Processed from queue /tmp X-Authentication-Warning: localhost.newsbastards.org.72.27.172.IN-addr.A: Processed by beer with -C /etc/mail/sendmail.cf-LOCAL From: Barry Bouwsma To: freebsd-usb@freebsd.org Subject: USB modules (4.x) and debug levels X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2004 10:39:29 -0000 [feel free to drop me from replies, or the hostname part of this IPv6- only address if you don't have IPv6 mail connectivity] Moin, I'm reviewing the differences between my hacked USB code and the latest I've downloaded, and I see that I've added the following (in a reversed diff; cut'n'paste no less, to make it useless) --- uhub.c Thu Sep 23 14:21:29 2004 +++ uhub.c-pre-4.11 Wed Nov 24 19:55:46 2004 @@ -67,19 +67,6 @@ #define UHUB_INTR_INTERVAL 255 /* ms */ -/* XXX Hm, seems like it's impossible to enable debugging in kernel - modules without explicitly recompiling... Looks as if the - default of 0 doesn't do anything disruptive, so let's play - like firewire and always define these too... */ - /* Stolen from my hack to usb.c */ -int uhubdebug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, uhub, CTLFLAG_RW, 0, "USB uhub"); -SYSCTL_INT(_hw_usb_uhub, OID_AUTO, debug, CTLFLAG_RW, - &uhubdebug, 0, "uhub debug level"); -#define DPRINTF(x) if (uhubdebug) logprintf x -#define DPRINTFN(n,x) if (uhubdebug>(n)) logprintf x - -#if 0 /* XXX HACK */ #ifdef USB_DEBUG #define DPRINTF(x) if (uhubdebug) logprintf x #define DPRINTFN(n,x) if (uhubdebug>(n)) logprintf x @@ -91,7 +78,6 @@ @@ -91,7 +78,6 @@ #define DPRINTF(x) #define DPRINTFN(n,x) #endif -#endif /* HAXK */ struct uhub_softc { USBBASEDEVICE sc_dev; /* base device */ Basically, my problem is (as per the comment) that I build my USB support as modules, under 4.x, which as far as I know, does not pay attention to what I may have defined in my kernel config file. So I basically stole the code from firewire, where it seems that debugging via sysctl is always available... debug.firewire_debug: 0 debug.fwmem_debug: 0 debug.sbp_debug: 1 Then I have at hand a tunable, should I want to enable debugging with my USB modules... hw.usb.uhub.debug: 0 hw.usb.debug: 0 (I've probably done the same for uhci/ehci/ohci but haven't merged this hack into the latest code I'm trying) Does it seem to anyone else to be a good idea to enable dynamic debug tuning this way (or a more correct debug.usb_debug-like thing), particularly for kernel modules, instead of requiring the sufferer to rebuild the kernel and/or modules? thanks barry bouwsma