Files
android_kernel_xiaomi_sm8450/include/trace/hooks/preemptirq.h
Pavankumar Kondeti 2e14f01dc4 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>
2020-12-03 17:44:38 +00:00

44 lines
1.3 KiB
C

/* 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>