if (cmd_getval(cmdmap, "value", value)) {
heapcmd_vec.push_back(value);
}
- ceph_heap_profiler_handle_command(heapcmd_vec, ss);
+ std::stringstream outss;
+ ceph_heap_profiler_handle_command(heapcmd_vec, outss);
+ outbl.append(outss);
r = 0;
}
} else if (command == "cpu_profiler") {
// Commands shared between OSD's console and admin console:
namespace ceph::osd_cmds {
-int heap(CephContext& cct, const cmdmap_t& cmdmap, Formatter& f, std::ostream& os);
+int heap(CephContext& cct,
+ const cmdmap_t& cmdmap,
+ std::ostream& outos,
+ std::ostream& erros);
} // namespace ceph::osd_cmds
}
else if (prefix == "heap") {
- ret = ceph::osd_cmds::heap(*cct, cmdmap, *f, ss);
+ std::stringstream outss;
+ ret = ceph::osd_cmds::heap(*cct, cmdmap, outss, ss);
+ outbl.append(outss);
}
else if (prefix == "debug dump_missing") {
namespace ceph::osd_cmds {
-int heap(CephContext& cct, const cmdmap_t& cmdmap, Formatter& f,
- std::ostream& os)
+int heap(CephContext& cct,
+ const cmdmap_t& cmdmap,
+ std::ostream& outos,
+ std::ostream& erros)
{
if (!ceph_using_tcmalloc()) {
- os << "could not issue heap profiler command -- not using tcmalloc!";
+ erros << "could not issue heap profiler command -- not using tcmalloc!";
return -EOPNOTSUPP;
}
string cmd;
if (!cmd_getval(cmdmap, "heapcmd", cmd)) {
- os << "unable to get value for command \"" << cmd << "\"";
+ erros << "unable to get value for command \"" << cmd << "\"";
return -EINVAL;
}
cmd_vec.push_back(val);
}
- ceph_heap_profiler_handle_command(cmd_vec, os);
+ ceph_heap_profiler_handle_command(cmd_vec, outos);
return 0;
}