diff options
author | Yogish Kulkarni <yogishk@nvidia.com> | 2013-02-06 16:58:50 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 12:57:47 -0700 |
commit | 662ba888faf62fee0a71afd0227ec87752a6456f (patch) | |
tree | 3a621e12ae951e4eb445446baf15e41a549d85d3 | |
parent | 54641846c0bab832e1262742f94e3c4ddff80e62 (diff) |
input-cfboost: add trace points
Add trace points to log time stamp when the input event is received
and time at which boost work is scheduled. This is for detailed
profiling of touch latency.
Bug 1229219
Change-Id: I5f2f4f3d821d93b550fa9f86dc8fd562fa5d460a
Signed-off-by: Yogish Kulkarni <yogishk@nvidia.com>
Reviewed-on: http://git-master/r/197954
(cherry picked from commit 04f7d704a071ecf4fc1f70841d020c08e58fe563)
Reviewed-on: http://git-master/r/200783
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r-- | drivers/input/input-cfboost.c | 5 | ||||
-rw-r--r-- | include/trace/events/input_cfboost.h | 66 |
2 files changed, 71 insertions, 0 deletions
diff --git a/drivers/input/input-cfboost.c b/drivers/input/input-cfboost.c index ed8d9407f9bc..a6a4a21e9224 100644 --- a/drivers/input/input-cfboost.c +++ b/drivers/input/input-cfboost.c @@ -26,6 +26,9 @@ #include <linux/module.h> #include <linux/pm_qos.h> +#define CREATE_TRACE_POINTS +#include <trace/events/input_cfboost.h> + /* This module listens to input events and sets a temporary frequency * floor upon input event detection. This is based on changes to * cpufreq ondemand governor by: @@ -59,6 +62,7 @@ static struct workqueue_struct *cfb_wq; static void cfb_boost(struct work_struct *w) { + trace_input_cfboost_params("boost_params", boost_freq, boost_time); cancel_delayed_work_sync(&unboost); pm_qos_update_request(&core_req, 1); pm_qos_update_request(&freq_req, boost_freq); @@ -74,6 +78,7 @@ static void cfb_unboost(struct work_struct *w) static void cfb_input_event(struct input_handle *handle, unsigned int type, unsigned int code, int value) { + trace_input_cfboost_event("event", type, code, value); if (!work_pending(&boost)) queue_work(cfb_wq, &boost); } diff --git a/include/trace/events/input_cfboost.h b/include/trace/events/input_cfboost.h new file mode 100644 index 000000000000..40bb39add3b4 --- /dev/null +++ b/include/trace/events/input_cfboost.h @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM input_cfboost + +#if !defined(_TRACE_INPUT_CFBOOST_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_INPUT_CFBOOST_H + +#include <linux/ktime.h> +#include <linux/tracepoint.h> + +TRACE_EVENT(input_cfboost_params, + TP_PROTO(const char *name, unsigned int freq, unsigned long time), + TP_ARGS(name, freq, time), + TP_STRUCT__entry( + __field(const char *, name) + __field(unsigned int, freq) + __field(unsigned long, time) + ), + TP_fast_assign( + __entry->name = name; + __entry->freq = freq; + __entry->time = time; + ), + TP_printk("name=%s freq=%u time=%lu", + __entry->name, __entry->freq, __entry->time) +); + +TRACE_EVENT(input_cfboost_event, + TP_PROTO(const char *name, unsigned int type, + unsigned int code, int value), + TP_ARGS(name, type, code, value), + TP_STRUCT__entry( + __field(const char *, name) + __field(unsigned int, type) + __field(unsigned int, code) + __field(int, value) + ), + TP_fast_assign( + __entry->name = name; + __entry->type = type; + __entry->code = code; + __entry->value = value; + ), + TP_printk("name=%s type=%u code=%u value=%d", + __entry->name, __entry->type, __entry->code, __entry->value) +); + +#endif /* _TRACE_INPUT_CFBOOST_H */ + +/* This part must be outside protection */ +#include <trace/define_trace.h> |