Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2223279ybt; Mon, 15 Jun 2020 23:39:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6H/TNtoiBVhs3yQoESXQfPVAh9ztcuGfXnI6J7d/zss7XWbi81wzzlfiFZqMq9LZ1HuzA X-Received: by 2002:a17:906:a402:: with SMTP id l2mr1475953ejz.14.1592289580791; Mon, 15 Jun 2020 23:39:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592289580; cv=none; d=google.com; s=arc-20160816; b=Y0u6Jaq4UI08G/IHNpjwk3+7bfJDkFg2s6WyGBFhZE40yDARsZBEgH71sX8Qg3tzRX 0i3p/LbogmL2qI3QV3mSYDQJwOWu6R7CcyRl3yVtvc0B7B9nr/qmAauXOXHKRVAl69FA Utw76mD/ajEFPqOrEndk3PZ3JEuWUkLxXZ+ItirPXWw/bLEOb8psslywp0+T7/9+er5L TDYmIkbJ/tPFt3UpcPn1OKUROqryf5+n2uryHR4zWOriXuFX7aADgy+dihvhxnfbd36u /R5LywZ1r8WupkUWlMNYQ70AybHfOj4ACJmSHO9ZK7pcvugZtdWTeQ5wTKK3co7GWZ2x zTJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=LWvjlZKrbSY+h2JAZsF++jU6FmxWJB/tXKAKBlpn4CY=; b=uTrkD89diUYYGiKKOSSFMuWZNMRgdUxaZEh6lskmWE8V1cr8n2lmr0+3vOd0f739CV 2FXTUGar1eqMYAF1nRLvzGMVanDVdF0xboVej0JAMhih1gNl4tTq8QHBG5TrrHUyO8SO uW4E9JJkk0S5wfqmrjHMv1o5ZGFUm4Ri9gmLz0CwWXzdMCc3SeIYJkNCZFSEOLAbRQRC xM1ce5f9oTPcN4o6W+6M3l6pxv334mQI4X/7Bq2hT2qWpbFkfkAUenLE8jpXRW0/b+D0 5Dr7aXFsTQYUCxfOGHN9nOdhb5Ghna34XbDpJgDFLFoVDFEN9mVfdUDXFx5F0evQfwLv NHpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="j/vx0MzO"; 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 a63si10342564edf.135.2020.06.15.23.39.17; Mon, 15 Jun 2020 23:39:40 -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=@kernel.org header.s=default header.b="j/vx0MzO"; 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 S1726521AbgFPGhP (ORCPT + 99 others); Tue, 16 Jun 2020 02:37:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:45116 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725775AbgFPGhP (ORCPT ); Tue, 16 Jun 2020 02:37:15 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6972B20734; Tue, 16 Jun 2020 06:37:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592289435; bh=5gCQ8SG/lezC0BcWNszXab3hq0C0HZPZZV+pMYNLOhk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=j/vx0MzOLKBApzZFJMcc+SxxuPTFl12E4sGrLi4DkoZcloKHi3gfUxB6qynFOOGEo o8lbLwBcH/sHynQLX9N4isNurgzlT55UupOeEf504coxPwqq7IO0j/2TfBV4vfg/ba MjWQBHhqn+aMlrBPfsGefDEUdDcvulY480H0vkXk= Date: Tue, 16 Jun 2020 08:37:12 +0200 From: Greg KH To: jim.cromie@gmail.com Cc: Jason Baron , LKML , akpm@linuxfoundation.org, Rasmus Villemoes Subject: Re: [PATCH v2 23/24] kset-example: add pr_debug()s for easy visibility of its operation Message-ID: <20200616063712.GA10274@kroah.com> References: <20200613155738.2249399-1-jim.cromie@gmail.com> <20200613155738.2249399-24-jim.cromie@gmail.com> <20200614060501.GB2608744@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 15, 2020 at 04:18:38PM -0600, jim.cromie@gmail.com wrote: > On Sun, Jun 14, 2020 at 12:05 AM Greg KH wrote: > > > > On Sat, Jun 13, 2020 at 09:57:37AM -0600, Jim Cromie wrote: > > > put pr_debug()s into most functions, to easily see code operate when > > > module is loaded and used. > > > > > > #> dmesg -w & > > > #> modprobe kset-example dyndbg=+pfml > > > #> cat /sys/kernel/kset-example/*/* > > > --- > > > > static int __init example_init(void) > > > { > > > + pr_debug("called"); > > > > Why??? If you want to do something like this, use ftrace, that is what > > it is for. > > > > thanks, > > > > greg k-h > > > mostly I needed an easy place to try out pr_debug_n in the next patch. > if that next patch seems like a good anti-pattern for pr_debug_n use/misuse, > then I could combine the 2, and add a 'dont do this, use ftrace' comment too. > or not, of course. This is not a good place to use it at all, as I do not want to see people copying it. Anything that does "called" is ripe to just be removed entirely. Which again leads me to the "are you sure you want to do any of this?" question as almost always, complex debugging stuff like this is never used once the driver is up and running properly. thanks, greg k-h