From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AAF06C433F5 for ; Fri, 12 Nov 2021 14:21:44 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7423161054 for ; Fri, 12 Nov 2021 14:21:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7423161054 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=axis.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1D98A6EC6A; Fri, 12 Nov 2021 14:21:44 +0000 (UTC) X-Greylist: delayed 432 seconds by postgrey-1.36 at gabe; Fri, 12 Nov 2021 11:57:09 UTC Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0EDF26ED9F; Fri, 12 Nov 2021 11:57:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1636718229; x=1668254229; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=pKNzvHA+abG5/SB0rgSIMnr0AelDwIA74K7UU91Gfho=; b=krDLYRCh9mmz1cbv5/Y+yut07sDSuXqpKS5KIxJE6CGhU53rGnB2wSUS S/HZxvMX232pvyeFYMcihhMfY54fSu5iAsy4lhkQPtB4IFs+6Uv1Iyibi yF6AQ3iF5UemhTCc7G9ccwlDig/T8rKjscuzPhTN6UeOqkkwnyOpzB86d MrClvjWTuvRARyhaDbLov8IFJ3DvKrWXJJ7igqnGAGtTRLVABqM7bv5yT litYiMmweysBpuXw/RJcV9w4HDwoMjJ/nyzVRjQHjxzJ78MuLSWl3Q5oA 3faKB9aTcZX+3d38xyAS/yTI1bZv0ZfNf2OfmNP27sn3KVIfuD+spD8zX Q==; Date: Fri, 12 Nov 2021 12:49:54 +0100 From: Vincent Whitchurch To: Jim Cromie Subject: Re: [PATCH v10 08/10] dyndbg: add print-to-tracefs, selftest with it - RFC Message-ID: <20211112114953.GA1381@axis.com> References: <20211111220206.121610-1-jim.cromie@gmail.com> <20211111220206.121610-9-jim.cromie@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20211111220206.121610-9-jim.cromie@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Mailman-Approved-At: Fri, 12 Nov 2021 14:21:43 +0000 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: quic_saipraka@quicinc.com, catalin.marinas@arm.com, dri-devel@lists.freedesktop.org, will@kernel.org, maz@kernel.org, amd-gfx@lists.freedesktop.org, mingo@redhat.com, daniel.vetter@ffwll.ch, arnd@arndb.de, linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org, rostedt@goodmis.org, jbaron@akamai.com, seanpaul@chromium.org, intel-gvt-dev@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, sean@poorly.run, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, robdclark@gmail.com, quic_psodagud@quicinc.com, mathieu.desnoyers@efficios.com Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" On Thu, Nov 11, 2021 at 03:02:04PM -0700, Jim Cromie wrote: > Sean Paul proposed, in: > https://patchwork.freedesktop.org/series/78133/ > drm/trace: Mirror DRM debug logs to tracefs > > His patchset's objective is to be able to independently steer some of > the drm.debug stream to an alternate tracing destination, by splitting > drm_debug_enabled() into syslog & trace flavors, and enabling them > separately. 2 advantages were identified: > > 1- syslog is heavyweight, tracefs is much lighter > 2- separate selection of enabled categories means less traffic > > Dynamic-Debug can do 2nd exceedingly well: > > A- all work is behind jump-label's NOOP, zero off cost. > B- exact site selectivity, precisely the useful traffic. > can tailor enabled set interactively, at shell. > > Since the tracefs interface is effective for drm (the threads suggest > so), adding that interface to dynamic-debug has real potential for > everyone including drm. > > if CONFIG_TRACING: > > Grab Sean's trace_init/cleanup code, use it to provide tracefs > available by default to all pr_debugs. This will likely need some > further per-module treatment; perhaps something reflecting hierarchy > of module,file,function,line, maybe with a tuned flattening. > > endif CONFIG_TRACING > > Add a new +T flag to enable tracing, independent of +p, and add and > use 3 macros: dyndbg_site_is_enabled/logging/tracing(), to encapsulate > the flag checks. Existing code treats T like other flags. I posted a patchset a while ago to do something very similar, but that got stalled for some reason and I unfortunately didn't follow it up: https://lore.kernel.org/lkml/20200825153338.17061-1-vincent.whitchurch@axis.com/ A key difference between that patchset and this patch (besides that small fact that I used +x instead of +T) was that my patchset allowed the dyndbg trace to be emitted to the main buffer and did not force them to be in an instance-specific buffer. That feature is quite important at least for my use case since I often use dyndbg combined with function tracing, and the latter doesn't work on non-main instances according to Documentation/trace/ftrace.rst. For example, here's a random example of a bootargs from one of my recent debugging sessions: trace_event=printk:* ftrace_filter=_mmc*,mmc*,sd*,dw_mci*,mci* ftrace=function trace_buf_size=20M dyndbg="file drivers/mmc/* +x" From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D164FC433F5 for ; Fri, 12 Nov 2021 14:25:14 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9482A60FBF for ; Fri, 12 Nov 2021 14:25:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9482A60FBF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=axis.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 09EE16ECBE; Fri, 12 Nov 2021 14:25:14 +0000 (UTC) X-Greylist: delayed 432 seconds by postgrey-1.36 at gabe; Fri, 12 Nov 2021 11:57:09 UTC Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0EDF26ED9F; Fri, 12 Nov 2021 11:57:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1636718229; x=1668254229; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=pKNzvHA+abG5/SB0rgSIMnr0AelDwIA74K7UU91Gfho=; b=krDLYRCh9mmz1cbv5/Y+yut07sDSuXqpKS5KIxJE6CGhU53rGnB2wSUS S/HZxvMX232pvyeFYMcihhMfY54fSu5iAsy4lhkQPtB4IFs+6Uv1Iyibi yF6AQ3iF5UemhTCc7G9ccwlDig/T8rKjscuzPhTN6UeOqkkwnyOpzB86d MrClvjWTuvRARyhaDbLov8IFJ3DvKrWXJJ7igqnGAGtTRLVABqM7bv5yT litYiMmweysBpuXw/RJcV9w4HDwoMjJ/nyzVRjQHjxzJ78MuLSWl3Q5oA 3faKB9aTcZX+3d38xyAS/yTI1bZv0ZfNf2OfmNP27sn3KVIfuD+spD8zX Q==; Date: Fri, 12 Nov 2021 12:49:54 +0100 From: Vincent Whitchurch To: Jim Cromie Message-ID: <20211112114953.GA1381@axis.com> References: <20211111220206.121610-1-jim.cromie@gmail.com> <20211111220206.121610-9-jim.cromie@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20211111220206.121610-9-jim.cromie@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Mailman-Approved-At: Fri, 12 Nov 2021 14:25:12 +0000 Subject: Re: [Intel-gfx] [PATCH v10 08/10] dyndbg: add print-to-tracefs, selftest with it - RFC X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: quic_saipraka@quicinc.com, catalin.marinas@arm.com, dri-devel@lists.freedesktop.org, will@kernel.org, maz@kernel.org, amd-gfx@lists.freedesktop.org, mingo@redhat.com, daniel.vetter@ffwll.ch, arnd@arndb.de, linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org, rostedt@goodmis.org, jbaron@akamai.com, seanpaul@chromium.org, intel-gvt-dev@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, quic_psodagud@quicinc.com, mathieu.desnoyers@efficios.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Thu, Nov 11, 2021 at 03:02:04PM -0700, Jim Cromie wrote: > Sean Paul proposed, in: > https://patchwork.freedesktop.org/series/78133/ > drm/trace: Mirror DRM debug logs to tracefs > > His patchset's objective is to be able to independently steer some of > the drm.debug stream to an alternate tracing destination, by splitting > drm_debug_enabled() into syslog & trace flavors, and enabling them > separately. 2 advantages were identified: > > 1- syslog is heavyweight, tracefs is much lighter > 2- separate selection of enabled categories means less traffic > > Dynamic-Debug can do 2nd exceedingly well: > > A- all work is behind jump-label's NOOP, zero off cost. > B- exact site selectivity, precisely the useful traffic. > can tailor enabled set interactively, at shell. > > Since the tracefs interface is effective for drm (the threads suggest > so), adding that interface to dynamic-debug has real potential for > everyone including drm. > > if CONFIG_TRACING: > > Grab Sean's trace_init/cleanup code, use it to provide tracefs > available by default to all pr_debugs. This will likely need some > further per-module treatment; perhaps something reflecting hierarchy > of module,file,function,line, maybe with a tuned flattening. > > endif CONFIG_TRACING > > Add a new +T flag to enable tracing, independent of +p, and add and > use 3 macros: dyndbg_site_is_enabled/logging/tracing(), to encapsulate > the flag checks. Existing code treats T like other flags. I posted a patchset a while ago to do something very similar, but that got stalled for some reason and I unfortunately didn't follow it up: https://lore.kernel.org/lkml/20200825153338.17061-1-vincent.whitchurch@axis.com/ A key difference between that patchset and this patch (besides that small fact that I used +x instead of +T) was that my patchset allowed the dyndbg trace to be emitted to the main buffer and did not force them to be in an instance-specific buffer. That feature is quite important at least for my use case since I often use dyndbg combined with function tracing, and the latter doesn't work on non-main instances according to Documentation/trace/ftrace.rst. For example, here's a random example of a bootargs from one of my recent debugging sessions: trace_event=printk:* ftrace_filter=_mmc*,mmc*,sd*,dw_mci*,mci* ftrace=function trace_buf_size=20M dyndbg="file drivers/mmc/* +x" From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA8D5C433F5 for ; Fri, 12 Nov 2021 11:49:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A265860E53 for ; Fri, 12 Nov 2021 11:49:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234144AbhKLLwr (ORCPT ); Fri, 12 Nov 2021 06:52:47 -0500 Received: from smtp2.axis.com ([195.60.68.18]:44679 "EHLO smtp2.axis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234656AbhKLLwr (ORCPT ); Fri, 12 Nov 2021 06:52:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1636717797; x=1668253797; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=pKNzvHA+abG5/SB0rgSIMnr0AelDwIA74K7UU91Gfho=; b=lyokw6DG7Ot0MohX4IPxCAMCXzH1jPvqJvIndKT8WSI0FccbqM2acMbX eqAUqg4ho0FSj6qdvjhPJ1D+iZowR4m0mm3JwMhSQvOdx9lRT/SHCGBdL RItvbEUegMBN0GA88mbxJ2pHXRNWQB8WCciK5iPGGu3DACvsjuAN0A6Or S6UuHUAgN1NqBMiQ2eNHx1yOMj9dfTRac5UR0SUa6ekZG+GwPNYoCUSHI 0IVsKcaD9AISm9oBFaDCkk+TyLqQr7SpBWgi5OZxZRIpoDoaqRKpfBh/7 wYx10DHvO+rkleW86eTR0CXYT7EVBGkjZ115YObRFprqudunCXKRSjUC3 w==; Date: Fri, 12 Nov 2021 12:49:54 +0100 From: Vincent Whitchurch To: Jim Cromie CC: , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v10 08/10] dyndbg: add print-to-tracefs, selftest with it - RFC Message-ID: <20211112114953.GA1381@axis.com> References: <20211111220206.121610-1-jim.cromie@gmail.com> <20211111220206.121610-9-jim.cromie@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20211111220206.121610-9-jim.cromie@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Thu, Nov 11, 2021 at 03:02:04PM -0700, Jim Cromie wrote: > Sean Paul proposed, in: > https://patchwork.freedesktop.org/series/78133/ > drm/trace: Mirror DRM debug logs to tracefs > > His patchset's objective is to be able to independently steer some of > the drm.debug stream to an alternate tracing destination, by splitting > drm_debug_enabled() into syslog & trace flavors, and enabling them > separately. 2 advantages were identified: > > 1- syslog is heavyweight, tracefs is much lighter > 2- separate selection of enabled categories means less traffic > > Dynamic-Debug can do 2nd exceedingly well: > > A- all work is behind jump-label's NOOP, zero off cost. > B- exact site selectivity, precisely the useful traffic. > can tailor enabled set interactively, at shell. > > Since the tracefs interface is effective for drm (the threads suggest > so), adding that interface to dynamic-debug has real potential for > everyone including drm. > > if CONFIG_TRACING: > > Grab Sean's trace_init/cleanup code, use it to provide tracefs > available by default to all pr_debugs. This will likely need some > further per-module treatment; perhaps something reflecting hierarchy > of module,file,function,line, maybe with a tuned flattening. > > endif CONFIG_TRACING > > Add a new +T flag to enable tracing, independent of +p, and add and > use 3 macros: dyndbg_site_is_enabled/logging/tracing(), to encapsulate > the flag checks. Existing code treats T like other flags. I posted a patchset a while ago to do something very similar, but that got stalled for some reason and I unfortunately didn't follow it up: https://lore.kernel.org/lkml/20200825153338.17061-1-vincent.whitchurch@axis.com/ A key difference between that patchset and this patch (besides that small fact that I used +x instead of +T) was that my patchset allowed the dyndbg trace to be emitted to the main buffer and did not force them to be in an instance-specific buffer. That feature is quite important at least for my use case since I often use dyndbg combined with function tracing, and the latter doesn't work on non-main instances according to Documentation/trace/ftrace.rst. For example, here's a random example of a bootargs from one of my recent debugging sessions: trace_event=printk:* ftrace_filter=_mmc*,mmc*,sd*,dw_mci*,mci* ftrace=function trace_buf_size=20M dyndbg="file drivers/mmc/* +x" From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37437C433EF for ; Fri, 12 Nov 2021 11:51:15 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F327060E8F for ; Fri, 12 Nov 2021 11:51:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F327060E8F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=axis.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=G0SXSwoTGASXecQ1EF/67QdcRxUkan4TcGGuVBIALAk=; b=nLc+B+Sm9OoPHV TJA3zwqQbhh+yBwh4986oe6VpDODoz0qvG9sfgLFgxUz+eHVKqGNuTXUNJU9aQ7Pm61Bul8rTnkhk 8LFb7lSnKI4BldVSPoy6kVtWFJh648bVDIWKMhxOAcRxZcQJbkN1tCTcMmT4n9nuvkYgZZCqErjOJ bK5bYpjICCJUx1QZxJKIo9GNvjrRIb8VMJW2sMcW6DmqALd4RFESAy9glICHpVLJ+whcHIut6R47K Ac4p46MEjHUFeqGn9uhmOz67h2KEizZhndErygw6EOOdHF/HBXH3GcBsV4BKIvDQv07zgAM2fSh7D lIjUrREd8SJlHwYIShhw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mlV4I-00AAp5-EM; Fri, 12 Nov 2021 11:50:06 +0000 Received: from smtp2.axis.com ([195.60.68.18]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mlV4D-00AAlM-Um for linux-arm-kernel@lists.infradead.org; Fri, 12 Nov 2021 11:50:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1636717802; x=1668253802; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=pKNzvHA+abG5/SB0rgSIMnr0AelDwIA74K7UU91Gfho=; b=hBCbpAOATmcezc99MwliWJt8AJCEna6SqLDZY4sLUGRj0R/jPq1StHiK X5pX3zmekdMNG/AvPbDxK8QZnj4IZNIZjf15esqVDimB+8pHKDclaKyxN MjmWH6UoacihIdH86S0I+ZtG3oIu3RMymBOzNa1t/wYzQ+JZ3tkgiHey1 AVO2SRuLsT0KUfgcgdY4wHw/tcBTig+wqzxVXz+DgiBl60Jw/ahVRUy+2 6MRT3KzRvNV9UZfL3zzuVIJvlJCFllMvtATNjh4UhnMZarCSGIs4kz87/ uqsIuxHtjFwAEGAIVpxuj00vpfe84xfotqsV8KjmJuUnN8HjMQhrxNWgG w==; Date: Fri, 12 Nov 2021 12:49:54 +0100 From: Vincent Whitchurch To: Jim Cromie CC: , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v10 08/10] dyndbg: add print-to-tracefs, selftest with it - RFC Message-ID: <20211112114953.GA1381@axis.com> References: <20211111220206.121610-1-jim.cromie@gmail.com> <20211111220206.121610-9-jim.cromie@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211111220206.121610-9-jim.cromie@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211112_035002_449592_4334614E X-CRM114-Status: GOOD ( 15.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Nov 11, 2021 at 03:02:04PM -0700, Jim Cromie wrote: > Sean Paul proposed, in: > https://patchwork.freedesktop.org/series/78133/ > drm/trace: Mirror DRM debug logs to tracefs > > His patchset's objective is to be able to independently steer some of > the drm.debug stream to an alternate tracing destination, by splitting > drm_debug_enabled() into syslog & trace flavors, and enabling them > separately. 2 advantages were identified: > > 1- syslog is heavyweight, tracefs is much lighter > 2- separate selection of enabled categories means less traffic > > Dynamic-Debug can do 2nd exceedingly well: > > A- all work is behind jump-label's NOOP, zero off cost. > B- exact site selectivity, precisely the useful traffic. > can tailor enabled set interactively, at shell. > > Since the tracefs interface is effective for drm (the threads suggest > so), adding that interface to dynamic-debug has real potential for > everyone including drm. > > if CONFIG_TRACING: > > Grab Sean's trace_init/cleanup code, use it to provide tracefs > available by default to all pr_debugs. This will likely need some > further per-module treatment; perhaps something reflecting hierarchy > of module,file,function,line, maybe with a tuned flattening. > > endif CONFIG_TRACING > > Add a new +T flag to enable tracing, independent of +p, and add and > use 3 macros: dyndbg_site_is_enabled/logging/tracing(), to encapsulate > the flag checks. Existing code treats T like other flags. I posted a patchset a while ago to do something very similar, but that got stalled for some reason and I unfortunately didn't follow it up: https://lore.kernel.org/lkml/20200825153338.17061-1-vincent.whitchurch@axis.com/ A key difference between that patchset and this patch (besides that small fact that I used +x instead of +T) was that my patchset allowed the dyndbg trace to be emitted to the main buffer and did not force them to be in an instance-specific buffer. That feature is quite important at least for my use case since I often use dyndbg combined with function tracing, and the latter doesn't work on non-main instances according to Documentation/trace/ftrace.rst. For example, here's a random example of a bootargs from one of my recent debugging sessions: trace_event=printk:* ftrace_filter=_mmc*,mmc*,sd*,dw_mci*,mci* ftrace=function trace_buf_size=20M dyndbg="file drivers/mmc/* +x" _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ABB5DC433EF for ; Sun, 14 Nov 2021 10:05:35 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3CB9E60F22 for ; Sun, 14 Nov 2021 10:05:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3CB9E60F22 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=axis.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2C74189D1D; Sun, 14 Nov 2021 10:05:34 +0000 (UTC) X-Greylist: delayed 432 seconds by postgrey-1.36 at gabe; Fri, 12 Nov 2021 11:57:09 UTC Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0EDF26ED9F; Fri, 12 Nov 2021 11:57:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1636718229; x=1668254229; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=pKNzvHA+abG5/SB0rgSIMnr0AelDwIA74K7UU91Gfho=; b=krDLYRCh9mmz1cbv5/Y+yut07sDSuXqpKS5KIxJE6CGhU53rGnB2wSUS S/HZxvMX232pvyeFYMcihhMfY54fSu5iAsy4lhkQPtB4IFs+6Uv1Iyibi yF6AQ3iF5UemhTCc7G9ccwlDig/T8rKjscuzPhTN6UeOqkkwnyOpzB86d MrClvjWTuvRARyhaDbLov8IFJ3DvKrWXJJ7igqnGAGtTRLVABqM7bv5yT litYiMmweysBpuXw/RJcV9w4HDwoMjJ/nyzVRjQHjxzJ78MuLSWl3Q5oA 3faKB9aTcZX+3d38xyAS/yTI1bZv0ZfNf2OfmNP27sn3KVIfuD+spD8zX Q==; Date: Fri, 12 Nov 2021 12:49:54 +0100 From: Vincent Whitchurch To: Jim Cromie Subject: Re: [PATCH v10 08/10] dyndbg: add print-to-tracefs, selftest with it - RFC Message-ID: <20211112114953.GA1381@axis.com> References: <20211111220206.121610-1-jim.cromie@gmail.com> <20211111220206.121610-9-jim.cromie@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20211111220206.121610-9-jim.cromie@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Mailman-Approved-At: Sun, 14 Nov 2021 10:05:32 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: quic_saipraka@quicinc.com, catalin.marinas@arm.com, dri-devel@lists.freedesktop.org, will@kernel.org, maz@kernel.org, amd-gfx@lists.freedesktop.org, mingo@redhat.com, daniel.vetter@ffwll.ch, arnd@arndb.de, linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org, rostedt@goodmis.org, jbaron@akamai.com, seanpaul@chromium.org, intel-gvt-dev@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, sean@poorly.run, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, quic_psodagud@quicinc.com, mathieu.desnoyers@efficios.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Nov 11, 2021 at 03:02:04PM -0700, Jim Cromie wrote: > Sean Paul proposed, in: > https://patchwork.freedesktop.org/series/78133/ > drm/trace: Mirror DRM debug logs to tracefs > > His patchset's objective is to be able to independently steer some of > the drm.debug stream to an alternate tracing destination, by splitting > drm_debug_enabled() into syslog & trace flavors, and enabling them > separately. 2 advantages were identified: > > 1- syslog is heavyweight, tracefs is much lighter > 2- separate selection of enabled categories means less traffic > > Dynamic-Debug can do 2nd exceedingly well: > > A- all work is behind jump-label's NOOP, zero off cost. > B- exact site selectivity, precisely the useful traffic. > can tailor enabled set interactively, at shell. > > Since the tracefs interface is effective for drm (the threads suggest > so), adding that interface to dynamic-debug has real potential for > everyone including drm. > > if CONFIG_TRACING: > > Grab Sean's trace_init/cleanup code, use it to provide tracefs > available by default to all pr_debugs. This will likely need some > further per-module treatment; perhaps something reflecting hierarchy > of module,file,function,line, maybe with a tuned flattening. > > endif CONFIG_TRACING > > Add a new +T flag to enable tracing, independent of +p, and add and > use 3 macros: dyndbg_site_is_enabled/logging/tracing(), to encapsulate > the flag checks. Existing code treats T like other flags. I posted a patchset a while ago to do something very similar, but that got stalled for some reason and I unfortunately didn't follow it up: https://lore.kernel.org/lkml/20200825153338.17061-1-vincent.whitchurch@axis.com/ A key difference between that patchset and this patch (besides that small fact that I used +x instead of +T) was that my patchset allowed the dyndbg trace to be emitted to the main buffer and did not force them to be in an instance-specific buffer. That feature is quite important at least for my use case since I often use dyndbg combined with function tracing, and the latter doesn't work on non-main instances according to Documentation/trace/ftrace.rst. For example, here's a random example of a bootargs from one of my recent debugging sessions: trace_event=printk:* ftrace_filter=_mmc*,mmc*,sd*,dw_mci*,mci* ftrace=function trace_buf_size=20M dyndbg="file drivers/mmc/* +x"