ANDROID: vendor_hooks: Add hook for blk request
We want to use this hook to record time and blk size when blk request end Bug: 292581151 Change-Id: I5083d24175725afd8e26c17a0a23c624432d2172 Signed-off-by: Li Chong <lichong1@oppo.com>
This commit is contained in:
committed by
Treehugger Robot
parent
bd148ab7d8
commit
f9ac52c8b5
@@ -44,6 +44,8 @@
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include <trace/events/block.h>
|
||||
#undef CREATE_TRACE_POINTS
|
||||
#include <trace/hooks/block.h>
|
||||
|
||||
#include "blk.h"
|
||||
#include "blk-mq.h"
|
||||
@@ -1266,6 +1268,7 @@ void blk_account_io_done(struct request *req, u64 now)
|
||||
* normal IO on queueing nor completion. Accounting the
|
||||
* containing request is enough.
|
||||
*/
|
||||
trace_android_vh_blk_account_io_done(req);
|
||||
if (req->part && blk_do_io_stat(req) &&
|
||||
!(req->rq_flags & RQF_FLUSH_SEQ)) {
|
||||
const int sgrp = op_stat_group(req_op(req));
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_alloc_rqs);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_rq_ctx_init);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_account_io_done);
|
||||
|
||||
/*
|
||||
* For type visibility
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
struct blk_mq_tags;
|
||||
struct blk_mq_alloc_data;
|
||||
struct blk_mq_tag_set;
|
||||
struct request;
|
||||
|
||||
DECLARE_HOOK(android_vh_blk_alloc_rqs,
|
||||
TP_PROTO(size_t *rq_size, struct blk_mq_tag_set *set,
|
||||
@@ -30,6 +31,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_blk_account_io_done,
|
||||
TP_PROTO(struct request *rq),
|
||||
TP_ARGS(rq));
|
||||
|
||||
#endif /* _TRACE_HOOK_BLOCK_H */
|
||||
|
||||
/* This part must be outside protection */
|
||||
|
||||
Reference in New Issue
Block a user