#undef dout_prefix
#define dout_prefix *_dout
+// Commands shared between OSD's console and admin console:
+namespace ceph {
+namespace osd_cmds {
+
+int heap(CephContext& cct, cmdmap_t& cmdmap, Formatter& f, std::ostream& os);
+
+}} // namespace ceph::osd_cmds
+
int OSD::mkfs(CephContext *cct, ObjectStore *store, const string &dev,
uuid_d fsid, int whoami)
{
} else if (command == "get_latest_osdmap") {
get_latest_osdmap();
} else if (command == "heap") {
- auto result = ceph::osd_cmds::admin::heap(*cct, cmdmap, *f, ss);
+ auto result = ceph::osd_cmds::heap(*cct, cmdmap, *f, ss);
// Note: Failed heap profile commands won't necessarily trigger an error:
f->open_object_section("result");
}
else if (prefix == "heap") {
- if (!ceph_using_tcmalloc()) {
- r = -EOPNOTSUPP;
- ss << "could not issue heap profiler command -- not using tcmalloc!";
- } else {
- string heapcmd;
- cmd_getval(cct, cmdmap, "heapcmd", heapcmd);
- // XXX 1-element vector, change at callee or make vector here?
- vector<string> heapcmd_vec;
- get_str_vec(heapcmd, heapcmd_vec);
- ceph_heap_profiler_handle_command(heapcmd_vec, ds);
- }
+ r = ceph::osd_cmds::heap(*cct, cmdmap, *f, ds);
}
else if (prefix == "debug dump_missing") {
namespace ceph {
namespace osd_cmds {
-namespace admin {
int heap(CephContext& cct, cmdmap_t& cmdmap, Formatter& f, std::ostream& os)
{
return 0;
}
-}}} // namespace ceph::osd::admin_commands
+}} // namespace ceph::osd_cmds