ANDROID: tracing: Add restricted vendor hooks for preemptirq events

We have debug infrastructure built on top of preempt/irq disable/enable
events. This requires modifications to the kernel tracing code. Since
this is not feasible with GKI, we started with registering to the
existing preemptirq trace events. However the performance of wide
variety of use cases are regressed as the rate of preemptirq events
is super high and generic trace events are slow.

Since GKI allows optimized trace events via restricted trace hooks,
add the same for preemptirq event.

Bug: 174541725
Change-Id: Ic8d3cdd1c1aa6a9267d0b755694fedffa2ea8e36
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
This commit is contained in:
Pavankumar Kondeti
2020-12-01 14:10:07 +05:30
committed by Todd Kjos
parent 5a920a6503
commit 2e14f01dc4
3 changed files with 80 additions and 8 deletions

View File

@@ -0,0 +1,43 @@
/* SPDX-License-Identifier: GPL-2.0 */
#undef TRACE_SYSTEM
#define TRACE_SYSTEM preemptirq
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH trace/hooks
#if !defined(_TRACE_HOOK_PREEMPTIRQ_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_PREEMPTIRQ_H
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>
#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS)
DECLARE_RESTRICTED_HOOK(android_rvh_preempt_disable,
TP_PROTO(unsigned long ip, unsigned long parent_ip),
TP_ARGS(ip, parent_ip), 1);
DECLARE_RESTRICTED_HOOK(android_rvh_preempt_enable,
TP_PROTO(unsigned long ip, unsigned long parent_ip),
TP_ARGS(ip, parent_ip), 1);
DECLARE_RESTRICTED_HOOK(android_rvh_irqs_disable,
TP_PROTO(unsigned long ip, unsigned long parent_ip),
TP_ARGS(ip, parent_ip), 1);
DECLARE_RESTRICTED_HOOK(android_rvh_irqs_enable,
TP_PROTO(unsigned long ip, unsigned long parent_ip),
TP_ARGS(ip, parent_ip), 1);
#else
#define trace_android_rvh_preempt_disable(ip, parent_ip)
#define trace_android_rvh_preempt_enable(ip, parent_ip)
#define trace_android_rvh_irqs_disable(ip, parent_ip)
#define trace_android_rvh_irqs_enable(ip, parent_ip)
#endif
#endif /* _TRACE_HOOK_PREEMPTIRQ_H */
/* This part must be outside protection */
#include <trace/define_trace.h>