Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2548209ybl; Thu, 29 Aug 2019 09:36:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwtm/vyMohrMlyoH6/x2tojkubpDuNUiXlsYWvA+W1V2ZjMIoaT1h5HWU1+KUtgRXfV4IQw X-Received: by 2002:a63:f941:: with SMTP id q1mr9206870pgk.350.1567096585777; Thu, 29 Aug 2019 09:36:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567096585; cv=none; d=google.com; s=arc-20160816; b=Y37f64OkeixpzUBTfgfy/vfDKs6pZ317SUgpYptAwo6QUMSBjj5WGADH8ePrkY1Lnj Ey+nRyqNtpzmB4Inj/TB2HYjnDKYuHFonzugA8AubOBh2nAT1hfJN65rYHA8J4GPLP7z fRqWFm9zEDrbNLt4MAC/voUF4WaYMg0hc7LLysGtLZ/vg3esHFlBnvQaM3QAqTrm+mi9 dCtZRL9EEzC14toIMxP67K4zMI1AnnyZzKGxly/oju7WtI+3o5KL0PvWsXnz+BzdFqMW Men7qpj4wIy8zozYBpQML9h9AsIe3IMvys2Zbs3kozMEUOoUA4T4XX/CblnDNs3MDGcA UrwQ== 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:dkim-signature; bh=qpanO385XMKPNBmgQ90ht9XRbAH606WeW99mEjSVvVY=; b=Z8sKFY9h8rw+i80ZDfXg6CFo8lS4cf0iHTM4RcdZqDHlO+SqQK2Qn1V/Pv/wwHz1De abDLRazhZZ/rotcUCy3LA0RxNIRLT3qEOHwdIX96ATgMCOrYIVzqplgntYNKMmPf4BjH pQ4k5zjkI+LmOe797JOqSLghgXzqZwGALgPKZPmJnImJLdu1Ct2S8sg1tXdDil50Kkd8 EnKvc72QmJuSHXC2C6DIpBjTN0ZHmltGA2FBm1ldoW/5KAeJ7Ejr6xnbrB0XTzZGmF90 JEmih60jEnOWb3t0aZ60/fNY2w5ElvNzwLCjyUuDlL5T+wFbbVwjK3fdN1cfN/DnCDsr IQsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c29yf1bh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u19si2528719pgf.531.2019.08.29.09.36.09; Thu, 29 Aug 2019 09:36:25 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=c29yf1bh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727999AbfH2Qe3 (ORCPT + 99 others); Thu, 29 Aug 2019 12:34:29 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:37051 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727602AbfH2Qe2 (ORCPT ); Thu, 29 Aug 2019 12:34:28 -0400 Received: by mail-wr1-f68.google.com with SMTP id z11so4116996wrt.4 for ; Thu, 29 Aug 2019 09:34:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=qpanO385XMKPNBmgQ90ht9XRbAH606WeW99mEjSVvVY=; b=c29yf1bhYfl0RZdawBGl7I49nhSZZSRY0hl6QJQAiqJCXrKcg/uIgy/7083pZzg7rX grHC1gMYlrAA5wl+k15WnI224Pa1HjnEa46Fp7iJ93m3vx7rrqIQHC4wwG1cmYPYbqkm OVQEf6ZxDcF0fiaSwFtWhLJLHPC68JOR3u9UPG48iyoC1tIorjP74WeiYz0itqFjgX2M X3NW6urBo6wr0f2aW52MLhPI3trmAJ/UNEzhRTLZicILXxXuL2KIDXZFv64Zt1QfJsAx 20dNPxrJzoxmGJl2MM5j1WWFKR0a12ndp1CRrWJUnOu2NL4PLNlIA2Ak+tpDByGkxqnv f6cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=qpanO385XMKPNBmgQ90ht9XRbAH606WeW99mEjSVvVY=; b=EH87CoPTAG+vDf7X/TSYCOEt/QfXMD66UUJCl0PsJph2TSYS7NsEIKQNq7LASFyA5g hhzyyS6tT7Fwt8pzz/ep1VPmWBo2MgRYFNlkCyeYBCQi8QhFsKzQOTvgPHsVEuB8uPF2 fRDisMAHQqPW3Udli5NDv7gUHWt7XzbT44rLYmObM/JYAnY9JobAQjCfCq7bn6rDEMZ0 TPu3GkN/0tnMaafJzu8y2v1msud1WZcKlRxmAke5BOq9XC4AAPl5yVtXbH7NN6ZNB/Hm keiYBuF9VX+PenAvPK188SGubHV/RDXl9GMOSVwUsrf8jPAl+0pWR63cNapD9zl2H4DK 6fcw== X-Gm-Message-State: APjAAAXWcDScM8haaRwMEkLj+c2mMUjILNkiZLotc+XTKVgQ6C/o4+5Y iwd0eP1S+fBDoQiW7C9K0L8GKQ== X-Received: by 2002:a5d:4108:: with SMTP id l8mr12623917wrp.113.1567096465889; Thu, 29 Aug 2019 09:34:25 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id o9sm1994254wrm.88.2019.08.29.09.34.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2019 09:34:25 -0700 (PDT) Date: Thu, 29 Aug 2019 17:34:23 +0100 From: Daniel Thompson To: Amit Kucheria Cc: LKML , linux-arm-msm , Bjorn Andersson , Eduardo Valentin , Andy Gross , Stephen Boyd , Brian Masney , Marc Gonzalez , Daniel Lezcano , Mark Rutland , Rob Herring , Zhang Rui , Linux PM list Subject: Re: [PATCH v2 03/15] drivers: thermal: tsens: Add __func__ identifier to debug statements Message-ID: <20190829163423.2ibdsx6etsl6v5ua@holly.lan> References: <93fa782bde9c66845993ff883532b3f1f02d99e4.1566907161.git.amit.kucheria@linaro.org> <20190829140459.szauzhennltrwvg4@holly.lan> <20190829151912.z6cflsaox2qnmqxw@holly.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 29, 2019 at 09:44:04PM +0530, Amit Kucheria wrote: > On Thu, Aug 29, 2019 at 8:49 PM Daniel Thompson > wrote: > > > > On Thu, Aug 29, 2019 at 07:58:45PM +0530, Amit Kucheria wrote: > > > On Thu, Aug 29, 2019 at 7:35 PM Daniel Thompson > > > wrote: > > > > > > > > On Tue, Aug 27, 2019 at 05:43:59PM +0530, Amit Kucheria wrote: > > > > > Printing the function name when enabling debugging makes logs easier to > > > > > read. > > > > > > > > > > Signed-off-by: Amit Kucheria > > > > > Reviewed-by: Stephen Boyd > > > > > Reviewed-by: Daniel Lezcano > > > > > > > > This should need to be manually added at each call site; it is already > > > > built into the logging system (the f flag for dynamic debug)? > > > > > > I assume you meant "shouldn't". > > > > Quite so. Sorry about that. > > > > > I haven't yet integrated dynamic debug into my daily workflow. > > > > > > Last time I looked at it, it was a bit bothersome to use because I > > > needed to lookup exact line numbers to trigger useful information. And > > > those line numbers constantly keep changing as I work on the driver, > > > so it was a bit painful to script. Not to mention the syntax to frob > > > the correct files in debugfs to enable this functionality. > > > > > > As opposed to this, adding the following to the makefile is so easy. :-) > > > > > > CFLAGS_tsens-common.o := -DDEBUG > > > > > > Perhaps I am using it all wrong? How would I go about using dynamic > > > debug instead of this patch? > > > > Throwing dyndbg="file .c +pf" onto the kernel command line is a > > good start (+p enables debug level prints, +f causes messages to include > > the function name). > > That's useful to know. > > $ git grep __func__ | wc -l > 30914 > > Want to send some patches? :-) I know. Sad isn't it? To be fair plenty of patches already circulate tidying up this sort of thing (along with the removal of inane messages such as informing us that a function run). > > When the C files map to module names (whether the modules are actually > > built-in or not) then .dyndbg=+pf is a bit cleaner and allows > > you to debug the whole of a driver without how it is decomposed into > > files. > > And if changing the kernel cmdline options isn't possible or is inconvenient? Architectures where this problem offer CONFIG_CMDLINE_FORCE meaning if you are already building a custom kernel you can override whatever cmdline the bootloader gives you. > > There are (many) other controls to play with[1] but the above should be > > sufficient to simulate -DDEBUG . > > The "hard" bit is explicitly poking the line number in a file to > activate a paricular pr_dbg statement. Even if I scripted it, those > lines numbers keep changing in an actively developed driver. Line numbers? Nothing I suggested contained a line number. Daniel. > > Somehow, I've always felt dyndbg was more useful to debug a production > system where recompiling the kernel wasn't an option e.g. reporting an > issue back to a distro-kernel vendor. > > > Daniel. > > > > [1] > > https://www.kernel.org/doc/html/latest/admin-guide/dynamic-debug-howto.html