diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 7984001f3cee..3a41c51358b8 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -64,6 +64,7 @@ #include #include #include +#include /* * Export tracepoints that act as a bare tracehook (ie: have no trace event @@ -311,6 +312,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_force_compatible_pre); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_force_compatible_post); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_regmap_update); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_dma_buf_release); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_pass_input_event); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmc_check_status); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_alloc_rqs); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_rq_ctx_init); diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index 95f90699d2b1..e4605ff1919c 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -24,6 +24,7 @@ #include #include #include "input-compat.h" +#include struct evdev { int open; @@ -214,6 +215,9 @@ static int evdev_set_clk_type(struct evdev_client *client, unsigned int clkid) static void __pass_event(struct evdev_client *client, const struct input_event *event) { + trace_android_vh_pass_input_event(client->head, client->tail, client->bufsize, + event->type, event->code, event->value); + client->buffer[client->head++] = *event; client->head &= client->bufsize - 1; diff --git a/include/trace/hooks/evdev.h b/include/trace/hooks/evdev.h new file mode 100644 index 000000000000..48ac94aafc9d --- /dev/null +++ b/include/trace/hooks/evdev.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM evdev + +#define TRACE_INCLUDE_PATH trace/hooks + +#if !defined(_TRACE_HOOK_EVDEV_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_HOOK_EVDEV_H + +#include + +DECLARE_HOOK(android_vh_pass_input_event, + TP_PROTO(int head, int tail, int bufsize, int type, int code, int value), + TP_ARGS(head, tail, bufsize, type, code, value)) + +#endif /* _TRACE_HOOK_EVDEV_H */ +/* This part must be outside protection */ +#include +