Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp632037rdb; Fri, 6 Oct 2023 13:50:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFydBsHzsQyihRGZXgD2dA0WfAcQiVzH4HmQbCd0OqDQG2Uq4LbTDVHXLnhTpqP4I8gOIr/ X-Received: by 2002:a05:6358:339b:b0:143:9235:9f1f with SMTP id i27-20020a056358339b00b0014392359f1fmr8301387rwd.12.1696625414613; Fri, 06 Oct 2023 13:50:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696625414; cv=none; d=google.com; s=arc-20160816; b=iwirA1ZUOAmsg/gt3pVn8fi2hUeq+uW8KWlsycSL5E/3cTXI8I8jQpysWcM1GgaRNa A8T7Aowe4YSOU7NxgHxq3CT7mwIN6ESXpcUpgc7o23+hiVPepYc3Dvo/7zZ2H/OOQBLV tWm+ZjInOyKCeo7CpSL1NPuuRzhBJ8pE4g5yNHZ8bfTucZwlBMIhnjTj0upDjRmfA36b mZYhQxFFyidVwYaUWPOKS+yxNmo3g+wyEVPzzRLSbP5ubAbP8pd0/RKvhpAeLAIJmSV9 9GKnMHiWnpBy8VZBFkZLMiCLh9Lbz+EDu5jnWU632bEZTyHFqu0CP8iEecvNZv2sCfds zrKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=/HWI3D+cCfI1nobgtFE3STx3AOmEXU67GbLWlT3pGGA=; fh=MhCcOzC6J8P2VUux/EgO5cdfZDtFkdvrdhOVQpkOdJ4=; b=ACvXFDSF7lrI6rTs3DO4QvvwjpeEQ3daPsCNOhDv5RjGjLM3RPlUNfzNcMno+MoutB 5ZpiJNhMSHgrmGhI5Cad+ktjzTNPpxBxVZwIu0OTWMfNnmtxsdPZG1knHm8AG2RTAMaY NMJQpz/134pmvTuksCmrQt5tttuMPrNW+ftxvIOqC5xc7MHi0RG9fPgtwzaso5KQjGFP c+wIygHOq8sJtiWFV2iqiexy8ZikidqhGWU4GM1jh5jJxtbP41lKfBLLU+NlM9+Spaao owMYwQ7snwagYiSaZzF+A6HiiP31dj9eSJ9+RQpIV2eiWfGNEMA0AjqUnvYaB3Gk56M/ euNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=cJkyxAiN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id s27-20020a63925b000000b00573fc592e9dsi1139198pgn.848.2023.10.06.13.50.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 13:50:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=cJkyxAiN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 33F9D8211423; Fri, 6 Oct 2023 13:50:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233525AbjJFUt6 (ORCPT + 99 others); Fri, 6 Oct 2023 16:49:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233558AbjJFUt5 (ORCPT ); Fri, 6 Oct 2023 16:49:57 -0400 Received: from mail-vs1-xe31.google.com (mail-vs1-xe31.google.com [IPv6:2607:f8b0:4864:20::e31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F2B2C2 for ; Fri, 6 Oct 2023 13:49:55 -0700 (PDT) Received: by mail-vs1-xe31.google.com with SMTP id ada2fe7eead31-45271a44cc4so1170132137.2 for ; Fri, 06 Oct 2023 13:49:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696625394; x=1697230194; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/HWI3D+cCfI1nobgtFE3STx3AOmEXU67GbLWlT3pGGA=; b=cJkyxAiNRUxD4Weq6e2Ddh4s4cfPS14GZOkMe1Jcl1nF0KiJaqqhdOkQ+t9pCb/mXu xem+Gile5ukZOAD7V0TUILn3QCpITNsLWlvEuPSFkacTviYhcq0eype7sRhA1IbiAFsY jm1ezHxMJN91rDbyDGykoZ97hvA5fBSi46fD66gaTH+K3Ez4PCkU5AQxLObqnzS34jGP YH/ULATqL8YSVXJiCfScCkp3Ir/crG1OTCjTw23WsvyzVwbg7oKBu+PlyF/geRUhZ10G jjCkG5InWIN0p6vNTILP7MmQwk/yi4ZV/6cDaQJoiHUS8mn4fyVS3qTGCGIi8HOjr3i2 paxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696625394; x=1697230194; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/HWI3D+cCfI1nobgtFE3STx3AOmEXU67GbLWlT3pGGA=; b=RFKSxKsigmIfiXJpHjA4xjznwwa1uN24AbRPPKzAh0TAz0KJSsVXzQHZolwQJ28QuK IWIJ+ybwviJf75xpnolNXYXiJD4aWAoY1XLYeUDWWlul7afNWV4gAQEBbct7XsPyvUv8 ysbWi6JH9Wfh0Pb7adQYOm1lJuVp6sQCr77VT+tOhYOYIcC8c7aDjpzkUBHFbS/4I0gd FtntIiUoINychds6H8IU+2lVRwGKk0aZvziEsPOJRvlSevFm1P8PvqdDNrJ31jQDp5s7 ebIsv16/1fuwTyD+TKWSkrjls56lMYn1kWMy6WnqCpqy2tID+ckgvCF0Jh0OT6qhwcyJ x3Rg== X-Gm-Message-State: AOJu0YxcGBXYL4Q9pNmxZPt3AXu6Rz//4NjOQFA+HgGcgjCmMxKE3oFF tZILSPazz32DSgZYGmO18hrXVPK0i9pZPuoz1yc= X-Received: by 2002:a67:f44a:0:b0:452:5798:64bc with SMTP id r10-20020a67f44a000000b00452579864bcmr10608075vsn.6.1696625394185; Fri, 06 Oct 2023 13:49:54 -0700 (PDT) MIME-Version: 1.0 References: <20230915154856.1896062-1-lb@semihalf.com> <20231003155810.6df9de16@gandalf.local.home> In-Reply-To: From: jim.cromie@gmail.com Date: Fri, 6 Oct 2023 14:49:27 -0600 Message-ID: Subject: Re: [PATCH v1] dynamic_debug: add support for logs destination To: =?UTF-8?Q?=C5=81ukasz_Bartosik?= Cc: Steven Rostedt , Jason Baron , Andrew Morton , Kees Cook , Douglas Anderson , Guenter Roeck , Yaniv Tzoreff , Benson Leung , linux-kernel@vger.kernel.org, upstream@semihalf.com, Vincent Whitchurch Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=3.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 06 Oct 2023 13:50:12 -0700 (PDT) X-Spam-Level: ** On Wed, Oct 4, 2023 at 4:55=E2=80=AFAM =C5=81ukasz Bartosik wrote: > > wt., 3 pa=C5=BA 2023 o 22:54 napisa=C5=82(a): > > > > On Tue, Oct 3, 2023 at 1:57=E2=80=AFPM Steven Rostedt wrote: > > > > > > On Mon, 2 Oct 2023 14:49:20 -0600 > > > jim.cromie@gmail.com wrote: > > > > > > > hi Lukasz, > > > > > > > > sorry my kernel-time has been in my own trees. > > > > > > > > What I dont understand is why +T is insufficient. > > > > > > We would like to be able to separate debug logs from different > subsystem (e.g. thunderbolt and usbcore). > With +T it is not possible because all debug logs will land in the same b= ucket. > > > > > IIUC, tracefs is intended for production use. > > > > thats why each event can be enabled / disabled > > > > - to select and minimize whats traced, and not impact the system > > > > > > > > and +T can forward all pr_debugs to trace, > > > > (by 1-few trace events defined similarly to others) > > > > or very few, giving yet another selection mechanism > > > > to choose or eliminate specific pr-debugs and reduce traffic to > > > > interesting stuff. > > > > > > > > Once your debug is in the trace-buf, > > > > shouldnt user-space be deciding what to do with it ? > > > > a smart daemon could leverage tracefs to good effect. > > > > > > Yes, a daemon could separate the debug logs but IMHO it is much > easier to separate logs by sending them directly from a given subsystem > to a separate trace instance. My proposal allows to configure different > trace instance as destination for each callsite. > > > > > IMO the main value of +T is that it allows feeding existing pr_debu= gs > > > > into the place where other trace-data is already integrated and man= aged. > > > > > > > > At this point, I dont see any extra destination handling as prudent= . > > > > > > > > > > > > > I'm fine with either approach. I kind of like the creation of the ins= tance, > > > as that allows the user to keep this debug separate from other tracin= g > > > going on. We are starting to have multiple applications using the tra= cing > > > buffer (although most are using instances, which is why I'm trying to= make > > > them lighter weight with the eventfs code). > > > > > > -- Steve > > > > > Steve, thanks for commenting from the trace perspective. > > > > > > > Ok Im starting to grasp that multiple instances are good > > (and wondering how I didnt notice) > > > > What doesnt thrill me is the new _ddebug field, it enlarges the footpri= nt. > > > > Yes it increases _ddebug structure by a pointer size. > > > can you make it go away ? > > I implemented my proposal with flexibility in mind so that if someone > would like to add > another destination in the future it should be easy to do. I > understand that adding a pointer > to the _ddebug structure increases footprint size that's why I also > added CONFIG_DYNAMIC_DEBUG_DST > kernel configuration option in order to enable/disable this functionality= . > > > I have some thoughts .. > > Please share your thoughts. I'm sure we can come to an agreement how > to incorporate both +T and my proposal. So heres what Im thinking: shrink lineno, get 2-3 bits back. last I checked largest C file is <32kloc largest header is ~120kloc, but its a data only, no pr_debugs will suddenly appear there. define a dst_id field with 3 bits 0 is for main tracebuf 1-7 is for other instances then the alt-dest lookup is avoided except when the dst_id field is >0 It might work to put the alt-dst-pointer into the classmaps, so the destination is used for the entire group of debugs forex DRM_UT_CORE etc. But its no better than the dst_id field, which is per-callsite, and entirely independent of classes. > Thanks, > Lukasz