Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2521650ybl; Thu, 29 Aug 2019 09:16:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLkmCNg2CmzREb7MOTaGxCMAqZXI6Gc/Bs+7+7g/2yEc3KL/Jf2x6/RJAdfcDIv1megVjL X-Received: by 2002:a17:902:744a:: with SMTP id e10mr4469482plt.239.1567095363089; Thu, 29 Aug 2019 09:16:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567095363; cv=none; d=google.com; s=arc-20160816; b=EBxk1/U6DFC77y4Hg6GHp7CoZpZpeUd0jWUjpwI6ndcZeNyZ20LSUE7vy5Ilr3vHzG 6OKxt4cmKnHnpdcgdcC1bTaNGa5owrqhSRi7t98AySOlyaJTGrnSzuDTLcv8qBWx8Fwx oE4xWTyJkDKb51F6qybU9UmmsgwAcxAJ6p4eONJk9tlbtX7ikc6jwxLt5Q7R9GHFraaM mmcwfBGSH+SBdPVPSL7hOSRnqOzPK1ocaaPMvtfe8avHNgVxA3ckQgEZipsS5kClprrE IsENJgVznNgXbKCwcgoc1WLV2w6E1Gi36nSy47+C3O/1sKnKw8DNpMy4c9Ry2qCH2h8W jKcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=HdsbyusGiMRkq6kSVVJ1Tni1iJ0D5Lbbif3gwg/K05I=; b=ONhrsI/ylaQANQil98stSxLOeaxzirAnrtvRzkVQD/G8YT0ocJnzLb6OMg4DFmnkoc TjhY4ii2S7QD8V8EK8VX5Sj3UiO2DazzaoxbMDgltXNpDcr0SGT8PpWCTTr4DUaEeTxT 1GMhUivPFC31hgR3SUiUu8cXJaDwPeorgkDkmhX5oAcWISV58akFB6Q+KOHFhpRmKII1 90PQMUMLv0v9qqYKz41c8DYG10Me/CR5474QYk4GYjkp344VnAyzBA+jO1PxucZY2b6q TNffusN1YX1UEeY+rtz/1FQBL/zDnJ9t8QPE/JS8K6L9RpsBLXqliYyf/AoJcLAqcxQE U+jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rwH2W+E9; 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 o4si2438130pgv.157.2019.08.29.09.15.47; Thu, 29 Aug 2019 09:16:03 -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=rwH2W+E9; 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 S1728167AbfH2QOR (ORCPT + 99 others); Thu, 29 Aug 2019 12:14:17 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:41350 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727810AbfH2QOR (ORCPT ); Thu, 29 Aug 2019 12:14:17 -0400 Received: by mail-qt1-f193.google.com with SMTP id i4so4270568qtj.8 for ; Thu, 29 Aug 2019 09:14:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HdsbyusGiMRkq6kSVVJ1Tni1iJ0D5Lbbif3gwg/K05I=; b=rwH2W+E9cpx2iUbbR7UKUGi/jJ6G+nWXtKfJWQvfIh0dWzORi2lxzSjWDUtlwhjDDt u0Z+A9YIB1GzPOnTHPPY3i7BDquPMoJs4nu+mpurcn+a10tVRAsAMHCb8KLywlqlEUq8 o1HgP+Z2B3/laH1886ucMyl55HHZBKdx+nrNEpFCC40oz37OGfIiRkeWfqE5xeEQ/PH1 /+V3V/fVNEAUTMK0aajSgJffJLVB0iQx2TviNLCuyUoQ5F7+aBqM9iKiKVfGBs9l+z/S zqP5ijZOw6SuO5gbwOZfiO3zywp9PewKIkRlQ7eftXdJTauLMWQpmMdJrLXYEh5ghwmV VIDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HdsbyusGiMRkq6kSVVJ1Tni1iJ0D5Lbbif3gwg/K05I=; b=BUgdt4pHaaVdKs2jbb642KeNGr9AUP9QA8WcnT+gwWm5kei4mrv3/FVfy1RMVJL0CC H4HfptUjuzYBSWvXsxFVOUdLmM8CwJilsPmkB9Kh8vAMjJtDkmVyNaY6FAQPBapbAwH6 Qne29lqy1kGYp9PPIjRxJWHqqDVxn+p+9bosi31dLzSH1362NMr0OnASJB16WlUR7Pw3 tWR/chf5W0kQc8AO1czZf9p7rs2ZW3QKOh7HKmPO/FV+s/KXHK83YwUJnSE95AmF1QuI MGs4H1PN0yhaBtq/SYYXKHGRxwHWZQPck5zqRGiufZdcuGvVh9055tK76kJAEa1rkiKg g7Zg== X-Gm-Message-State: APjAAAXC0MH5a3aPqQYBRpkAUUYcaexKb3VuoXzAF67q4S3J6jfBlehL PhqtnC68vrsq9Z9rqM/+uKZ++OOhJWpfeTatGu5wrA== X-Received: by 2002:ac8:4612:: with SMTP id p18mr10715186qtn.49.1567095255854; Thu, 29 Aug 2019 09:14:15 -0700 (PDT) MIME-Version: 1.0 References: <93fa782bde9c66845993ff883532b3f1f02d99e4.1566907161.git.amit.kucheria@linaro.org> <20190829140459.szauzhennltrwvg4@holly.lan> <20190829151912.z6cflsaox2qnmqxw@holly.lan> In-Reply-To: <20190829151912.z6cflsaox2qnmqxw@holly.lan> From: Amit Kucheria Date: Thu, 29 Aug 2019 21:44:04 +0530 Message-ID: Subject: Re: [PATCH v2 03/15] drivers: thermal: tsens: Add __func__ identifier to debug statements To: Daniel Thompson 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 Content-Type: text/plain; charset="UTF-8" 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 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? :-) > 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? > 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. 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