ANDROID: GKI: add vendor hooks for blk_fill_rwbs

Add a vendor hook for blk_fill_rwbs is aimed to insert customized
characters into the rwbs buffer. This will help us to more intuitively
observe the request REQ_OP_XXX and flags from the tracepoint.

Bug: 347624919

Change-Id: I5fb5149f645a9dc59f695e1e1f87d17657c3ebb4
Signed-off-by: Wang Jianzheng <11134417@vivo.corp-partner.google.com>
[dhavale: rebased to resolve conflicts]
This commit is contained in:
Wang Jianzheng 2024-06-17 15:20:53 +08:00 committed by Sandeep Dhavale
parent 32721ad08c
commit 0dd775b383
3 changed files with 6 additions and 0 deletions

View File

@ -422,6 +422,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_usb_dev_suspend);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_usb_dev_resume);
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_blk_fill_rwbs);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_use_amu_fie);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_resume_begin);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_resume_end);

View File

@ -16,6 +16,9 @@ struct gendisk;
DECLARE_HOOK(android_vh_bd_link_disk_holder,
TP_PROTO(struct block_device *bdev, struct gendisk *disk),
TP_ARGS(bdev, disk));
DECLARE_HOOK(android_vh_blk_fill_rwbs,
TP_PROTO(char *rwbs, unsigned int opf),
TP_ARGS(rwbs, opf));
struct path;
struct vfsmount;

View File

@ -23,6 +23,7 @@
#include "../../block/blk.h"
#include <trace/events/block.h>
#include <trace/hooks/blk.h>
#include "trace_output.h"
@ -1909,6 +1910,7 @@ void blk_fill_rwbs(char *rwbs, blk_opf_t opf)
rwbs[i++] = 'S';
if (opf & REQ_META)
rwbs[i++] = 'M';
trace_android_vh_blk_fill_rwbs(rwbs, opf);
rwbs[i] = '\0';
}