]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: heap profiling cleanups in response to review notes, build fixes. 13073/head
authorJesse Williamson <jwilliamson@suse.de>
Sat, 28 Jan 2017 18:22:16 +0000 (10:22 -0800)
committerJesse Williamson <jwilliamson@suse.de>
Mon, 3 Apr 2017 08:12:29 +0000 (01:12 -0700)
Signed-off-by: Jesse Williamson <jwilliamson@suse.de>
qa/workunits/cephtool/test.sh
src/osd/OSD.cc

index 383163f538b1564fc29260ccd90b8422dea5655c..969e4021613d4ce21399b75bbf77e7cc2458a01d 100755 (executable)
@@ -1742,7 +1742,7 @@ function test_admin_heap_profiler()
 
   [[ $do_test -eq 0 ]] && return 0
 
-  admin_socket = "--admin-deamon out/osd.0.asok"
+  admin_socket = "--admin-daemon out/osd.0.asok"
 
   ceph --admin $admin_socket heap start_profiler
   ceph --admin $admin_socket heap dump
index 851de7899ea75b816c2acf1bd50be7623ce37a05..c1beee258584461a2f3c3673cfae1f3ce6e6a726 100644 (file)
@@ -1872,7 +1872,7 @@ class OSDSocketHook : public AdminSocketHook {
   OSD *osd;
 public:
   explicit OSDSocketHook(OSD *o) : osd(o) {}
-  bool call(std::string command, cmdmap_t& cmdmap, std::string format,
+  bool call(std::string admin_command, cmdmap_t& cmdmap, std::string format,
            bufferlist& out) override {
     stringstream ss;
     bool r = osd->asok_command(admin_command, cmdmap, format, ss);
@@ -1911,12 +1911,12 @@ bool OSD::asok_command(string admin_command, cmdmap_t& cmdmap, string format,
       ss << "op_tracker tracking is not enabled now, so no ops are tracked currently, even those get stuck. \
        Please enable \"osd_enable_op_tracker\", and the tracker will start to track new ops received afterwards.";
     }
-  } else if (command == "dump_historic_ops") {
+  } else if (admin_command == "dump_historic_ops") {
     if (!op_tracker.dump_historic_ops(f, false)) {
       ss << "op_tracker tracking is not enabled now, so no ops are tracked currently, even those get stuck. \
        Please enable \"osd_enable_op_tracker\", and the tracker will start to track new ops received afterwards.";
     }
-  } else if (command == "dump_historic_ops_by_duration") {
+  } else if (admin_command == "dump_historic_ops_by_duration") {
     if (!op_tracker.dump_historic_ops(f, true)) {
       ss << "op_tracker tracking is not enabled now, so no ops are tracked currently, even those get stuck. \
        Please enable \"osd_enable_op_tracker\", and the tracker will start to track new ops received afterwards.";
@@ -2046,13 +2046,13 @@ bool OSD::asok_command(string admin_command, cmdmap_t& cmdmap, string format,
     f->dump_bool("success", success);
     f->dump_int("value", value);
     f->close_section();
-  } else if (command == "dump_objectstore_kv_stats") {
+  } else if (admin_command == "dump_objectstore_kv_stats") {
     store->get_db_statistics(f);
-  } else if (command == "dump_scrubs") {
+  } else if (admin_command == "dump_scrubs") {
     service.dumps_scrub(f);
   } else if (admin_command == "calc_objectstore_db_histogram") {
     store->generate_db_histogram(f);
-  } else if (command == "flush_store_cache") {
+  } else if (admin_command == "flush_store_cache") {
     store->flush_cache();
   } else {
     assert(0 == "broken asok registration");
@@ -9567,13 +9567,12 @@ int heap(CephContext& cct, cmdmap_t& cmdmap, Formatter& f, std::ostream& os)
   }
   
   string cmd;
-  std::vector<std::string> cmd_vec;
-  if (false == cmd_getval(&cct, cmdmap, "heapcmd", cmd)) {
+  if (!cmd_getval(&cct, cmdmap, "heapcmd", cmd)) {
         os << "unable to get value for command \"" << cmd << "\"";
        return -EINVAL;
    }
   
+  std::vector<std::string> cmd_vec;
   get_str_vec(cmd, cmd_vec);
   
   ceph_heap_profiler_handle_command(cmd_vec, os);