Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/utils/dlck/dlck_args.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
/** all short options */
#define KEY_COMMON_OPTIONS 'o'
#define KEY_COMMON_WRITE_MODE 'w'
#define KEY_COMMON_VERBOSE 'v'
#define KEY_FILES 'f'
/** the options below follow the daos_engine options */
#define KEY_ENGINE_NUMA_NODE 'p'
Expand All @@ -47,6 +48,7 @@
struct dlck_args_common {
struct checker_options options;
bool write_mode; /** false by default (dry run) */
bool verbose; /** false by default */
};

/**
Expand Down
8 changes: 8 additions & 0 deletions src/utils/dlck/dlck_args_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ static struct argp_option args_common_options[] = {
LIST_ENTRY(DLCK_OPT_NON_ZERO_PADDING_STR "=EVENT",
"Action to take when non-zero padding or reserved fields are detected. EVENT can be "
"either 'error' or 'warning'. It is 'error' by default."),
/** this is expected to be necessary only while solving issues with the tool itself so it seems
to fit better with a different group */
{"verbose", KEY_COMMON_VERBOSE, 0, 0,
"Print DAOS log messages. All standard environment variables apply.", GROUP_AUTOMAGIC},
{0}};

enum dlck_options_values { DLCK_OPT_NON_ZERO_PADDING };
Expand All @@ -38,6 +42,7 @@ args_common_init(struct dlck_args_common *args)
memset(args, 0, sizeof(*args));
/** set defaults */
args->write_mode = false; /** dry run */
args->verbose = false;
args->options.cko_non_zero_padding = CHECKER_EVENT_WARNING;
}

Expand Down Expand Up @@ -87,6 +92,9 @@ args_common_parser(int key, char *arg, struct argp_state *state)
case KEY_COMMON_WRITE_MODE:
args->write_mode = true;
break;
case KEY_COMMON_VERBOSE:
args->verbose = true;
break;
case KEY_COMMON_OPTIONS:
rc = args_common_options_parse(arg, &args->options, state);
break;
Expand Down
11 changes: 11 additions & 0 deletions src/utils/dlck/dlck_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ main(int argc, char *argv[])

dlck_args_parse(argc, argv, &ctrl);

if (ctrl.common.verbose) {
rc = daos_debug_init_ex(DAOS_LOG_DEFAULT, DLOG_ERR);
if (rc != 0) {
goto err_args_free;
}
}

rc_abt = ABT_init(0, NULL);
if (rc_abt != ABT_SUCCESS) {
rc = dss_abterr2der(rc_abt);
Expand Down Expand Up @@ -78,6 +85,10 @@ main(int argc, char *argv[])
err_abt_fini:
(void)ABT_finalize();
err_args_free:
if (ctrl.common.verbose) {
daos_debug_fini();
}

dlck_args_free(&ctrl);
(void)d_fault_inject_fini();

Expand Down
Loading