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: 411279935 Change-Id: I349520b7e95a112d011af1c8b1b4c322ee61a7f5 Signed-off-by: liliangliang <liliangliang@vivo.com>
This commit is contained in:
@@ -70,6 +70,7 @@
|
||||
#include <trace/events/android_vendor_lmk.h>
|
||||
#include <trace/hooks/blk.h>
|
||||
#include <trace/hooks/fsnotify.h>
|
||||
#include <trace/hooks/fuse.h>
|
||||
|
||||
/*
|
||||
* Export tracepoints that act as a bare tracehook (ie: have no trace event
|
||||
@@ -365,6 +366,8 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_flush_wq_wait_start);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_flush_wq_wait_finish);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_flush_work_wait_start);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_flush_work_wait_finish);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_fuse_request_send);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_fuse_request_end);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tcp_sock_error);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tcp_fastsyn);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tcp_state_change);
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <linux/swap.h>
|
||||
#include <linux/splice.h>
|
||||
#include <linux/sched.h>
|
||||
#include <trace/hooks/fuse.h>
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include "fuse_trace.h"
|
||||
@@ -402,6 +403,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))
|
||||
@@ -476,6 +478,7 @@ static void __fuse_request_send(struct fuse_req *req)
|
||||
|
||||
BUG_ON(test_bit(FR_BACKGROUND, &req->flags));
|
||||
|
||||
trace_android_vh_fuse_request_send(&fiq->waitq);
|
||||
/* acquire extra reference, since request is still needed after
|
||||
fuse_request_end() */
|
||||
__fuse_get_request(req);
|
||||
|
||||
@@ -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_fuse_request_send,
|
||||
TP_PROTO(struct wait_queue_head *wq_head),
|
||||
TP_ARGS(wq_head));
|
||||
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>
|
||||
Reference in New Issue
Block a user