]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/perfglue/cpu_profiler.cc
import ceph 15.2.14
[ceph.git] / ceph / src / perfglue / cpu_profiler.cc
index beec88533d0e869c68df53dee4577d026b60712a..f2576274cd44e3534c5754210bfe9bf96774ac6d 100644 (file)
@@ -22,7 +22,7 @@
 void cpu_profiler_handle_command(const std::vector<std::string> &cmd,
                                 ostream& out)
 {
-  if (cmd[1] == "status") {
+  if (cmd.size() == 1 && cmd[0] == "status") {
     ProfilerState st;
     ProfilerGetCurrentState(&st);
     out << "cpu_profiler " << (st.enabled ? "enabled":"not enabled")
@@ -30,7 +30,7 @@ void cpu_profiler_handle_command(const std::vector<std::string> &cmd,
        << " profile_name " << st.profile_name
        << " samples " << st.samples_gathered;
   }
-  else if (cmd[1] == "flush") {
+  else if (cmd.size() == 1 && cmd[0] == "flush") {
     ProfilerFlush();
     out << "cpu_profiler: flushed";
   }