ANDROID: add hooks into bio.c for customized I/O scheduler

android_vh_bio_free: We have added some additional information to
each bio, which needs to be freed simultaneously when the bio is free

Bug: 319582497

Change-Id: I532f98fa0569f2eb8da66cff746349c828e0912c
Signed-off-by: hao lv <hao.lv5@transsion.com>
This commit is contained in:
hao lv 2024-01-10 14:59:29 +08:00
parent b2e58fe5d7
commit 34338029ab
3 changed files with 8 additions and 0 deletions

View File

@ -21,6 +21,7 @@
#include <linux/blk-crypto.h>
#include <trace/events/block.h>
#include <trace/hooks/block.h>
#include "blk.h"
#include "blk-rq-qos.h"
@ -252,6 +253,7 @@ static void bio_free(struct bio *bio)
struct bio_set *bs = bio->bi_pool;
void *p;
trace_android_vh_bio_free(bio);
bio_uninit(bio);
if (bs) {

View File

@ -517,6 +517,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_err_print_ctrl);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_vmscan_kswapd_done);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_do_swap_page_spf);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_exit_check);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_bio_free);
/*
* For type visibility
*/

View File

@ -22,6 +22,7 @@ struct blk_mq_tag_set;
/* struct blk_mq_tag_set */
#include <linux/blk-mq.h>
#endif /* __GENKSYMS__ */
struct bio;
DECLARE_HOOK(android_vh_blk_alloc_rqs,
TP_PROTO(size_t *rq_size, struct blk_mq_tag_set *set,
@ -33,6 +34,10 @@ DECLARE_HOOK(android_vh_blk_rq_ctx_init,
struct blk_mq_alloc_data *data, u64 alloc_time_ns),
TP_ARGS(rq, tags, data, alloc_time_ns));
DECLARE_HOOK(android_vh_bio_free,
TP_PROTO(struct bio *bio),
TP_ARGS(bio));
#endif /* _TRACE_HOOK_BLOCK_H */
/* This part must be outside protection */