Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7216244pxb; Thu, 18 Feb 2021 04:47:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwUbHrv/uQhkgtYFkGanSOCtuZTlQymii8E7K3Tq84fOOWiG90LigGujiQwyqf1uO8q84Wa X-Received: by 2002:a05:6402:1750:: with SMTP id v16mr4187612edx.54.1613652439556; Thu, 18 Feb 2021 04:47:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613652439; cv=none; d=google.com; s=arc-20160816; b=qy8A6bR2GLEBRR/Z1+DjVaYO4lHOdGuUN1A7A4F/057ccmARhUbD5mf2d8qJzGCAOL kWQkp8PksaM0XwP+PQJE77KJo2Jek60ZmDC21EBgkZjtkL8Volk27wb4MT/suXiDzlfA NtdYWOQBy+amY6vyTF7yHHxNGGuFmtgdQjJ6mUQmSAHZlOB8oFrbaWkm7+LDQc3qr/Yu s+/ukJGp6tkENip7uTciAiPcEILiTVll8sYSRsfK8iL+rwpuPZlW9ntY53AV71DHozE5 WzkI1aBrJ5yCiw5zmKTRfWnClKa0S6YOOMbWMhVwB9YqE4aWaVM2f8sg1wDNpeMGhlN4 AfIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=yx8UvHFLOEGyp2IMZSmLxmNPWrPsYDF4mvl1D+05RmM=; b=hqrH6wYZcX02jXZeT4ZeauNIFC4KAE4FBzoVWbrz4hl2rsHhMkKKKL2AI9tcUGisP6 VmyRGo5nEVZ/gjrJ5nmNIXN8yB/KERMMdyco/ZcpquyU0+tSymLei+bhOFSbjHpQ/efR xs5UxUhDXdkxMsN/o/2HdTc5IIo339GiDtwoRM0dWH1Xy47Dhlw96ZaZQLz1yM759gFs qV7sfwGw7rpo8nhiQpUkNEc08EX5l+voLhWiPVeyW9SAMhgLI5GFfmGRpAfA8L/mtbBT 37TW7GV+6XYN3q133KTRgtLR2BKNTeFIQHUFMccYBCd41zaV8PP85QyMrTJomzVSCElK bE1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=FHRDnC7n; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j2si3658503ejy.723.2021.02.18.04.46.54; Thu, 18 Feb 2021 04:47:19 -0800 (PST) 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=@suse.com header.s=susede1 header.b=FHRDnC7n; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233127AbhBRMj0 (ORCPT + 99 others); Thu, 18 Feb 2021 07:39:26 -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 ;-)