Skip to content

Commit

Permalink
blk-iocost: Add iocg idle state tracepoint
Browse files Browse the repository at this point in the history
It will be helpful to trace the iocg's whole state, including active and
idle state. And we can easily expand the original iocost_iocg_activate
trace event to support a state trace class, including active and idle
state tracing.

Acked-by: Tejun Heo <[email protected]>
Signed-off-by: Baolin Wang <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Baolin Wang authored and axboe committed Dec 17, 2020
1 parent 1aba169 commit 76efc1c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 3 additions & 0 deletions block/blk-iocost.c
Original file line number Diff line number Diff line change
Expand Up @@ -2185,6 +2185,9 @@ static int ioc_check_iocgs(struct ioc *ioc, struct ioc_now *now)
WEIGHT_ONE);
}

TRACE_IOCG_PATH(iocg_idle, iocg, now,
atomic64_read(&iocg->active_period),
atomic64_read(&ioc->cur_period), vtime);
__propagate_weights(iocg, 0, 0, false, now);
list_del_init(&iocg->active_list);
}
Expand Down
16 changes: 15 additions & 1 deletion include/trace/events/iocost.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct ioc_gq;

#include <linux/tracepoint.h>

TRACE_EVENT(iocost_iocg_activate,
DECLARE_EVENT_CLASS(iocost_iocg_state,

TP_PROTO(struct ioc_gq *iocg, const char *path, struct ioc_now *now,
u64 last_period, u64 cur_period, u64 vtime),
Expand Down Expand Up @@ -59,6 +59,20 @@ TRACE_EVENT(iocost_iocg_activate,
)
);

DEFINE_EVENT(iocost_iocg_state, iocost_iocg_activate,
TP_PROTO(struct ioc_gq *iocg, const char *path, struct ioc_now *now,
u64 last_period, u64 cur_period, u64 vtime),

TP_ARGS(iocg, path, now, last_period, cur_period, vtime)
);

DEFINE_EVENT(iocost_iocg_state, iocost_iocg_idle,
TP_PROTO(struct ioc_gq *iocg, const char *path, struct ioc_now *now,
u64 last_period, u64 cur_period, u64 vtime),

TP_ARGS(iocg, path, now, last_period, cur_period, vtime)
);

DECLARE_EVENT_CLASS(iocg_inuse_update,

TP_PROTO(struct ioc_gq *iocg, const char *path, struct ioc_now *now,
Expand Down

0 comments on commit 76efc1c

Please sign in to comment.