diff --git a/block/blk-core.c b/block/blk-core.c index d64ce14cbe6c..73adca697336 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -66,6 +66,9 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(block_rq_merge); EXPORT_TRACEPOINT_SYMBOL_GPL(block_rq_requeue); EXPORT_TRACEPOINT_SYMBOL_GPL(block_rq_complete); +#undef CREATE_TRACE_POINTS +#include + DEFINE_IDA(blk_queue_ida); /* @@ -522,6 +525,7 @@ struct request_queue *blk_alloc_queue(int node_id) { struct request_queue *q; int ret; + bool skip = false; q = kmem_cache_alloc_node(blk_requestq_cachep, GFP_KERNEL | __GFP_ZERO, node_id); @@ -585,6 +589,10 @@ struct request_queue *blk_alloc_queue(int node_id) blk_set_default_limits(&q->limits); q->nr_requests = BLKDEV_MAX_RQ; + trace_android_rvh_blk_allocated_queue_init(&skip, q); + if (skip) + goto fail_ref; + return q; fail_ref: @@ -1761,6 +1769,7 @@ EXPORT_SYMBOL(blk_check_plugged); void blk_flush_plug_list(struct blk_plug *plug, bool from_schedule) { + trace_android_rvh_blk_flush_plug_list(plug, from_schedule); flush_plug_callbacks(plug, from_schedule); if (!list_empty(&plug->mq_list)) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 88c5f093c6b5..343ce4f1774e 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -529,6 +529,8 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_blk_mq_alloc_rq_map); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_blk_mq_init_allocated_queue); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_mq_exit_queue); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_mq_alloc_tag_set); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_blk_allocated_queue_init); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_blk_flush_plug_list); /* * For type visibility */ diff --git a/include/trace/hooks/block.h b/include/trace/hooks/block.h index 39cba4bd0756..9d2db2257e16 100644 --- a/include/trace/hooks/block.h +++ b/include/trace/hooks/block.h @@ -26,6 +26,7 @@ struct blk_mq_hw_ctx; struct bio; struct request_queue; struct request; +struct blk_plug; DECLARE_HOOK(android_vh_blk_alloc_rqs, TP_PROTO(size_t *rq_size, struct blk_mq_tag_set *set, @@ -98,6 +99,14 @@ DECLARE_HOOK(android_vh_blk_mq_update_nr_requests, TP_PROTO(bool *skip, struct request_queue *q), TP_ARGS(skip, q)); +DECLARE_RESTRICTED_HOOK(android_rvh_blk_allocated_queue_init, + TP_PROTO(bool *skip, struct request_queue *q), + TP_ARGS(skip, q), 1); + +DECLARE_RESTRICTED_HOOK(android_rvh_blk_flush_plug_list, + TP_PROTO(struct blk_plug *plug, bool from_schedule), + TP_ARGS(plug, from_schedule), 1); + #endif /* _TRACE_HOOK_BLOCK_H */ /* This part must be outside protection */