Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp60431ybg; Thu, 11 Jun 2020 17:11:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqRPq0gNO/BMmWVwSShKEBeyBqz6A4WPO+kVJiYESTj8VuHUYUM8kSXW2LrQLsjCTQuQNC X-Received: by 2002:a05:6402:1bde:: with SMTP id ch30mr9524374edb.163.1591920698429; Thu, 11 Jun 2020 17:11:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591920698; cv=none; d=google.com; s=arc-20160816; b=vyQsAjfwzFkX0gOQv6fCctDvBtvarYhjrpje9Lqn0LzLdDckmw+EeHVGHgrjT36Odf udeyXjgctFxLLFEIrcPMie68gqTvTDXHSXKuEAX7egmNoLwf7WKDOFUI3V1pkjC9YbF3 61ccL53qFRaEbRE34zg/mfB/rNbWrfr8aaSQ9zSBV3uFcOOFqsdaMcaQyAepUA8vwn9e cw8wstgCSZAV4hJU89cneQidYdE9L+45s2BIlSDVcC0pK21Bf8RhRNmnQDYTUc4hCnN9 7Os4LSi/ZEKhb78KzcjDD8j2voySWzq22bmDMsSRZSEtjmMA4pMsW0ZmsWeUJwjIrF+X 3GDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=dQ0wVuVD5mbnL9oat3E9xbZZtGvABVpYY6zoc/gC/as=; b=l4R2H2+hsQnktMoI4bajSscm3DK7Z2kHXOthsSRfKEF1bfTnU0hZX+J5kggAn7p50o PegEwnf6SLzTvxNqdaJOZa9v+aNDUD+T4qIBjcaQYGEtZoJN1IB0of7PPMPVJ+7+PWF7 UavXgjVGnMWsl4V68/IU/OxdxV5eFu20EUony6OG1s7QFMefC7OUaeYGWgKRiEzo4w24 /TZ8vDvvRLflYX0fRyKKtvFrCD0Eov5NSSwN3Eu9HWkB876BUc+bH36jNo6tdgrhamiw 2uR+HbGQZSbUnEDs+yi6nbyFPFAXONYRzIkJypa8gCRiSv8tV7OnbRilTojRxwMfMSSV vzXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="SM9Ay2c/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ha1si2946990ejb.67.2020.06.11.17.11.13; Thu, 11 Jun 2020 17:11:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="SM9Ay2c/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726401AbgFLAJT (ORCPT + 99 others); Thu, 11 Jun 2020 20:09:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726285AbgFLAJR (ORCPT ); Thu, 11 Jun 2020 20:09:17 -0400 Received: from mail-vs1-xe43.google.com (mail-vs1-xe43.google.com [IPv6:2607:f8b0:4864:20::e43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C0C0C08C5C1; Thu, 11 Jun 2020 17:09:16 -0700 (PDT) Received: by mail-vs1-xe43.google.com with SMTP id y123so4376330vsb.6; Thu, 11 Jun 2020 17:09:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dQ0wVuVD5mbnL9oat3E9xbZZtGvABVpYY6zoc/gC/as=; b=SM9Ay2c/2xgFdaM32eJi+cNPWo3yB3m6cBPUuiHhkD3ji1sb4saRSL6ZbZzg4xzfzC Ego6OC6WRzAMugcreC7TNtKgVF2EXQj5tjsLBlWwGNxQd3g+pQo1WSDsHq8gLQPslSb3 qYCUJmIec6mluqiRWzPf7jmgb+UcRBbbgiD+kkwOSmXamFlGeqv4rRicZwBjhtddJv8N hxYqaMTbKHEVg/CCboYR7XW4a4Mnh8K11q8r45irojfEgdFCz0TStwMS5vbQsV1yQuJY XpiGeICTU6PeKdq0oLyX0cd2FXsHe8XhKZDRY8wtP+TxgbhYLu4/yAGowrLOVRya4fhn VDdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dQ0wVuVD5mbnL9oat3E9xbZZtGvABVpYY6zoc/gC/as=; b=KxVcX1WSjbFHFxzJsNjm66+1Nd8fZIjUBOxWAqCjBfSZtvAr2lYizKv4e8yHS8Pn2B CBfj8hpvuoQAnr64xhYDZYFPiiPjWczM+DXEq4iRYFxTMxWUFyulST957AqmE3Vu7O/o QJ6J14ZTaDCLHmJFGFL+zYxuxlFN2ucjvQgk/UisurfWDFETR9WHIu/BZxin5adIqLdJ ECbusvOyIaJl2Iwr0R5jcZLbWMIAf9C3STo7J0AN9edJGCNnUk6IwVjX85AbOU133g4l IYRRp2et5mQ9mbxbUZanVsTDbukPslQMqHZdHUldjXomyAFV4awQLe1DadD1AQN2NFb9 3r9g== X-Gm-Message-State: AOAM5338trVPdixgOYMt+U9XtV2SoiQxdJBkqn04IAv/+1Pji2z1D+sg WRDH9EU/fscAkwkgyrU39rEx9PZRJcUGybdCBU0Yn2zJ X-Received: by 2002:a67:f918:: with SMTP id t24mr8872355vsq.18.1591920554784; Thu, 11 Jun 2020 17:09:14 -0700 (PDT) MIME-Version: 1.0 References: <20200609104604.1594-7-stanimir.varbanov@linaro.org> <20200609111414.GC780233@kroah.com> <20200610133717.GB1906670@kroah.com> <31e1aa72b41f9ff19094476033511442bb6ccda0.camel@perches.com> <2fab7f999a6b5e5354b23d06aea31c5018b9ce18.camel@perches.com> <20200611062648.GA2529349@kroah.com> <20200611105217.73xwkd2yczqotkyo@holly.lan> <20200611121817.narzkqf5x7cvl6hp@holly.lan> In-Reply-To: From: jim.cromie@gmail.com Date: Thu, 11 Jun 2020 18:08:48 -0600 Message-ID: Subject: Re: [PATCH v3 6/7] venus: Make debug infrastructure more flexible To: Daniel Thompson Cc: Stanimir Varbanov , Joe Perches , Greg Kroah-Hartman , Linux Documentation List , LKML , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-acpi@vger.kernel.org, netdev@vger.kernel.org, Jason Baron Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org calling out some thinkos On Thu, Jun 11, 2020 at 3:19 PM wrote: > > heres what I have in mind. whats described here is working. > I'll send it out soon > > commit 20298ec88cc2ed64269c8be7b287a24e60a5347e > Author: Jim Cromie > Date: Wed Jun 10 12:55:08 2020 -0600 > > dyndbg: WIP towards module->debugflags based callsite controls > > There are *lots* of ad-hoc debug printing solutions in kernel, > this is a 1st attempt at providing a common mechanism for many of them. > > Basically, there are 2 styles of debug printing: > - levels, with increasing verbosity, 1-10 forex > - bits/flags, independently controlling separate groups of dprints > > This patch does bits/flags (with no distinction made yet between 2) > > API: > > - change pr_debug(...) --> pr_debug_typed(type_id=0, ...) pr_debug, pr_debug_n now in printk.h _?_?dynamic_.+_cl adaptations in dynamic_debug.h > - all existing uses have type_id=0 > - developer creates exclusive types of log messages with type_id>0 > 1, 2, 3 are disjoint groups, for example: hi, mid, low > > - !!type_id is just an additional callsite selection criterion > > Qfoo() { echo module foo $* >/proc/dynamic_debug/control } > Qfoo +p # all groups, including default 0 > Qfoo mflags 1 +p # only group 1 > Qfoo mflags 12 +p # TBD[1]: groups 1 or 2 > Qfoo mflags 0 +p # ignored atm TBD[2] > Qfoo mflags af +p # TBD[3]: groups a or f (10 or 15) > > so patch does: > > - add u32 debugflags to struct module. Each bit is a separate print-class. this is feeling wrong now. setting these bits would have to trigger an update via ddebug_exec_query kinda like setting a bit would trigger echo module $foo mflags $bitpos +p > control its possible, but not 1st, or 2nd perhaps. In general Im quite leery of rigging up some callback to do it. its prudent to effect all debug changes via >control > - in ddebug_change() > filter on !! module->debugflags, > IFF query->module is given, and matches dt->mod_name > and query->mflags is given, and bitmatches module->debugflags wrong, ddebug_change cannot respond to changes of debugflags, most it could do is consult it on queries > - in parse_query() > accept new query term: mflags $arg > populate query->mflags > arg-type needs some attention, but basic plumbing is there > > WIP: not included: > > - pr_debug_typed( bitpos=0, ....)' now done, as pr_debug_n, pr_debug in printk.h Ive adapted the macros with a "_cl(cl, " insertion, also added trailing prcls to control output > > - no way to exersize new code in ddebug_change > need pr_debug_typed() to make a (not-null) typed callsite. > also no way to set module->debugflags close enough to see the thinkos