summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPritesh Raithatha <praithatha@nvidia.com>2014-01-06 19:49:06 +0530
committerBharat Nihalani <bnihalani@nvidia.com>2014-01-14 20:42:14 -0800
commitd506f8ded1cfc181bb9044e40f4e2dfe500f6152 (patch)
treefd5ba071b9c0bc3a817fba2dd5028df0edf8e263
parentc8589916e626815d43736f8ac649023d8bd77a65 (diff)
hid: hid-input: add trace event
Bug 1434677 Change-Id: I019e492769495335041a336aef4de94a746efcee Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com> Reviewed-on: http://git-master/r/352284 Reviewed-by: Sachin Nikam <snikam@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--drivers/hid/hid-input.c6
-rw-r--r--include/trace/events/hid-input.h46
2 files changed, 52 insertions, 0 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 90c718f6eded..bbb546ad985f 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2000-2001 Vojtech Pavlik
* Copyright (c) 2006-2010 Jiri Kosina
+ * Copyright (c) 2014 NVIDIA Corporation. All rights reserved.
*
* HID to Linux Input mapping
*/
@@ -32,6 +33,9 @@
#include <linux/hid.h>
#include <linux/hid-debug.h>
+#define CREATE_TRACE_POINTS
+#include <trace/events/hid-input.h>
+
#include "hid-ids.h"
#define unk KEY_UNKNOWN
@@ -993,6 +997,8 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct
if (!usage->type)
return;
+ trace_hidinput_hid_event("hid_event");
+
if (usage->hat_min < usage->hat_max || usage->hat_dir) {
int hat_dir = usage->hat_dir;
if (!hat_dir)
diff --git a/include/trace/events/hid-input.h b/include/trace/events/hid-input.h
new file mode 100644
index 000000000000..79aaf86b2460
--- /dev/null
+++ b/include/trace/events/hid-input.h
@@ -0,0 +1,46 @@
+/*
+ * include/trace/events/hid-input.h
+ *
+ * Copyright (C) 2014 NVIDIA Corporation. 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 as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that 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, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM hid-input
+
+#if !defined(_TRACE_HID_INPUT_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_HID_INPUT_H
+
+#include <linux/ktime.h>
+#include <linux/tracepoint.h>
+
+TRACE_EVENT(hidinput_hid_event,
+ TP_PROTO(const char *name),
+ TP_ARGS(name),
+ TP_STRUCT__entry(
+ __field(const char *, name)
+ ),
+ TP_fast_assign(
+ __entry->name = name;
+ ),
+ TP_printk("name=%s",
+ __entry->name)
+);
+
+#endif /* if !defined(_TRACE_HID_INPUT_H) || defined(TRACE_HEADER_MULTI_READ) */
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>