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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DCC1C433E0 for ; Thu, 18 Feb 2021 12:42:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D51A960C3D for ; Thu, 18 Feb 2021 12:42:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230519AbhBRMkX (ORCPT ); Thu, 18 Feb 2021 07:40:23 -0500 Received: from mx2.suse.de ([195.135.220.15]:46680 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230306AbhBRK7q (ORCPT ); Thu, 18 Feb 2021 05:59:46 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1613645912; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yx8UvHFLOEGyp2IMZSmLxmNPWrPsYDF4mvl1D+05RmM=; b=FHRDnC7nZxhhDmbOuUlR8ZwgW5TILFG68B0oEDs1K23l/u6IRFNjB0G1/xKfgWBeUKyiBm k06uYThkSppb9bqeaC+PInhd3fFXChzCgBfFcsRjvGmcpPlnsXEI4c3M1gav3S4Cmc60Xy 7I/0wFWmKG6i1X8IXZYC+R0SIpYUBE8= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 38196ACD4; Thu, 18 Feb 2021 10:58:32 +0000 (UTC) Date: Thu, 18 Feb 2021 11:58:31 +0100 From: Petr Mladek To: Chris Down Cc: Johannes Weiner , linux-kernel@vger.kernel.org, Sergey Senozhatsky , John Ogness , Andrew Morton , Steven Rostedt , Greg Kroah-Hartman , Kees Cook , kernel-team@fb.com Subject: Re: code style: Re: [PATCH v4] printk: Userspace format enumeration support Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 2021-02-17 15:56:38, Chris Down wrote: > Petr Mladek writes: > > > > How about config PRINTK_INDEX? > > > > > > Ah yes, I also like that. PRINTK_INDEX is fine from my perspective and is > > > more straightforward than "enumeration", thanks. > > > > It is better than enumeration. But there is still the same > > problem. The word "index" is used neither in the code > > nor in the debugfs interface. It is like enabling cars and > > seeing apples. > > > > What about CONFIG_PRINTK_DEBUGFS? > > > > It seems that various subsystems use CONFIG__DEBUGFS > > pattern when they expose some internals in debugfs. > > The thing I don't like about that is that it describes a largely > inconsequential implementation detail rather than the semantic intent of the > config change, which is what the person deciding what to include in their > config is likely to care about. Often when I see "XXX debug interface" when > doing `make oldconfig` I think to myself "yes, but what does the debugfs > interface _do_?". I see. > If someone else was writing this patch, and I saw "CONFIG_PRINTK_DEBUGFS" > appear in my prod kernel, I'd probably say N, because I don't need printk > debugging information. On the other hand, if I saw "CONFIG_PRINTK_INDEX", I'd > immediately understand that it's probably applicable to me. > > I'm happy to rename the debugfs structure as /printk/fmt_index if it > helps, but personally I really feel CONFIG_PRINTK_{INDEX,ENUMERATION,CATALOGUE} > is a lot more descriptive than just saying "it has a debugfs interface" in the > config name for that reason. PRINTK_INDEX sounds the best to me. Keep in mind that I am not a native speaker. And my concern will be gone when we use it also in the API and debugfs hierarchy as suggested by Johannes. Another compromise might be to have CONFIG_PRINTK_FORMATS_INDEX. Then the prefix printk_format_, pf_ would still match the option. Or we could use printk_format_index_m, pfi_ indexes. Best Regards, Petr PS: I feel that I have enough bike-shading. I think that I will be fine with anything that you choose ;-)