public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	linux-kernel@vger.kernel.org,
	"Rafael J. Wysocki" <rafael@kernel.org>
Subject: Re: [PATCH v2 1/1] devres: Enable trace events
Date: Tue, 13 Apr 2021 15:00:52 +0300	[thread overview]
Message-ID: <YHWH9KWrh2kkoAvU@kuha.fi.intel.com> (raw)
In-Reply-To: <20210413113801.18245-1-andriy.shevchenko@linux.intel.com>

On Tue, Apr 13, 2021 at 02:38:01PM +0300, Andy Shevchenko wrote:
> In some cases the printf() mechanism is too heavy and can't be used.
> For example, when debugging a race condition involving devres API.
> When CONFIG_DEBUG_DEVRES is enabled I can't reproduce an issue, and
> otherwise it's quite visible with a useful information being collected.
> 
> Enable trace events for devres part of the driver core.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> v2: fixed compilation error (lkp), elaborate commit message (Greg)
>  drivers/base/Makefile |  3 +++
>  drivers/base/devres.c | 23 +++++++++++-------
>  drivers/base/trace.c  | 10 ++++++++
>  drivers/base/trace.h  | 56 +++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 83 insertions(+), 9 deletions(-)
>  create mode 100644 drivers/base/trace.c
>  create mode 100644 drivers/base/trace.h
> 
> diff --git a/drivers/base/Makefile b/drivers/base/Makefile
> index 8b93a7f291ec..ef8e44a7d288 100644
> --- a/drivers/base/Makefile
> +++ b/drivers/base/Makefile
> @@ -30,3 +30,6 @@ obj-y			+= test/
>  
>  ccflags-$(CONFIG_DEBUG_DRIVER) := -DDEBUG
>  
> +# define_trace.h needs to know how to find our header
> +CFLAGS_trace.o		:= -I$(src)
> +obj-$(CONFIG_TRACING)	+= trace.o
> diff --git a/drivers/base/devres.c b/drivers/base/devres.c
> index db1f3137fc81..a0850bd1eab7 100644
> --- a/drivers/base/devres.c
> +++ b/drivers/base/devres.c
> @@ -14,14 +14,13 @@
>  #include <asm/sections.h>
>  
>  #include "base.h"
> +#include "trace.h"
>  
>  struct devres_node {
>  	struct list_head		entry;
>  	dr_release_t			release;
> -#ifdef CONFIG_DEBUG_DEVRES
>  	const char			*name;
>  	size_t				size;
> -#endif

Those ifdefs are still required.

>  };

thanks,

-- 
heikki

  reply	other threads:[~2021-04-13 12:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13 11:38 [PATCH v2 1/1] devres: Enable trace events Andy Shevchenko
2021-04-13 12:00 ` Heikki Krogerus [this message]
2021-04-13 12:25   ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YHWH9KWrh2kkoAvU@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox