ANDROID: vendor_hooks: Add hook for mmc queue

Add a mmc hook to support customizing mmc queue by vendor host
requirements

Bug: 306334321
Change-Id: I737485c3fc0438ef221cd3ffe81a66f7e3b66500
Signed-off-by: Qilin Tan <qilin.tan@mediatek.com>
Signed-off-by: Browse Zhang <browse.zhang@mediatek.com>
This commit is contained in:
Browse Zhang 2023-10-19 17:51:15 +08:00 committed by lei zhang
parent 43a07d84da
commit 5683c2b460
3 changed files with 8 additions and 0 deletions

View file

@ -297,6 +297,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_should_continue_reclaim);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_file_is_tiny_bypass);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_mmc_resume);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_mmc_suspend);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmc_update_mmc_queue);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_exit_signal);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_shrink_node_memcgs);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_modify_thermal_request_freq);

View file

@ -46,6 +46,7 @@
#include <linux/mmc/host.h>
#include <linux/mmc/mmc.h>
#include <linux/mmc/sd.h>
#include <trace/hooks/mmc.h>
#include <linux/uaccess.h>
@ -2993,6 +2994,7 @@ static int mmc_blk_probe(struct mmc_card *card)
ret = PTR_ERR(md);
goto out_free;
}
trace_android_vh_mmc_update_mmc_queue(card, &md->queue);
ret = mmc_blk_alloc_parts(card, md);
if (ret)

View file

@ -8,6 +8,7 @@
#include <trace/hooks/vendor_hooks.h>
struct mmc_host;
struct mmc_card;
struct mmc_queue;
/*
* Following tracepoints are not exported in tracefs and provide a
@ -29,6 +30,10 @@ DECLARE_RESTRICTED_HOOK(android_rvh_mmc_resume,
TP_PROTO(struct mmc_host *host, bool *resume_success),
TP_ARGS(host, resume_success), 1);
DECLARE_HOOK(android_vh_mmc_update_mmc_queue,
TP_PROTO(struct mmc_card *card, struct mmc_queue *mq),
TP_ARGS(card, mq));
#endif /* _TRACE_HOOK_MMC_H */
/* This part must be outside protection */
#include <trace/define_trace.h>