From: Adam Crume Date: Mon, 18 Aug 2014 20:14:02 +0000 (-0700) Subject: lttng: Remove tracing-specfic local variables when lttng disabled X-Git-Tag: v0.86~231^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=07ab36f9e72e784a9ddb027c5533c6ad83f8fa38;p=ceph.git lttng: Remove tracing-specfic local variables when lttng disabled Signed-off-by: Adam Crume --- diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index afda6192a1d0..511dc4d1e2df 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -2219,7 +2219,9 @@ unsigned FileStore::_do_transaction( { dout(10) << "_do_transaction on " << &t << dendl; +#ifdef WITH_LTTNG const char *osr_name = t.get_osr() ? ((OpSequencer*)t.get_osr())->get_name().c_str() : ""; +#endif Transaction::iterator i = t.begin(); @@ -4469,7 +4471,7 @@ bool FileStore::collection_empty(coll_t c) } bool ret = ls.empty(); tracepoint(objectstore, collection_empty_exit, ret); - return ls.empty(); + return ret; } int FileStore::collection_list_range(coll_t c, ghobject_t start, ghobject_t end, diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 9a5c15e89998..1171b7072d8d 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -5531,7 +5531,9 @@ void OSD::ms_fast_dispatch(Message *m) } OpRequestRef op = op_tracker.create_request(m); { +#ifdef WITH_LTTNG osd_reqid_t reqid = op->get_reqid(); +#endif tracepoint(osd, ms_fast_dispatch, reqid.name._type, reqid.name._num, reqid.tid, reqid.inc); } @@ -8291,7 +8293,9 @@ void OSD::ShardedOpWQ::_process(uint32_t thread_index, heartbeat_handle_d *hb ) // osd:opwq_process marks the point at which an operation has been dequeued // and will begin to be handled by a worker thread. { +#ifdef WITH_LTTNG osd_reqid_t reqid = op->get_reqid(); +#endif tracepoint(osd, opwq_process_start, reqid.name._type, reqid.name._num, reqid.tid, reqid.inc); } @@ -8308,7 +8312,9 @@ void OSD::ShardedOpWQ::_process(uint32_t thread_index, heartbeat_handle_d *hb ) osd->dequeue_op(item.first, op, tp_handle); { +#ifdef WITH_LTTNG osd_reqid_t reqid = op->get_reqid(); +#endif tracepoint(osd, opwq_process_finish, reqid.name._type, reqid.name._num, reqid.tid, reqid.inc); } diff --git a/src/osd/OpRequest.cc b/src/osd/OpRequest.cc index d45de6f02862..8193556312e8 100644 --- a/src/osd/OpRequest.cc +++ b/src/osd/OpRequest.cc @@ -94,7 +94,9 @@ bool OpRequest::need_class_write_cap() { } void OpRequest::set_rmw_flags(int flags) { +#ifdef WITH_LTTNG int old_rmw_flags = rmw_flags; +#endif rmw_flags |= flags; tracepoint(oprequest, set_rmw_flags, reqid.name._type, reqid.name._num, reqid.tid, reqid.inc, @@ -109,7 +111,9 @@ void OpRequest::set_pg_op() { set_rmw_flags(CEPH_OSD_RMW_FLAG_PGOP); } void OpRequest::set_cache() { set_rmw_flags(CEPH_OSD_RMW_FLAG_CACHE); } void OpRequest::mark_flag_point(uint8_t flag, string s) { +#ifdef WITH_LTTNG uint8_t old_flags = hit_flag_points; +#endif mark_event(s); current = s; hit_flag_points |= flag; diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 7e4883382c9a..902335ac6e72 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1727,7 +1727,9 @@ void PG::queue_op(OpRequestRef& op) osd->op_wq.queue(make_pair(PGRef(this), op)); { // after queue() to include any locking costs +#ifdef WITH_LTTNG osd_reqid_t reqid = op->get_reqid(); +#endif tracepoint(pg, queue_op, reqid.name._type, reqid.name._num, reqid.tid, reqid.inc, op->rmw_flags); } diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 0b17d609cc4e..3e283cc3fdbb 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1846,7 +1846,9 @@ void ReplicatedPG::execute_ctx(OpContext *ctx) } { +#ifdef WITH_LTTNG osd_reqid_t reqid = ctx->op->get_reqid(); +#endif tracepoint(osd, prepare_tx_enter, reqid.name._type, reqid.name._num, reqid.tid, reqid.inc); } @@ -1854,7 +1856,9 @@ void ReplicatedPG::execute_ctx(OpContext *ctx) int result = prepare_transaction(ctx); { +#ifdef WITH_LTTNG osd_reqid_t reqid = ctx->op->get_reqid(); +#endif tracepoint(osd, prepare_tx_exit, reqid.name._type, reqid.name._num, reqid.tid, reqid.inc); }