Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1817725ybl; Sat, 25 Jan 2020 09:13:47 -0800 (PST) X-Google-Smtp-Source: APXvYqwdZQB1jmduqfmmRq7RoZj+T6lqBAS0JaSCWs9tZiQRHYblhc0IXI9Cou1rByPjK47raP9C X-Received: by 2002:a9d:7590:: with SMTP id s16mr6528402otk.89.1579972427258; Sat, 25 Jan 2020 09:13:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579972427; cv=none; d=google.com; s=arc-20160816; b=PBE/I8z5ga1VRah1L6A+jLN/ZbO6x3m5n7DFLaq4KGqtICzMwSzRU80F+D/VLUKSp/ uDw6xXy6OIBS2zAAHjQkYK85QLQkyVu8090C3ONFT6brZE70Nvd3E/X/GKbbVhF97jaS cKOIjhrX8iiChHroGPqLBIfrl+2RfpFaeFO78RSAWIEYv6BQb7cvx2Y+PCpox14xyfCm I7THa08yOQbd+Nzfg7CWQ1axDg7uM63FtJS/8YNWZGgesytyInB/8OBytUcMxWTd0Tww /KF7P8JD38tLJ80nYRt/zOK5Ktg+YbIAYvDji585MpiJxEwsRcK7jMEoqTqeeQY4k7fT ewtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=61C2upwppuP6Pmg7Sql7Gwg2Cdm7BmZjTAecvkiT5Mo=; b=tR7uOaQvKjUeyONY81vjX3jG0FRuwhj3o3RRJGOjJ4kCL3R8RzAwePfJ3+5II9rHCY 2U8oRlLVQN2vAmxkgvkLWsIV0HE1wy5gXhGadCdqFYyGOhuDhhNvKA9Y8F7qZ1apSYsV vBEu/+jGikY8zC+FE/i/VDH2vC6JYh/D/zxpiXQVyj5sKHyE2nBx0+32vlQE8AGPZvS7 EoQaxkCLnjXDvejMX3pfgbRIsiLmsEGrEIx0/ANB64eIIjS6NeEfILEUp30JjuSQjsQJ W/eh71B3S8qN/Nl2zyQvJf3Cx+ADrMsMX76AbE+YhW/MOQYqw7KhRVPJCl/ZqH9B69pp IStg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r12si4315521otq.156.2020.01.25.09.13.35; Sat, 25 Jan 2020 09:13:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727228AbgAYRLc (ORCPT + 99 others); Sat, 25 Jan 2020 12:11:32 -0500 Received: from ms.lwn.net ([45.79.88.28]:53302 "EHLO ms.lwn.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725843AbgAYRLc (ORCPT ); Sat, 25 Jan 2020 12:11:32 -0500 Received: from lwn.net (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ms.lwn.net (Postfix) with ESMTPSA id CFE552F5; Sat, 25 Jan 2020 17:11:31 +0000 (UTC) Date: Sat, 25 Jan 2020 10:11:30 -0700 From: Jonathan Corbet To: "Theodore Y. Ts'o" Cc: Greg Kroah-Hartman , Jason Baron , Will Deacon , linux-kernel@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH v3] dynamic_debug: allow to work if debugfs is disabled Message-ID: <20200125101130.449a8e4d@lwn.net> In-Reply-To: <20200125014231.GI147870@mit.edu> References: <20200122080352.GA15354@willie-the-truck> <20200122081205.GA2227985@kroah.com> <20200122135352.GA9458@kroah.com> <8d68b75c-05b8-b403-0a10-d17b94a73ba7@akamai.com> <20200122192940.GA88549@kroah.com> <20200122193118.GA88722@kroah.com> <20200123155340.GD147870@mit.edu> <20200123175536.GA1796501@kroah.com> <20200124060200.GG147870@mit.edu> <20200124072940.GA2909311@kroah.com> <20200125014231.GI147870@mit.edu> Organization: LWN.net MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 24 Jan 2020 20:42:31 -0500 "Theodore Y. Ts'o" wrote: > On Fri, Jan 24, 2020 at 08:29:40AM +0100, Greg Kroah-Hartman wrote: > > > It's likely that people who normally use > > > distribution kernels where debugfs is disabled will have scripts which > > > are hard-coded to look in /proc, and then when they build a kernel > > > with debugfs enabled, the /proc entry will go **poof**, and their > > > script will break. > > > > **poof** they didn't test it :) > > > > Seriously, I am doing this change to make it _easier_ for those people > > who want debugfs disabled, yet want this type of debugging. This is > > much better than having no debugging at all. > > > > Don't put extra complexity in the kernel for when it can be trivially > > handled in userspace, you know this :) > > It's also trivial to handle this in the kernel by potentially having > the control file appear in two places. Consider what it would be like > to explain this in the Linux documentation --- "the control file could > be here, or it could be there", depending on how the kernel is > configured. The complexity of documenting this, and the complexity in > userspace; and we have to have the code in the source code for the > file to be in the appear in both places *anyway*. FWIW, avoiding the need to document something like this has been a motivating factor behind a number of my patches over the years. Moving a control knob based on kernel configuration is a user-hostile feature. Scripts can be made to cope with this kind of behavior in one place; if you let such things accumulate in a system, though, it gets to the point where it's really hard for anybody to keep track of all the pieces and be sure that their code will work. If dynamic debug is meant to be a feature supported on all kernels, it should, IMO, be lifted out of debugfs and made into a proper feature - with a compatibility link left behind in debugfs for as long as it's needed, of course. :) jon