bdev/trace: convert trace submit parameter into uint64_t type
Parameters submitted by bdev trace record may not be uint64_t type (ex: bdev_io->type), which may bring outliers in trace parsing results. The reason is that, in _spdk_trace_record() function, va_list hold information about variable arguments, when passing SPDK_TRACE_ARG_TYPE_INT arguments, it will call va_arg(vl, uint64_t) to get value. However, if the submitted type is not uint64_t, va_arg may return outlier. To solve the problem, the parameter should be converted into uint64_t before be delivered into trace record if it is not uint64_t. Signed-off-by: zhaoshushu.zss <zhaoshushu.zss@alibaba-inc.com> Change-Id: Id710e39581f5e7b7551f3ff3a308f122f1344f1f Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11691 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
This commit is contained in:
parent
c706c20c50
commit
eacab9269a
@ -2692,9 +2692,9 @@ _bdev_io_submit(void *ctx)
|
||||
|
||||
tsc = spdk_get_ticks();
|
||||
bdev_io->internal.submit_tsc = tsc;
|
||||
spdk_trace_record_tsc(tsc, TRACE_BDEV_IO_START, 0, 0, (uintptr_t)bdev_io, bdev_io->type,
|
||||
bdev_io->internal.caller_ctx, bdev_io->u.bdev.offset_blocks,
|
||||
bdev_io->u.bdev.num_blocks);
|
||||
spdk_trace_record_tsc(tsc, TRACE_BDEV_IO_START, 0, 0, (uintptr_t)bdev_io,
|
||||
(uint64_t)bdev_io->type, bdev_io->internal.caller_ctx,
|
||||
bdev_io->u.bdev.offset_blocks, bdev_io->u.bdev.num_blocks);
|
||||
|
||||
if (spdk_likely(bdev_ch->flags == 0)) {
|
||||
bdev_io_do_submit(bdev_ch, bdev_io);
|
||||
@ -2800,7 +2800,7 @@ bdev_io_submit(struct spdk_bdev_io *bdev_io)
|
||||
if (bdev_io_should_split(bdev_io)) {
|
||||
bdev_io->internal.submit_tsc = spdk_get_ticks();
|
||||
spdk_trace_record_tsc(bdev_io->internal.submit_tsc, TRACE_BDEV_IO_START, 0, 0,
|
||||
(uintptr_t)bdev_io, bdev_io->type, bdev_io->internal.caller_ctx,
|
||||
(uintptr_t)bdev_io, (uint64_t)bdev_io->type, bdev_io->internal.caller_ctx,
|
||||
bdev_io->u.bdev.offset_blocks, bdev_io->u.bdev.num_blocks);
|
||||
bdev_io_split(NULL, bdev_io);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user