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

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

Signed-off-by: Sahara <keun-o.p...@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

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

Reply via email to