Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2461019ybt; Tue, 16 Jun 2020 06:47:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwxxAsSiQy9yOO/tbXacVeGD7mhbm3oIyef91aA4jt2rwZyjv6waD3gXStqqPXucF5DVh6 X-Received: by 2002:a50:88e1:: with SMTP id d88mr2688096edd.74.1592315270284; Tue, 16 Jun 2020 06:47:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592315270; cv=none; d=google.com; s=arc-20160816; b=ymDZOkmlzEkMFj6v07jIDXkcdBknCMsocVXKvDg27k1E3NqLgSbiHCKCLbet5kPv9I JJKEdKe4YEDEQPbhFHIcgCZcJbLuuQB5RCMOErINv+Xunw3/MgZwUpYG879hHvv5AOSB yF4ivIA0hTCMsdDSVgeRc0TOPrHAu9i9qK6TCJNmMlcYyEXk3Um+qm47GSi72VxsVVmQ SWtZelgURR1h9WdVkIzIIjiBfjmeuH15DNulTPrvjaIORvo6nuqUkWPn/+hsH3qBh/xD x9I7NQbGpNAPejN6iKYmCDPhPJNdE/5u2g+boqQKw8TUrFNeTcy0LsgOHEel4rbvmYFx cQ4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=hmHFa1YhQuDvLxP4cWmHk3hT6A5J4072QcUV65Uvauo=; b=a7l2+/3lhXVQYM6DJfsAo4gIdOtxmljaoLjaBAbomohWHdaUzH2tv2thioD6dnnf5P wqz7kkzmvUKhbk3mnV6Wj8W2IpXPSLs2q+Q2WVWVkPdGdwsHQCLOhLntwq2QNO0zNKAw nR6u1LinuVxabBPDxPXgTCE/XrRWg7CwOu1ozRSlbVKOcuzOeNuuNbrJ2RpfAAdwMeyZ Uxi50K/8Ve33NEdBUgF2Osimf3UlcOGkrx4xLWfSAnHip+fi3FrL9XXsqT0MwBQaHsU5 jjal87yHj0LhE5YjkwTbmWbNgY7LpbWUoy4iCepJGDswhwzVf3Z3grufn3a5YDG7jF9n 5EIQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r21si10780356ejb.629.2020.06.16.06.47.26; Tue, 16 Jun 2020 06:47:50 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728928AbgFPNpL (ORCPT + 99 others); Tue, 16 Jun 2020 09:45:11 -0400 Received: from mx2.suse.de ([195.135.220.15]:49226 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727966AbgFPNpL (ORCPT ); Tue, 16 Jun 2020 09:45:11 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 6B659B18F; Tue, 16 Jun 2020 13:45:13 +0000 (UTC) Date: Tue, 16 Jun 2020 15:45:07 +0200 From: Petr Mladek To: Jim Cromie Cc: jbaron@akamai.com, linux-kernel@vger.kernel.org, akpm@linuxfoundation.org, gregkh@linuxfoundation.org, linux@rasmusvillemoes.dk Subject: Re: [PATCH v2 20/24] dyndbg: WIP towards debug-print-class based callsite controls Message-ID: <20200616134507.GO31238@alley> References: <20200613155738.2249399-1-jim.cromie@gmail.com> <20200613155738.2249399-21-jim.cromie@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200613155738.2249399-21-jim.cromie@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat 2020-06-13 09:57:34, Jim Cromie wrote: > 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. I agree that it might make sense to provide some common mechanism. > 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 only. > > proposed API: > > Usage model is for a module developer to create N exclusive subsets of > pr_debug()s by changing some of them to pr_debug_n(1,) .. pr_debug_n(N,). > Each callsite must be a single print-class, with 0 default. > > No multi-type classification ala pr_debug_M(1|2, ...) is contemplated. > > 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) My problem with this approach is that it is too generic. Each class would have different meaning in each subsystem. It might help to replace any existing variants. But it would be hard for developers debugging the code. They would need to study/remember the meaning of these groups for particular subsystems. They would need to set different values for different messages. Could you please provide more details about the potential users? Would be possible to find some common patterns and common meaning of the groups? Best Regards, Petr