The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Vincent Palatin <vpalatin@chromium.org>
To: "Rafael J. Wysocki" <rjw@sisk.pl>,
	Alan Stern <stern@rowland.harvard.edu>,
	Linux PCI <linux-pci@vger.kernel.org>
Cc: Olof Johansson <olofj@chromium.org>,
	Sameer Nanda <snanda@chromium.org>,
	Ming Lei <tom.leiming@gmail.com>,
	linux-kernel@vger.kernel.org,
	Vincent Palatin <vpalatin@chromium.org>,
	Jesse Barnes <jbarnes@virtuousgeek.org>
Subject: [PATCH 1/2] PM / Runtime: add conditional trace macro
Date: Fri, 16 Sep 2011 15:15:54 -0700	[thread overview]
Message-ID: <1316211355-2888-2-git-send-email-vpalatin@chromium.org> (raw)
In-Reply-To: <1316211355-2888-1-git-send-email-vpalatin@chromium.org>

Add a new "dev_printk_norpm" macro which prints the trace only when the
device has not the runtime PM activated.
Some traces (e.g. PCI configuration) are useful in default mode but when
the runtime PM is activated, they become very noisy if the device is
often enabled/disabled.

If needed, CONFIG_PM_VERBOSE will re-activate all the original traces.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
---
 include/linux/pm_runtime.h |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index daac05d..57da18c 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -22,6 +22,18 @@
 					    usage_count */
 #define RPM_AUTO		0x08	/* Use autosuspend_delay */
 
+/* print trace only if the runtime PM is not activated on the device */
+#ifdef CONFIG_PM_VERBOSE
+#define dev_printk_norpm(level, dev, format, ...)      \
+	dev_printk(level, dev, format, ##__VA_ARGS__);
+#else
+#define dev_printk_norpm(level, dev, format, ...)              \
+({                                                             \
+	if (!pm_runtime_enabled(dev))                          \
+		dev_printk(level, dev, format, ##__VA_ARGS__); \
+})
+#endif
+
 #ifdef CONFIG_PM_RUNTIME
 
 extern struct workqueue_struct *pm_wq;
-- 
1.7.3.1


  reply	other threads:[~2011-09-16 22:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-16 22:15 [RFC] PM / Runtime: decrease verbosity in kernel log Vincent Palatin
2011-09-16 22:15 ` Vincent Palatin [this message]
2011-09-16 22:15 ` [PATCH 2/2] PM / Runtime: make PCI traces quieter Vincent Palatin
2011-09-17 13:23 ` [RFC] PM / Runtime: decrease verbosity in kernel log Alan Stern
2011-09-19 16:20   ` Vincent Palatin
2011-09-19 21:08     ` Rafael J. Wysocki
2011-09-21 17:24       ` Vincent Palatin
2011-09-21 18:05         ` [PATCH] PM / Runtime: make PCI traces quieter Vincent Palatin
2011-09-21 18:29           ` Rafael J. Wysocki
2011-11-28 19:15             ` Vincent Palatin
2011-12-05 19:19               ` Jesse Barnes
2011-12-05 19:51                 ` Vincent Palatin
2011-12-05 19:59                   ` Jesse Barnes
2011-09-21 18:22         ` [RFC] PM / Runtime: decrease verbosity in kernel log Yinghai Lu
2011-09-21 18:28           ` Rafael J. Wysocki

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=1316211355-2888-2-git-send-email-vpalatin@chromium.org \
    --to=vpalatin@chromium.org \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=olofj@chromium.org \
    --cc=rjw@sisk.pl \
    --cc=snanda@chromium.org \
    --cc=stern@rowland.harvard.edu \
    --cc=tom.leiming@gmail.com \
    /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