ANDROID: loop: Add vendor hook to update cmd
According to the value of OEM-specific field of struct bio, we need to update the value of "iocb->ki_flags" or "iocb->ki_ioprio", so that we can distinguish different IO's in lower level drivers and take different measures. Bug: 265611433 Change-Id: Id8ea3c3d064967b7a79fe24c48bf58d92c5d6e41 Signed-off-by: lijiaming <lijiaming3@xiaomi.com>
This commit is contained in:
@@ -108,6 +108,7 @@
|
||||
#include <trace/hooks/bl_hib.h>
|
||||
#include <trace/hooks/dm.h>
|
||||
#include <trace/hooks/direct_io.h>
|
||||
#include <trace/hooks/loop.h>
|
||||
/*
|
||||
* Export tracepoints that act as a bare tracehook (ie: have no trace event
|
||||
* associated with them) to allow external modules to probe them.
|
||||
@@ -415,6 +416,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_post_image_save);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_dm_update_clone_bio);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_ctl_dirty_rate);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_direct_io_update_bio);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_loop_prepare_cmd);
|
||||
/*
|
||||
* For type visibility
|
||||
*/
|
||||
|
||||
@@ -84,6 +84,7 @@
|
||||
#include "loop.h"
|
||||
|
||||
#include <linux/uaccess.h>
|
||||
#include <trace/hooks/loop.h>
|
||||
|
||||
#define LOOP_IDLE_WORKER_TIMEOUT (60 * HZ)
|
||||
|
||||
@@ -607,6 +608,8 @@ static int lo_rw_aio(struct loop_device *lo, struct loop_cmd *cmd,
|
||||
cmd->iocb.ki_flags = IOCB_DIRECT;
|
||||
cmd->iocb.ki_ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, 0);
|
||||
|
||||
trace_android_vh_loop_prepare_cmd(bio, &cmd->iocb);
|
||||
|
||||
if (rw == WRITE)
|
||||
ret = call_write_iter(file, &cmd->iocb, &iter);
|
||||
else
|
||||
|
||||
21
include/trace/hooks/loop.h
Normal file
21
include/trace/hooks/loop.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM loop
|
||||
#undef TRACE_INCLUDE_PATH
|
||||
#define TRACE_INCLUDE_PATH trace/hooks
|
||||
|
||||
#if !defined(_TRACE_HOOK_LOOP__H) || defined(TRACE_HEADER_MULTI_READ)
|
||||
#define _TRACE_HOOK_LOOP_H
|
||||
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
|
||||
struct bio;
|
||||
struct kiocb;
|
||||
DECLARE_HOOK(android_vh_loop_prepare_cmd,
|
||||
TP_PROTO(struct bio *bio, struct kiocb *iocb),
|
||||
TP_ARGS(bio, iocb));
|
||||
|
||||
#endif /* _TRACE_HOOK_LOOP_H */
|
||||
|
||||
/* This part must be outside protection */
|
||||
#include <trace/define_trace.h>
|
||||
Reference in New Issue
Block a user