mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] PM / QoS: use __print_symbolic with more convenient way
@ 2013-08-06  4:51 kpark3469
  2013-08-06  4:51 ` [PATCH 2/2] xen/trace: replace old code with __print_symbolic kpark3469
  0 siblings, 1 reply; 2+ messages in thread
From: kpark3469 @ 2013-08-06  4:51 UTC (permalink / raw)
  To: rostedt; +Cc: keun-o.park, linux-kernel

From: Sahara <keun-o.park@windriver.com>

This patch is to prevent the same __print_symbolic functions from
being used repeatedly.

Signed-off-by: Sahara <keun-o.park@windriver.com>
---
 include/trace/events/power.h |   43 +++++++++++++++++++++--------------------
 1 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/include/trace/events/power.h b/include/trace/events/power.h
index 8e42410..34efacc 100644
--- a/include/trace/events/power.h
+++ b/include/trace/events/power.h
@@ -182,6 +182,23 @@ DEFINE_EVENT(power_domain, power_domain_target,
 /*
  * The pm qos events are used for pm qos update
  */
+#define show_pm_qos_class(val)						\
+	__print_symbolic(val,						\
+		{ PM_QOS_CPU_DMA_LATENCY,	"CPU_DMA_LATENCY" },	\
+		{ PM_QOS_NETWORK_LATENCY,	"NETWORK_LATENCY" },	\
+		{ PM_QOS_NETWORK_THROUGHPUT,	"NETWORK_THROUGHPUT" })
+
+#define show_pm_qos_req_action(val)					\
+	__print_symbolic(val,						\
+		{ PM_QOS_ADD_REQ,	"ADD_REQ" },			\
+		{ PM_QOS_UPDATE_REQ,	"UPDATE_REQ" },			\
+		{ PM_QOS_REMOVE_REQ,	"REMOVE_REQ" })
+
+#define show_dev_pm_qos_req_type(val)					\
+	__print_symbolic(val,						\
+		{ DEV_PM_QOS_LATENCY,	"DEV_PM_QOS_LATENCY" },		\
+		{ DEV_PM_QOS_FLAGS,	"DEV_PM_QOS_FLAGS" })
+
 DECLARE_EVENT_CLASS(pm_qos_request,
 
 	TP_PROTO(int pm_qos_class, s32 value),
@@ -199,11 +216,7 @@ DECLARE_EVENT_CLASS(pm_qos_request,
 	),
 
 	TP_printk("pm_qos_class=%s value=%d",
-		  __print_symbolic(__entry->pm_qos_class,
-			{ PM_QOS_CPU_DMA_LATENCY,	"CPU_DMA_LATENCY" },
-			{ PM_QOS_NETWORK_LATENCY,	"NETWORK_LATENCY" },
-			{ PM_QOS_NETWORK_THROUGHPUT,	"NETWORK_THROUGHPUT" }),
-		  __entry->value)
+		  show_pm_qos_class(__entry->pm_qos_class), __entry->value)
 );
 
 DEFINE_EVENT(pm_qos_request, pm_qos_add_request,
@@ -246,10 +259,7 @@ TRACE_EVENT(pm_qos_update_request_timeout,
 	),
 
 	TP_printk("pm_qos_class=%s value=%d, timeout_us=%ld",
-		  __print_symbolic(__entry->pm_qos_class,
-			{ PM_QOS_CPU_DMA_LATENCY,	"CPU_DMA_LATENCY" },
-			{ PM_QOS_NETWORK_LATENCY,	"NETWORK_LATENCY" },
-			{ PM_QOS_NETWORK_THROUGHPUT,	"NETWORK_THROUGHPUT" }),
+		  show_pm_qos_class(__entry->pm_qos_class),
 		  __entry->value, __entry->timeout_us)
 );
 
@@ -272,10 +282,7 @@ DECLARE_EVENT_CLASS(pm_qos_update,
 	),
 
 	TP_printk("action=%s prev_value=%d curr_value=%d",
-		  __print_symbolic(__entry->action,
-			{ PM_QOS_ADD_REQ,	"ADD_REQ" },
-			{ PM_QOS_UPDATE_REQ,	"UPDATE_REQ" },
-			{ PM_QOS_REMOVE_REQ,	"REMOVE_REQ" }),
+		  show_pm_qos_req_action(__entry->action),
 		  __entry->prev_value, __entry->curr_value)
 );
 
@@ -293,10 +300,7 @@ DEFINE_EVENT_PRINT(pm_qos_update, pm_qos_update_flags,
 	TP_ARGS(action, prev_value, curr_value),
 
 	TP_printk("action=%s prev_value=0x%x curr_value=0x%x",
-		  __print_symbolic(__entry->action,
-			{ PM_QOS_ADD_REQ,	"ADD_REQ" },
-			{ PM_QOS_UPDATE_REQ,	"UPDATE_REQ" },
-			{ PM_QOS_REMOVE_REQ,	"REMOVE_REQ" }),
+		  show_pm_qos_req_action(__entry->action),
 		  __entry->prev_value, __entry->curr_value)
 );
 
@@ -321,10 +325,7 @@ DECLARE_EVENT_CLASS(dev_pm_qos_request,
 
 	TP_printk("device=%s type=%s new_value=%d",
 		  __get_str(name),
-		  __print_symbolic(__entry->type,
-			{ DEV_PM_QOS_LATENCY,	"DEV_PM_QOS_LATENCY" },
-			{ DEV_PM_QOS_FLAGS,	"DEV_PM_QOS_FLAGS" }),
-		  __entry->new_value)
+		  show_dev_pm_qos_req_type(__entry->type), __entry->new_value)
 );
 
 DEFINE_EVENT(dev_pm_qos_request, dev_pm_qos_add_request,
-- 
1.7.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-08-06  4:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-06  4:51 [PATCH 1/2] PM / QoS: use __print_symbolic with more convenient way kpark3469
2013-08-06  4:51 ` [PATCH 2/2] xen/trace: replace old code with __print_symbolic kpark3469

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®