bdev: Change name and parameter order of function to dump I/O statistics

For consistency, rename a JSON dump function by bdev_io_stat_dump_json()
and change the parameter order.

Other public APIs and function pointers in the generic bdev layer,
spdk_bdev_dump_info_json(), spdk_bdev_fn_table::dump_info_json, and
spdk_bdev_fn_table::write_config_json have a json_write_ctx pointer
as the last parameter. For consistency, swap a statistics pointer and
a json_write_ctx pointer.

This is another preparation to extend I/O statistics to include error
counters and module specific counters to output these via the
bdev_get_iostat RPC.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I6f3bb6f2752f7da856d4fe66c0f1f8a2eedc176b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15731
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
This commit is contained in:
Shuhei Matsumoto 2022-12-01 17:37:26 +09:00 committed by Tomasz Zawadzki
parent 5d269efe96
commit fab3558f2e
3 changed files with 4 additions and 4 deletions

View File

@ -3706,7 +3706,7 @@ bdev_io_stat_free(struct spdk_bdev_io_stat *stat)
}
void
bdev_get_iostat_dump(struct spdk_json_write_ctx *w, struct spdk_bdev_io_stat *stat)
bdev_io_stat_dump_json(struct spdk_bdev_io_stat *stat, struct spdk_json_write_ctx *w)
{
spdk_json_write_named_uint64(w, "bytes_read", stat->bytes_read);
spdk_json_write_named_uint64(w, "num_read_ops", stat->num_read_ops);

View File

@ -23,6 +23,6 @@ void bdev_io_submit(struct spdk_bdev_io *bdev_io);
struct spdk_bdev_io_stat *bdev_io_stat_alloc(void);
void bdev_io_stat_free(struct spdk_bdev_io_stat *stat);
void bdev_get_iostat_dump(struct spdk_json_write_ctx *w, struct spdk_bdev_io_stat *stat);
void bdev_io_stat_dump_json(struct spdk_bdev_io_stat *stat, struct spdk_json_write_ctx *w);
#endif /* SPDK_BDEV_INTERNAL_H */

View File

@ -263,7 +263,7 @@ bdev_get_iostat_done(struct spdk_bdev *bdev, struct spdk_bdev_io_stat *stat,
spdk_json_write_named_string(w, "name", spdk_bdev_get_name(bdev));
bdev_get_iostat_dump(w, stat);
bdev_io_stat_dump_json(stat, w);
if (spdk_bdev_get_qd_sampling_period(bdev)) {
spdk_json_write_named_uint64(w, "queue_depth_polling_period",
@ -337,7 +337,7 @@ bdev_get_per_channel_stat(struct spdk_bdev_channel_iter *i, struct spdk_bdev *bd
spdk_json_write_object_begin(w);
spdk_json_write_named_uint64(w, "thread_id", spdk_thread_get_id(spdk_get_thread()));
bdev_get_iostat_dump(w, bdev_ctx->stat);
bdev_io_stat_dump_json(bdev_ctx->stat, w);
spdk_json_write_object_end(w);
spdk_bdev_for_each_channel_continue(i, 0);