From 6a7a0c581ef399ed0f04b16deac9d1fe369d75bd Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Thu, 14 May 2020 12:31:42 -0400 Subject: [PATCH] librbd: api::Io now properly passing the parent trace information A copy-and-paste error from moving the original implentation from ImageRequestWQ resulted in the parent trace being incorrectly uninitialized. Signed-off-by: Jason Dillaman --- src/librbd/api/Io.cc | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/librbd/api/Io.cc b/src/librbd/api/Io.cc index b1de3018bea7a..a91b555686194 100644 --- a/src/librbd/api/Io.cc +++ b/src/librbd/api/Io.cc @@ -186,8 +186,8 @@ void Io::aio_read(I &image_ctx, io::AioCompletion *aio_comp, uint64_t off, FUNCTRACE(cct); ZTracer::Trace trace; if (image_ctx.blkin_trace_all) { - trace.init("wq: read", &image_ctx.trace_endpoint); - trace.event("start"); + trace.init("io: read", &image_ctx.trace_endpoint); + trace.event("init"); } aio_comp->init_time(util::get_image_ctx(&image_ctx), io::AIO_TYPE_READ); @@ -205,7 +205,7 @@ void Io::aio_read(I &image_ctx, io::AioCompletion *aio_comp, uint64_t off, auto req = io::ImageDispatchSpec::create_read( image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, aio_comp, {{off, len}}, - std::move(read_result), op_flags, {}); + std::move(read_result), op_flags, trace); req->send(); } @@ -217,7 +217,7 @@ void Io::aio_write(I &image_ctx, io::AioCompletion *aio_comp, uint64_t off, FUNCTRACE(cct); ZTracer::Trace trace; if (image_ctx.blkin_trace_all) { - trace.init("wq: write", &image_ctx.trace_endpoint); + trace.init("io: write", &image_ctx.trace_endpoint); trace.event("init"); } @@ -236,7 +236,7 @@ void Io::aio_write(I &image_ctx, io::AioCompletion *aio_comp, uint64_t off, auto req = io::ImageDispatchSpec::create_write( image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, aio_comp, {{off, len}}, - std::move(bl), op_flags, {}, 0); + std::move(bl), op_flags, trace, 0); req->send(); } @@ -248,7 +248,7 @@ void Io::aio_discard(I &image_ctx, io::AioCompletion *aio_comp, uint64_t off, FUNCTRACE(cct); ZTracer::Trace trace; if (image_ctx.blkin_trace_all) { - trace.init("wq: discard", &image_ctx.trace_endpoint); + trace.init("io: discard", &image_ctx.trace_endpoint); trace.event("init"); } @@ -267,7 +267,7 @@ void Io::aio_discard(I &image_ctx, io::AioCompletion *aio_comp, uint64_t off, auto req = io::ImageDispatchSpec::create_discard( image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, aio_comp, off, len, - discard_granularity_bytes, {}, 0); + discard_granularity_bytes, trace, 0); req->send(); } @@ -279,7 +279,7 @@ void Io::aio_write_same(I &image_ctx, io::AioCompletion *aio_comp, FUNCTRACE(cct); ZTracer::Trace trace; if (image_ctx.blkin_trace_all) { - trace.init("wq: writesame", &image_ctx.trace_endpoint); + trace.init("io: writesame", &image_ctx.trace_endpoint); trace.event("init"); } @@ -299,7 +299,7 @@ void Io::aio_write_same(I &image_ctx, io::AioCompletion *aio_comp, auto req = io::ImageDispatchSpec::create_write_same( image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, aio_comp, off, len, - std::move(bl), op_flags, {}, 0); + std::move(bl), op_flags, trace, 0); req->send(); } @@ -313,7 +313,7 @@ void Io::aio_compare_and_write(I &image_ctx, io::AioCompletion *aio_comp, FUNCTRACE(cct); ZTracer::Trace trace; if (image_ctx.blkin_trace_all) { - trace.init("wq: compare_and_write", &image_ctx.trace_endpoint); + trace.init("io: compare_and_write", &image_ctx.trace_endpoint); trace.event("init"); } @@ -333,7 +333,7 @@ void Io::aio_compare_and_write(I &image_ctx, io::AioCompletion *aio_comp, auto req = io::ImageDispatchSpec::create_compare_and_write( image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, aio_comp, {{off, len}}, - std::move(cmp_bl), std::move(bl), mismatch_off, op_flags, {}, 0); + std::move(cmp_bl), std::move(bl), mismatch_off, op_flags, trace, 0); req->send(); } @@ -344,7 +344,7 @@ void Io::aio_flush(I &image_ctx, io::AioCompletion *aio_comp, FUNCTRACE(cct); ZTracer::Trace trace; if (image_ctx.blkin_trace_all) { - trace.init("wq: flush", &image_ctx.trace_endpoint); + trace.init("io: flush", &image_ctx.trace_endpoint); trace.event("init"); } @@ -362,7 +362,7 @@ void Io::aio_flush(I &image_ctx, io::AioCompletion *aio_comp, auto req = io::ImageDispatchSpec::create_flush( image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, aio_comp, - io::FLUSH_SOURCE_USER, {}); + io::FLUSH_SOURCE_USER, trace); req->send(); } -- 2.39.5