30 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_BE 55 "Usage: m0betool [cmd] [path] [size]\n" 56 "where [cmd] is one from (without quotes):\n" 59 "- 'be_recovery_run'\n" 64 "Use case for 'st mkfs' and 'st run': run 'st mkfs' once to initialise \n" 65 "BE data structures, then run 'st run' and kill m0betool process during \n" 66 "'st run' execution. When 'st run' is called next time BE recovery will \n" 67 "replay BE log and 'st run' should be able to continue without any issues. \n" 68 "be_log_resize will create BE log file with custom size. \n" 69 "This is an ST for BE recovery.\n" 71 "'be_recovery_run' runs BE recovery.\n" 73 "'path' parameter is an optional path to BE domain stob domain location.\n" 74 "Default BE domain stob domain location is used when this parameter is absent:" 76 "'be_log_resize' create BE log file without mkfs.\n" 78 "'path' and 'size' mandatory arguments for be_log_resize. 'size' in bytes. \n" 79 "Usage: m0betool be_log_resize <path> <size> \n" 96 "cd_object_index btree = %p " 97 "cd_namespace btree = %p " 98 "cd_fileattr_basic btree = %p " 99 "cd_fileattr_omg btree = %p " 100 "cd_fileattr_ea btree = %p",
124 "cb_db_group_extents btree= %p " 125 "cb_db_group_desc btree= %p",
153 "objtype = %p seg = %p",
182 "linuxstob:%s", path);
204 "linuxstob:%s", path);
217 static void scan(
char *path,
char *what)
230 "linuxstob:./%s", path);
245 int main(
int argc,
char *argv[])
251 if (argc > 1 &&
m0_streq(argv[1],
"be_recovery_run")) {
252 path = argc > 2 ? argv[2] :
NULL;
257 if (argc > 1 &&
m0_streq(argv[1],
"be_log_resize")) {
269 if (errno == ERANGE || ((
size == 0) && (errno != 0))) {
277 if (argc > 1 && (
m0_streq(argv[1],
"track_btree") ||
278 m0_streq(argv[1],
"print_btree"))) {
279 path = argc > 2 ? argv[2] :
NULL;
284 if (argc == 3 &&
m0_streq(argv[1],
"st") &&
294 printf(
"bc_stob_domain_location=%s\n",
302 #undef M0_TRACE_SUBSYSTEM static void scan(char *path, char *what)
struct m0_be_btree cb_db_group_desc
M0_INTERNAL int m0_be_ut_backend_init_cfg(struct m0_be_ut_backend *ut_be, const struct m0_be_domain_cfg *cfg, bool mkfs)
struct m0_be_btree cd_object_index
int m0_betool_st_mkfs(void)
#define M0_LOG(level,...)
struct m0_be_btree cb_db_group_extents
void track_cob_btrees(struct m0_cob_domain *cdom, bool print_btree)
static int be_log_resize(char *path, uint64_t size)
M0_INTERNAL struct m0_be_seg * m0_be_domain_seg0_get(struct m0_be_domain *dom)
M0_TL_DEFINE(zt, M0_EXTERN, struct m0_be_0type)
#define container_of(ptr, type, member)
struct m0_be_btree cd_fileattr_basic
struct m0_be_btree cd_fileattr_ea
static void be_recovery_run(char *path)
struct m0_ad_balloc * sad_ballroom
struct m0_be_log_store_cfg lc_store_cfg
void m0_be_ut_backend_cfg_default(struct m0_be_domain_cfg *cfg)
struct m0_be_ut_backend ut_be
M0_INTERNAL void btree_dbg_print(struct m0_be_btree *tree)
void m0_betool_m0_fini(void)
void m0_node_uuid_string_set(const char *uuid)
static struct m0_stob_domain * dom
int m0_betool_st_run(void)
struct m0_ad_balloc cb_ballroom
struct m0_be_domain but_dom
struct m0_be_btree em_mapping
struct m0_be_emap sad_adata
M0_INTERNAL int m0_be_ut_backend_log_resize(struct m0_be_ut_backend *ut_be, const struct m0_be_domain_cfg *cfg)
struct m0_stob_ad_domain * sa0_ad_domain
const char * bc_stob_domain_location
void track_ad_btrees(struct stob_ad_0type_rec *rec, bool print_btree)
void m0_be_ut_backend_fini(struct m0_be_ut_backend *ut_be)
static const char * betool_help
struct m0_be_log_cfg bc_log
static struct m0_be_seg * seg
#define M0_ASSERT_INFO(cond, fmt,...)
int main(int argc, char *argv[])
M0_INTERNAL int m0_be_segobj_opt_next(struct m0_be_seg *dict, const struct m0_be_0type *objtype, struct m0_buf *opt, char **suffix)
void m0_betool_m0_init(void)
static void scan_btree(struct m0_be_domain *dom, bool print_btree)
struct m0_be_btree cd_fileattr_omg
#define m0_tl_for(name, head, obj)
M0_INTERNAL int m0_be_segobj_opt_begin(struct m0_be_seg *dict, const struct m0_be_0type *objtype, struct m0_buf *opt, char **suffix)
struct m0_be_btree cd_namespace
M0_TL_DESCR_DECLARE(zt, M0_EXTERN)