From owner-freebsd-arch@FreeBSD.ORG Tue Jun 5 15:18:55 2012 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 71AE81065670 for ; Tue, 5 Jun 2012 15:18:55 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id E0EF18FC1F for ; Tue, 5 Jun 2012 15:18:54 +0000 (UTC) Received: by lbon10 with SMTP id n10so5079617lbo.13 for ; Tue, 05 Jun 2012 08:18:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=MHENfAEasMRpGfIstiRUJCKWvR7ZEbTuk4j/iUM9wFs=; b=A/4yJKtw07vu5KBI2n14+3AZju0hqGudY+FqTstSr7tkfyb5pWklTPUR3Ts/mqaZDE x+skyRSxWUpZ+ASX1lHoXvSjlTaWyhNR6NVqwG2g36n1xmnTCVdAD/PtJtIOCvvy5AZv kwMzQuPwUXh34XBEwKJozzJ5QXIWFc/RSvxRgCvHKU+nP8R76FRTUrzxB4TdtqH4Qpqd xchDcfT+0WdTRuTjYI3LSxoM5lxOYa8HnXv2QGM9evjHKTDjNYNTLo5td3zCwEGRqOjA 6+ahlmdtFHyTerNmrx1000lLKmUKQ9Pgm6mI3OnRD7ysmICCJMnZ8cXzOVsxcYNd4hah oXNQ== MIME-Version: 1.0 Received: by 10.152.104.171 with SMTP id gf11mr17537340lab.5.1338909533497; Tue, 05 Jun 2012 08:18:53 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.27.65 with HTTP; Tue, 5 Jun 2012 08:18:53 -0700 (PDT) In-Reply-To: <86bokyvtc2.fsf@ds4.des.no> References: <86bokyvtc2.fsf@ds4.des.no> Date: Tue, 5 Jun 2012 16:18:53 +0100 X-Google-Sender-Auth: yoGy18sgeGBgc5IfgGCTkwhD24c Message-ID: From: Attilio Rao To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: arch@freebsd.org Subject: Re: KTR_SPAREx 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, 05 Jun 2012 15:18:55 -0000 2012/6/5 Dag-Erling Sm=C3=B8rgrav : > While working on Capsicum last year, I noticed that some of the spare > KTR types are (ab)used for different purposes by different parts of the > code. =C2=A0KTR_SPARE[234] are all documented as "/* XXX Used by cxgb */"= , > but KTR_SPARE3, for instance, is widely used for clock events. =C2=A0Here= is > a complete list: The truth is, KTR is thought to be a mechanism for catering "on-the-fly" the tracing of the events, but the very limited mask/classes of events it provides makes this completely useless. I don't recall a case where I had to not patch manually KTR knobs to do actual debugging. What I really would like to see is: - Of course remove the bogus usage of KTR_SPAREX in the drivers - Make the mask of events much bigger than the current one - Enlarge the number of KTR_SPARE available (16 would be ok) - By default have KTR_SPARE0-15 to be on in the kernel along with KTR option, or maybe when the kernel is still in the debugging phase (but leave in a knob for disabling it) - Use the dynamic masking system to just mask the SPARE you are interested into. This way your driver can simply use a KTR_SPARE for development and you will mask out the right one at run time. Attilio --=20 Peace can only be achieved by understanding - A. Einstein