From d13e071d282f9c728aac644e496470b57110fb57 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Mon, 12 Feb 2018 20:17:14 +0100 Subject: [PATCH] ceph: switch to SubsystemMap::should_gather(). Signed-off-by: Radoslaw Zarzynski --- src/mds/Migrator.cc | 2 +- src/os/filestore/FileStore.cc | 2 +- src/osd/PG.cc | 2 +- src/osd/PrimaryLogPG.cc | 2 +- src/osd/SnapMapper.cc | 10 +++++----- src/rgw/rgw_client_io.cc | 2 +- src/rgw/rgw_cr_rados.cc | 2 +- src/rgw/rgw_crypt.cc | 2 +- src/rgw/rgw_op.cc | 12 ++++++------ src/rgw/rgw_process.cc | 2 +- src/rgw/rgw_rados.cc | 9 +++++---- src/rgw/rgw_rest.cc | 2 +- src/rgw/rgw_rest_client.cc | 2 +- src/rgw/rgw_rest_log.cc | 4 ++-- src/rgw/rgw_rest_s3.cc | 4 ++-- src/rgw/rgw_rest_swift.cc | 2 +- 16 files changed, 31 insertions(+), 30 deletions(-) diff --git a/src/mds/Migrator.cc b/src/mds/Migrator.cc index a28be44bc3d4b..4bcb2193bf7ed 100644 --- a/src/mds/Migrator.cc +++ b/src/mds/Migrator.cc @@ -622,7 +622,7 @@ void Migrator::show_exporting() void Migrator::audit() { - if (!g_conf->subsys.should_gather(ceph_subsys_mds, 5)) + if (!g_conf->subsys.should_gather()) return; // hrm. // import_state diff --git a/src/os/filestore/FileStore.cc b/src/os/filestore/FileStore.cc index 6a0fd8603c638..6276b29b59878 100644 --- a/src/os/filestore/FileStore.cc +++ b/src/os/filestore/FileStore.cc @@ -5604,7 +5604,7 @@ int FileStore::_omap_setkeys(const coll_t& cid, const ghobject_t &hoid, } } skip: - if (g_conf->subsys.should_gather(ceph_subsys_filestore, 20)) { + if (g_conf->subsys.should_gather()) { for (auto& p : aset) { dout(20) << __FUNC__ << ": set " << p.first << dendl; } diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 7a84647a1759b..649f7177d2f86 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1417,7 +1417,7 @@ bool PG::choose_acting(pg_shard_t &auth_log_shard_id, map all_info(peer_info.begin(), peer_info.end()); all_info[pg_whoami] = info; - if (cct->_conf->subsys.should_gather(dout_subsys, 10)) { + if (cct->_conf->subsys.should_gather()) { for (map::iterator p = all_info.begin(); p != all_info.end(); ++p) { diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 38f999eeb5c14..dc194e0372998 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -7133,7 +7133,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector& ops) goto fail; } tracepoint(osd, do_osd_op_pre_omapsetvals, soid.oid.name.c_str(), soid.snap.val); - if (cct->_conf->subsys.should_gather(dout_subsys, 20)) { + if (cct->_conf->subsys.should_gather()) { dout(20) << "setting vals: " << dendl; map to_set; bufferlist::iterator pt = to_set_bl.begin(); diff --git a/src/osd/SnapMapper.cc b/src/osd/SnapMapper.cc index a544c92b53710..4aa97bf8782ed 100644 --- a/src/osd/SnapMapper.cc +++ b/src/osd/SnapMapper.cc @@ -170,7 +170,7 @@ void SnapMapper::clear_snaps( assert(check(oid)); set to_remove; to_remove.insert(to_object_key(oid)); - if (g_conf->subsys.should_gather(ceph_subsys_osd, 20)) { + if (g_conf->subsys.should_gather()) { for (auto& i : to_remove) { dout(20) << __func__ << " rm " << i << dendl; } @@ -189,7 +189,7 @@ void SnapMapper::set_snaps( encode(in, bl); to_set[to_object_key(oid)] = bl; dout(20) << __func__ << " " << oid << " " << in.snaps << dendl; - if (g_conf->subsys.should_gather(ceph_subsys_osd, 20)) { + if (g_conf->subsys.should_gather()) { for (auto& i : to_set) { dout(20) << __func__ << " set " << i.first << dendl; } @@ -228,7 +228,7 @@ int SnapMapper::update_snaps( to_remove.insert(to_raw_key(make_pair(*i, oid))); } } - if (g_conf->subsys.should_gather(ceph_subsys_osd, 20)) { + if (g_conf->subsys.should_gather()) { for (auto& i : to_remove) { dout(20) << __func__ << " rm " << i << dendl; } @@ -259,7 +259,7 @@ void SnapMapper::add_oid( ++i) { to_add.insert(to_raw(make_pair(*i, oid))); } - if (g_conf->subsys.should_gather(ceph_subsys_osd, 20)) { + if (g_conf->subsys.should_gather()) { for (auto& i : to_add) { dout(20) << __func__ << " set " << i.first << dendl; } @@ -340,7 +340,7 @@ int SnapMapper::_remove_oid( ++i) { to_remove.insert(to_raw_key(make_pair(*i, oid))); } - if (g_conf->subsys.should_gather(ceph_subsys_osd, 20)) { + if (g_conf->subsys.should_gather()) { for (auto& i : to_remove) { dout(20) << __func__ << " rm " << i << dendl; } diff --git a/src/rgw/rgw_client_io.cc b/src/rgw/rgw_client_io.cc index 49811a9d201f0..9528ab6fd6777 100644 --- a/src/rgw/rgw_client_io.cc +++ b/src/rgw/rgw_client_io.cc @@ -19,7 +19,7 @@ namespace io { if (init_error != 0) return init_error; - if (cct->_conf->subsys.should_gather(ceph_subsys_rgw, 20)) { + if (cct->_conf->subsys.should_gather()) { const auto& env_map = get_env().get_map(); for (const auto& iter: env_map) { diff --git a/src/rgw/rgw_cr_rados.cc b/src/rgw/rgw_cr_rados.cc index 5b68f5a86e45c..eca59a7f6f7a2 100644 --- a/src/rgw/rgw_cr_rados.cc +++ b/src/rgw/rgw_cr_rados.cc @@ -41,7 +41,7 @@ void RGWAsyncRadosProcessor::RGWWQ::_process(RGWAsyncRadosRequest *req, ThreadPo } void RGWAsyncRadosProcessor::RGWWQ::_dump_queue() { - if (!g_conf->subsys.should_gather(ceph_subsys_rgw, 20)) { + if (!g_conf->subsys.should_gather()) { return; } deque::iterator iter; diff --git a/src/rgw/rgw_crypt.cc b/src/rgw/rgw_crypt.cc index 8af6ce7a9553c..1b2de8ce72f35 100644 --- a/src/rgw/rgw_crypt.cc +++ b/src/rgw/rgw_crypt.cc @@ -550,7 +550,7 @@ int RGWGetObj_BlockDecrypt::read_manifest(bufferlist& manifest_bl) { } parts_len.back() += mi.get_stripe_size(); } - if (cct->_conf->subsys.should_gather(ceph_subsys_rgw, 20)) { + if (cct->_conf->subsys.should_gather()) { for (size_t i = 0; i_conf->subsys.should_gather(ceph_subsys_rgw, 15)) { - RGWAccessControlPolicy_S3 *s3policy = static_cast(policy); + if (cct->_conf->subsys.should_gather()) { ldout(cct, 15) << __func__ << " Read AccessControlPolicy"; + RGWAccessControlPolicy_S3 *s3policy = static_cast(policy); s3policy->to_xml(*_dout); *_dout << dendl; } @@ -1020,7 +1020,7 @@ int RGWOp::read_bucket_cors() ldout(s->cct, 0) << "ERROR: could not decode policy, caught buffer::error" << dendl; return -EIO; } - if (s->cct->_conf->subsys.should_gather(ceph_subsys_rgw, 15)) { + if (s->cct->_conf->subsys.should_gather()) { RGWCORSConfiguration_S3 *s3cors = static_cast(&bucket_cors); ldout(s->cct, 15) << "Read RGWCORSConfiguration"; s3cors->to_xml(*_dout); @@ -4906,7 +4906,7 @@ void RGWPutACLs::execute() } } - if (s->cct->_conf->subsys.should_gather(ceph_subsys_rgw, 15)) { + if (s->cct->_conf->subsys.should_gather()) { ldout(s->cct, 15) << "Old AccessControlPolicy"; policy->to_xml(*_dout); *_dout << dendl; @@ -4916,7 +4916,7 @@ void RGWPutACLs::execute() if (op_ret < 0) return; - if (s->cct->_conf->subsys.should_gather(ceph_subsys_rgw, 15)) { + if (s->cct->_conf->subsys.should_gather()) { ldout(s->cct, 15) << "New AccessControlPolicy:"; new_policy.to_xml(*_dout); *_dout << dendl; @@ -5019,7 +5019,7 @@ void RGWPutLC::execute() if (op_ret < 0) return; - if (s->cct->_conf->subsys.should_gather(ceph_subsys_rgw, 15)) { + if (s->cct->_conf->subsys.should_gather()) { ldout(s->cct, 15) << "New LifecycleConfiguration:"; new_config.to_xml(*_dout); *_dout << dendl; diff --git a/src/rgw/rgw_process.cc b/src/rgw/rgw_process.cc index dd4ca9b6922bd..5bf7475b1abb1 100644 --- a/src/rgw/rgw_process.cc +++ b/src/rgw/rgw_process.cc @@ -17,7 +17,7 @@ void RGWProcess::RGWWQ::_dump_queue() { - if (!g_conf->subsys.should_gather(ceph_subsys_rgw, 20)) { + if (!g_conf->subsys.should_gather()) { return; } deque::iterator iter; diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 64a784d8eaf2a..e78190c54c564 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -5569,7 +5569,7 @@ int rgw_policy_from_attrset(CephContext *cct, map& attrset, ldout(cct, 0) << "ERROR: could not decode policy, caught buffer::error" << dendl; return -EIO; } - if (cct->_conf->subsys.should_gather(ceph_subsys_rgw, 15)) { + if (cct->_conf->subsys.should_gather()) { RGWAccessControlPolicy_S3 *s3policy = static_cast(policy); ldout(cct, 15) << __func__ << " Read AccessControlPolicy"; s3policy->to_xml(*_dout); @@ -9309,7 +9309,8 @@ int RGWRados::get_obj_state_impl(RGWObjectCtx *rctx, const RGWBucketInfo& bucket return -EIO; } ldout(cct, 10) << "manifest: total_size = " << s->manifest.get_obj_size() << dendl; - if (cct->_conf->subsys.should_gather(ceph_subsys_rgw, 20) && s->manifest.has_explicit_objs()) { + if (cct->_conf->subsys.should_gather() && \ + s->manifest.has_explicit_objs()) { RGWObjManifest::obj_iterator mi; for (mi = s->manifest.obj_begin(); mi != s->manifest.obj_end(); ++mi) { ldout(cct, 20) << "manifest: ofs=" << mi.get_ofs() << " loc=" << mi.get_location().get_raw_obj(this) << dendl; @@ -9870,7 +9871,7 @@ int RGWRados::Object::Read::prepare() } if (params.attrs) { *params.attrs = astate->attrset; - if (cct->_conf->subsys.should_gather(ceph_subsys_rgw, 20)) { + if (cct->_conf->subsys.should_gather()) { for (iter = params.attrs->begin(); iter != params.attrs->end(); ++iter) { ldout(cct, 20) << "Read xattr: " << iter->first << dendl; } @@ -9974,7 +9975,7 @@ int RGWRados::stat_system_obj(RGWObjectCtx& obj_ctx, if (attrs) { *attrs = astate->attrset; - if (cct->_conf->subsys.should_gather(ceph_subsys_rgw, 20)) { + if (cct->_conf->subsys.should_gather()) { map::iterator iter; for (iter = attrs->begin(); iter != attrs->end(); ++iter) { ldout(cct, 20) << "Read xattr: " << iter->first << dendl; diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index 71c142ee2cc7e..946d55b377490 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -1439,7 +1439,7 @@ int RGWPostObj_ObjStore::get_params() return -EINVAL; } - if (s->cct->_conf->subsys.should_gather(ceph_subsys_rgw, 20)) { + if (s->cct->_conf->subsys.should_gather()) { ldout(s->cct, 20) << "request content_type_str=" << req_content_type_str << dendl; ldout(s->cct, 20) << "request content_type params:" << dendl; diff --git a/src/rgw/rgw_rest_client.cc b/src/rgw/rgw_rest_client.cc index 22bbfe80f363f..079a305c2fc6b 100644 --- a/src/rgw/rgw_rest_client.cc +++ b/src/rgw/rgw_rest_client.cc @@ -213,7 +213,7 @@ int RGWRESTSimpleRequest::sign_request(RGWAccessKey& key, RGWEnv& env, req_info& return 0; } - if (cct->_conf->subsys.should_gather(ceph_subsys_rgw, 20)) { + if (cct->_conf->subsys.should_gather()) { for (const auto& i: env.get_map()) { ldout(cct, 20) << "> " << i.first << " -> " << rgw::crypt_sanitize::x_meta_map{i.first, i.second} << dendl; } diff --git a/src/rgw/rgw_rest_log.cc b/src/rgw/rgw_rest_log.cc index 47d4e3e7a8141..a0510266f411d 100644 --- a/src/rgw/rgw_rest_log.cc +++ b/src/rgw/rgw_rest_log.cc @@ -352,7 +352,7 @@ void RGWOp_MDLog_Notify::execute() { return; } - if (store->ctx()->_conf->subsys.should_gather(ceph_subsys_rgw, 20)) { + if (store->ctx()->_conf->subsys.should_gather()) { for (set::iterator iter = updated_shards.begin(); iter != updated_shards.end(); ++iter) { ldout(s->cct, 20) << __func__ << "(): updated shard=" << *iter << dendl; } @@ -782,7 +782,7 @@ void RGWOp_DATALog_Notify::execute() { return; } - if (store->ctx()->_conf->subsys.should_gather(ceph_subsys_rgw, 20)) { + if (store->ctx()->_conf->subsys.should_gather()) { for (map >::iterator iter = updated_shards.begin(); iter != updated_shards.end(); ++iter) { ldout(s->cct, 20) << __func__ << "(): updated shard=" << iter->first << dendl; set& keys = iter->second; diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index fce58c61a6656..d9b28ac524e16 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -1550,7 +1550,7 @@ int RGWPostObj_ObjStore_S3::get_params() if (r < 0) return r; - if (s->cct->_conf->subsys.should_gather(ceph_subsys_rgw, 20)) { + if (s->cct->_conf->subsys.should_gather()) { ldout(s->cct, 20) << "read part header -- part.name=" << part.name << dendl; @@ -2345,7 +2345,7 @@ int RGWPutCORS_ObjStore_S3::get_params() in_data.append(data, len); } - if (s->cct->_conf->subsys.should_gather(ceph_subsys_rgw, 15)) { + if (s->cct->_conf->subsys.should_gather()) { ldout(s->cct, 15) << "CORSConfiguration"; cors_config->to_xml(*_dout); *_dout << dendl; diff --git a/src/rgw/rgw_rest_swift.cc b/src/rgw/rgw_rest_swift.cc index ae450b87f30ac..60d9b4a8ffef0 100644 --- a/src/rgw/rgw_rest_swift.cc +++ b/src/rgw/rgw_rest_swift.cc @@ -2033,7 +2033,7 @@ int RGWFormPost::get_params() return ret; } - if (s->cct->_conf->subsys.should_gather(ceph_subsys_rgw, 20)) { + if (s->cct->_conf->subsys.should_gather()) { ldout(s->cct, 20) << "read part header -- part.name=" << part.name << dendl; -- 2.39.5