From owner-freebsd-arch@FreeBSD.ORG Tue Jun 5 15:20:02 2012 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A8A4106564A for ; Tue, 5 Jun 2012 15:20:02 +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 A73818FC0A for ; Tue, 5 Jun 2012 15:20:01 +0000 (UTC) Received: by lbon10 with SMTP id n10so5080875lbo.13 for ; Tue, 05 Jun 2012 08:20:00 -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=7zHR9gqF6/POmh+5xGUSHk6TJRkKwirfO5Sewq48GJg=; b=P/AFgL1uecmxbDpA3bPz4lOJjDMQBQ+TAVyPdO3Q5Imh0xZoYk+xExa0gpF39U4Jzn 5FjNJJAxk5dhOSY3mJwIVphn9wU+RAAJc/2lE0nhJDZ1IGqi7ujbNwWD80s3w0zPwtAd eqh36srOF6cEGb5KrULG4+uRIi67OAdKW1twmMIwknnFB2Miq2J/Rcju3vjspxZr63KG LfRtximyUGcs14ftGZKKwILDEAa5fIeaCa9lbaXP+jDtfkASR4OcITCihP9Hjc0sqb1q Ds0ymugdg3v4q+NKQEKob7i2/YEAJGrG7vYCmTRpADywMzJOrbIVQrdmOueEVJ1KFomn XGCg== MIME-Version: 1.0 Received: by 10.112.42.34 with SMTP id k2mr8325423lbl.0.1338909600597; Tue, 05 Jun 2012 08:20:00 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.27.65 with HTTP; Tue, 5 Jun 2012 08:20:00 -0700 (PDT) In-Reply-To: References: <86bokyvtc2.fsf@ds4.des.no> Date: Tue, 5 Jun 2012 16:20:00 +0100 X-Google-Sender-Auth: h5OrgPT3WFakYIK2E8w_Xp9Q5o4 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:20:02 -0000 2012/6/5 Attilio Rao : > 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=A0Her= e 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. Forgot to mention, even if this is mostly unrelated to your point: we should make a better job of breaking further the current set of KTR classes on a per-subsystem basis. KTR_VFS or KTR_VM (and others) are far too large right now. Attilio --=20 Peace can only be achieved by understanding - A. Einstein