lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1316211355-2888-2-git-send-email-vpalatin@chromium.org>
Date:	Fri, 16 Sep 2011 15:15:54 -0700
From:	Vincent Palatin <vpalatin@...omium.org>
To:	"Rafael J. Wysocki" <rjw@...k.pl>,
	Alan Stern <stern@...land.harvard.edu>,
	Linux PCI <linux-pci@...r.kernel.org>
Cc:	Olof Johansson <olofj@...omium.org>,
	Sameer Nanda <snanda@...omium.org>,
	Ming Lei <tom.leiming@...il.com>, linux-kernel@...r.kernel.org,
	Vincent Palatin <vpalatin@...omium.org>,
	Jesse Barnes <jbarnes@...tuousgeek.org>
Subject: [PATCH 1/2] PM / Runtime: add conditional trace macro

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@...omium.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ