Files
ack-tegra/include/trace/hooks/syscall_check.h
litao 4713550a59 ANDROID: vendor_hooks: add vendor hook for nanosleep syscall
Through this vendor hook, we can get the timing to check
current running task for the validation of its credential
and nanosleep operations. through this we can filter some
app tasks which may fire the nanosleep events storm.

Bug: 396244637
Bug: 341618050
Change-Id: I644ac3d217930aa0a50966996e8001e27ce8a501
Signed-off-by: litao <tao.li@vivo.corp-partner.google.com>
(cherry picked from commit 1d9ed15534d4988da3ac56dd7892d37bf5f96847)
2025-02-25 17:23:27 -08:00

37 lines
1.1 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
#undef TRACE_SYSTEM
#define TRACE_SYSTEM syscall_check
#define TRACE_INCLUDE_PATH trace/hooks
#if !defined(_TRACE_HOOK_SYSCALL_CHECK_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_SYSCALL_CHECK_H
#include <trace/hooks/vendor_hooks.h>
/*
* Following tracepoints are not exported in tracefs and provide a
* mechanism for vendor modules to hook and extend functionality
*/
struct file;
union bpf_attr;
struct timespec64;
DECLARE_HOOK(android_vh_check_mmap_file,
TP_PROTO(const struct file *file, unsigned long prot,
unsigned long flag, unsigned long ret),
TP_ARGS(file, prot, flag, ret));
DECLARE_HOOK(android_vh_check_file_open,
TP_PROTO(const struct file *file),
TP_ARGS(file));
DECLARE_HOOK(android_vh_check_bpf_syscall,
TP_PROTO(int cmd, const union bpf_attr *attr, unsigned int size),
TP_ARGS(cmd, attr, size));
DECLARE_HOOK(android_vh_check_nanosleep_syscall,
TP_PROTO(struct timespec64 *tu),
TP_ARGS(tu));
#endif /* _TRACE_HOOK_SYSCALL_CHECK_H */
/* This part must be outside protection */
#include <trace/define_trace.h>