diff options
| author | Gilad Broner <gbroner@codeaurora.org> | 2015-03-12 11:56:45 +0200 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-22 10:59:48 -0700 |
| commit | d44985ce8486497c5e03602269872a29c4a9a091 (patch) | |
| tree | 69763c71e400994a2bd73ea7af6a4b78b4068d8b /include/trace | |
| parent | 33e8deb4418fd60ed58e95bad31dfd57f9c9287e (diff) | |
tracing: ufs: create a trace event class template for common events
The following three trace events:
ufshcd_clk_gating, ufshcd_hibern8_on_idle and ufshcd_auto_bkops_state
share the same arguments and meaning - logging some state change
in the UFS driver.
Defining those as template instances takes up less memory compared
to be defined as separate trace events.
Change-Id: I92c2bf3eada6f876b8c9e8a7bfc4568c7886548f
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
Diffstat (limited to 'include/trace')
| -rw-r--r-- | include/trace/events/ufs.h | 53 |
1 files changed, 11 insertions, 42 deletions
diff --git a/include/trace/events/ufs.h b/include/trace/events/ufs.h index 5dea878179f6..1d5729f81f81 100644 --- a/include/trace/events/ufs.h +++ b/include/trace/events/ufs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -19,8 +19,7 @@ #include <linux/tracepoint.h> -TRACE_EVENT(ufshcd_clk_gating, - +DECLARE_EVENT_CLASS(ufshcd_state_change_template, TP_PROTO(const char *dev_name, const char *state), TP_ARGS(dev_name, state), @@ -35,29 +34,19 @@ TRACE_EVENT(ufshcd_clk_gating, __assign_str(state, state); ), - TP_printk("%s: gating state changed to %s", + TP_printk("%s: state changed to %s", __get_str(dev_name), __get_str(state)) ); -TRACE_EVENT(ufshcd_hibern8_on_idle, - +DEFINE_EVENT(ufshcd_state_change_template, ufshcd_clk_gating, TP_PROTO(const char *dev_name, const char *state), - - TP_ARGS(dev_name, state), - - TP_STRUCT__entry( - __string(dev_name, dev_name) - __string(state, state) - ), - - TP_fast_assign( - __assign_str(dev_name, dev_name); - __assign_str(state, state); - ), - - TP_printk("%s: state changed to %s", - __get_str(dev_name), __get_str(state)) -); + TP_ARGS(dev_name, state)); +DEFINE_EVENT(ufshcd_state_change_template, ufshcd_hibern8_on_idle, + TP_PROTO(const char *dev_name, const char *state), + TP_ARGS(dev_name, state)); +DEFINE_EVENT(ufshcd_state_change_template, ufshcd_auto_bkops_state, + TP_PROTO(const char *dev_name, const char *state), + TP_ARGS(dev_name, state)); TRACE_EVENT(ufshcd_clk_scaling, @@ -87,26 +76,6 @@ TRACE_EVENT(ufshcd_clk_scaling, __entry->prev_state, __entry->curr_state) ); -TRACE_EVENT(ufshcd_auto_bkops_state, - - TP_PROTO(const char *dev_name, const char *state), - - TP_ARGS(dev_name, state), - - TP_STRUCT__entry( - __string(dev_name, dev_name) - __string(state, state) - ), - - TP_fast_assign( - __assign_str(dev_name, dev_name); - __assign_str(state, state); - ), - - TP_printk("%s: auto bkops - %s", - __get_str(dev_name), __get_str(state)) -); - DECLARE_EVENT_CLASS(ufshcd_profiling_template, TP_PROTO(const char *dev_name, const char *profile_info, s64 time_us, int err), |
