From b67f210ad77b15cc6371b66aae9600b648ccc05b Mon Sep 17 00:00:00 2001 From: Wang Jianzheng <11134417@vivo.corp-partner.google.com> Date: Fri, 7 Jun 2024 11:18:44 +0800 Subject: [PATCH] ANDROID: vendor hooks: add vendor hooks for do_new_mount Add a vendor hook for do_new_mount_fc is aimed at categorizing the properties according to the path. And making these properties more easily accessible.This will help us to customize readahead operations, improving the speed of App startup and game loading. Bug: 345590666 Bug: 411057773 Change-Id: I913bbb9bd4c3efd5f4c7d101056d301855881cc2 Signed-off-by: Wang Jianzheng <11134417@vivo.corp-partner.google.com> (cherry picked from commit cdb09f7ea3366d2d6e4431f1329b26bd8317beb5) Signed-off-by: ying zuxin <11154159@vivo.com> --- drivers/android/vendor_hooks.c | 1 + fs/namespace.c | 3 +++ include/trace/hooks/blk.h | 7 +++++++ 3 files changed, 11 insertions(+) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 8e8138b8b90e..c280f0865180 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -487,6 +487,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_throttle_direct_reclaim_bypass); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_update_uid_stats); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_append_total_power); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_bd_link_disk_holder); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_do_new_mount_fc); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_new_ref); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_del_ref); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_fsnotify_open); diff --git a/fs/namespace.c b/fs/namespace.c index 73da51ac5a03..67ef907cf1ba 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -36,6 +36,7 @@ #include "pnode.h" #include "internal.h" +#include /* Maximum number of mounts in a mount namespace */ static unsigned int sysctl_mount_max __read_mostly = 100000; @@ -3454,6 +3455,8 @@ static int do_new_mount_fc(struct fs_context *fc, struct path *mountpoint, unlock_mount(mp); if (error < 0) mntput(mnt); + else + trace_android_vh_do_new_mount_fc(mountpoint, mnt); return error; } diff --git a/include/trace/hooks/blk.h b/include/trace/hooks/blk.h index a1962181bd55..17f8ce4bf183 100644 --- a/include/trace/hooks/blk.h +++ b/include/trace/hooks/blk.h @@ -17,6 +17,13 @@ DECLARE_HOOK(android_vh_bd_link_disk_holder, TP_PROTO(struct block_device *bdev, struct gendisk *disk), TP_ARGS(bdev, disk)); +struct path; +struct vfsmount; + +DECLARE_HOOK(android_vh_do_new_mount_fc, + TP_PROTO(struct path *mountpoint, struct vfsmount *mnt), + TP_ARGS(mountpoint, mnt)); + struct blk_mq_hw_ctx; struct request_queue;