ANDROID: vendor_hooks: add vendor hooks for fuse request

Add hooks to fuse queue request and request end so we can do boost
to those background tasks which block the UX related task.

Bug: 333220630
Change-Id: I9be59ed88675c5102c57ba9cbd26cf4df3d2fd7f
Signed-off-by: liliangliang <liliangliang@vivo.com>
(cherry picked from commit e520c2932df0d1bbf83ae45c82ac01fd41655d77)
This commit is contained in:
liliangliang
2024-04-07 15:19:02 +08:00
committed by Treehugger Robot
parent f9840ee562
commit 40f3c9d658
3 changed files with 31 additions and 0 deletions

View File

@@ -73,6 +73,7 @@
#include <trace/hooks/delayacct.h>
#include <trace/hooks/usb.h>
#include <trace/hooks/sound.h>
#include <trace/hooks/fuse.h>
/*
* Export tracepoints that act as a bare tracehook (ie: have no trace event
@@ -417,3 +418,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_hibernate_save_cmp_len);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_read_lazy_flag);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_tsk_need_resched_lazy);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_read_fault);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_queue_request_and_unlock);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_fuse_request_end);

View File

@@ -23,6 +23,8 @@
#include <linux/splice.h>
#include <linux/sched.h>
#include <trace/hooks/fuse.h>
MODULE_ALIAS_MISCDEV(FUSE_MINOR);
MODULE_ALIAS("devname:fuse");
@@ -234,6 +236,7 @@ __releases(fiq->lock)
fuse_len_args(req->args->in_numargs,
(struct fuse_arg *) req->args->in_args);
list_add_tail(&req->list, &fiq->pending);
trace_android_vh_queue_request_and_unlock(&fiq->waitq, sync);
fiq->ops->wake_pending_and_unlock(fiq, sync);
}
@@ -331,6 +334,7 @@ void fuse_request_end(struct fuse_req *req)
} else {
/* Wake up waiter sleeping in request_wait_answer() */
wake_up(&req->waitq);
trace_android_vh_fuse_request_end(current);
}
if (test_bit(FR_ASYNC, &req->flags))

View File

@@ -0,0 +1,24 @@
/* SPDX-License-Identifier: GPL-2.0 */
#undef TRACE_SYSTEM
#define TRACE_SYSTEM fuse
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH trace/hooks
#if !defined(_TRACE_HOOK_FUSE_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_FUSE_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 wait_queue_head;
DECLARE_HOOK(android_vh_queue_request_and_unlock,
TP_PROTO(struct wait_queue_head *wq_head, bool sync),
TP_ARGS(wq_head, sync));
DECLARE_HOOK(android_vh_fuse_request_end,
TP_PROTO(struct task_struct *self),
TP_ARGS(self));
#endif /* _TRACE_HOOK_FUSE_H */
/* This part must be outside protection */
#include <trace/define_trace.h>