From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CDAA9C3A59F for ; Thu, 29 Aug 2019 16:14:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A145B21874 for ; Thu, 29 Aug 2019 16:14:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="rwH2W+E9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727780AbfH2QOR (ORCPT ); Thu, 29 Aug 2019 12:14:17 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:46629 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727682AbfH2QOQ (ORCPT ); Thu, 29 Aug 2019 12:14:16 -0400 Received: by mail-qt1-f196.google.com with SMTP id j15so4224190qtl.13 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=XXWgi5naJ+WO8r8uWyAYktgFXdsyASCChzMcR9A1eWZlhIz4HG5c9FI08lbDoK4jI5 NbRb5dKn9GR3kUpdSa9ts6dz7uxh1ykEd3O/j8rD18NU877yoxkLSj2iLKw6U7dvHkUZ ubDUQBx9hN2iOZ9rnBJfyjYgyzIsnKr0gQUC4fRYqoREtWtm0xnN0J1vE5IdP9/I2MiR E7X1pG0JmhnYw7mbUDo3jo442i8g5MqMzrTm2ix7P2aSFW72qHoqw6VHNVJyzTW+4xgz KIlMtgHcAv6p7eLbNcJrbiWIUNd3g62myixt5nfazfIUbMwlyhMnEpdxdDS3k2xU6AXa ywgA== X-Gm-Message-State: APjAAAXITHLFsmLaXS399pzPmvbm4CUTnkVJlBs2MOzXnNL1vaSy4mHj anmATDMSxpIjMBvhTqcwxFzWaREjILqKzSsC/0t65w== X-Google-Smtp-Source: APXvYqzj6FfEUctPCaUrep4Pr2nFnlVE+D9Q0UCJJ9LCNcByKgj2f+9/1JxEaBfdMrP14mUMcPjz6vkLNAQTrT9ghSI= 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-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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