From owner-freebsd-arch@FreeBSD.ORG Tue Nov 1 01:24:00 2005 Return-Path: X-Original-To: arch@FreeBSD.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AF80916A41F for ; Tue, 1 Nov 2005 01:24:00 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from speedfactory.net (mail5.speedfactory.net [66.23.216.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2C52343D49 for ; Tue, 1 Nov 2005 01:23:59 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 1136723 for multiple; Mon, 31 Oct 2005 20:21:57 -0500 Received: from [192.168.0.15] (osx.baldwin.cx [192.168.0.15]) (authenticated bits=0) by server.baldwin.cx (8.13.1/8.13.1) with ESMTP id jA11NsiY039477; Mon, 31 Oct 2005 20:23:54 -0500 (EST) (envelope-from jhb@FreeBSD.org) In-Reply-To: <4366999B.4070005@root.org> References: <4366999B.4070005@root.org> Mime-Version: 1.0 (Apple Message framework v734) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <2BFF6EA7-F684-4DFB-8821-2DC5EBEB2181@FreeBSD.org> Content-Transfer-Encoding: 7bit From: John Baldwin Date: Mon, 31 Oct 2005 20:23:45 -0500 To: Nate Lawson X-Mailer: Apple Mail (2.734) X-Spam-Status: No, score=-2.8 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=100 Cc: arch@FreeBSD.org Subject: Re: KTR changes X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Nov 2005 01:24:00 -0000 On Oct 31, 2005, at 5:24 PM, Nate Lawson wrote: > KTR_WITNESS 10 This is isolated to one file and should probably be aliased to some other bit kind of like how I made KTR_TULIP map to KTR_DEV when it was enabled and 0 otherwise based on #ifdef's in if_de.c. We might should have one generic bit for subsystems to use similar to how device drivers can use KTR_DEV. > As such, I'd like to mark the following unused and free for > allocation: > KTR_NET, KTR_FS, KTR_MALLOC, KTR_KGDB, KTR_IO I'd rather someone add KTR_MALLOC traces than get rid of it. :) If we fleshed out our more general logging for in-kernel facilities that helps to get a general feel of what the system is doing when debugging. I think some traces are for debugging specific subsystems such as KTR_WITNESS or KTR_TULIP where as some are more general to tell you what the kernel is doing (KTR_PROC, KTR_INTR, and KTR_LOCK fall into this category as probably would KTR_MALLOC and KTR_CONTENTION). I think subsystem trace classes should be mapped to generic bits where as kernel-wide tracing should get their own bits if possible. > These should be merged the following under KTR_MALLOC (KTR_MEM?): > KTR_UMA: uma_zalloc_arg, uma_zfree_arg > KTR_VM: vmspace_alloc, vmspace_free, vm_map_create, > vm_map_entry_unlink Well, I'm not sure about those as the KTR_VM ones aren't related to kernel malloc at all. vmspaces are the user virtual address mappings with vm_map being individual mappings. :) That's like saying that mmap() should be part of malloc(). :) I also think KTR_UMA is probably useful for getting a general feel for memory allocation activity in the kernel. > Merge under KTR_SYNCH (KTR_LOCK?): > KTR_CRITICAL: critical enter/exit > KTR_CONTENTION: mutex contention start/end Perhaps default KTR_CRITICAL to off and let people who want it map it to a generic bit. It's very expensive and I'm not sure it's very useful for all but a few people. Then I would leave KTR_CONTENTION alone. > Merge under KTR_TIMER: > KTR_CLK: hard clock firing KTR_CLK is useless, just drop it. Instead, maybe add KTR_INTR traces for clock interrupts where they are missing. > KTR_CALLOUT: Giant or mutex-based callout run Then you can leave KTR_CALLOUT as is. :) > Also, it appears that we overran into KTR_CTx space with KTR_UMA > (rwatson). Is this something that needs to be changed or should we > reduce KTR_CTx? I don't think anyone uses KTR_CTx currently? > Last, I'd like to add a new level, KTR_POWER, for use with power > management events. Since we only have 32 bits of KTR levels, it's > important to use them carefully. Comments on all this are welcome. Is this for debugging stuff inside ACPI or is it supposed to record general system-wide activity? Another option is to dispense with the whole bitmask idea altogether and give each compiled in KTR class its own boolean char with an associoted sysctl and loader tunable. You could then allow users to specify each class they want to compile in via a separate kernel option (KTR_CLASS_FOO) with a special case that KTR_CLASS_ALL would #define all of the classes in sys/ktr.h. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org