blkin: fix unconditional tracing

Blkin trace will be triggered unconditionally at OSD `issue_op`, even if
op->pg_trace is not initialized. This issue introduces unnecessary
overhead and confusing tracing records when blkin tracing is ON.

Signed-off-by: Yingxin <yingxin.cheng@intel.com>
This commit is contained in:
Yingxin 2017-11-27 05:02:25 -05:00
parent 993b5f304e
commit 072a25cd6e

View File

@ -1042,7 +1042,7 @@ void ReplicatedBackend::issue_op(
op_t,
peer,
pinfo);
if (op->op)
if (op->op && op->op->pg_trace)
wr->trace.init("replicated op", nullptr, &op->op->pg_trace);
get_parent()->send_message_osd_cluster(
peer.osd, wr, get_osdmap()->get_epoch());