Skip to content

Commit

Permalink
ibacm: add umad_debug_level setting
Browse files Browse the repository at this point in the history
libibumad debug information is helpful when trace ibacm MAD
with opensm debug log information.

Signed-off-by: Honggang Li <[email protected]>
  • Loading branch information
Honggang-LI committed Nov 30, 2020
1 parent cad63eb commit ea5593d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ibacm/src/acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ static const char *opts_file = ACM_CONF_DIR "/" ACM_OPTS_FILE;
static const char *addr_file = ACM_CONF_DIR "/" ACM_ADDR_FILE;
static char log_file[128] = IBACM_LOG_FILE;
static int log_level = 0;
static int umad_debug_level;
static char lock_file[128] = IBACM_PID_FILE;
static short server_port = 6125;
static int server_mode = IBACM_SERVER_MODE_DEFAULT;
Expand Down Expand Up @@ -3188,6 +3189,11 @@ static void acm_set_options(void)
strcpy(log_file, value);
else if (!strcasecmp("log_level", opt))
log_level = atoi(value);
else if (!strcasecmp("umad_debug_level", opt)) {
umad_debug_level = atoi(value);
if (umad_debug_level > 0)
umad_debug(umad_debug_level);
}
else if (!strcasecmp("lock_file", opt))
strcpy(lock_file, value);
else if (!strcasecmp("server_port", opt))
Expand Down Expand Up @@ -3229,6 +3235,7 @@ static void acm_log_options(void)

acm_log(0, "log file %s\n", log_file);
acm_log(0, "log level %d\n", log_level);
acm_log(0, "umad debug level %d\n", umad_debug_level);
acm_log(0, "lock file %s\n", lock_file);
acm_log(0, "server_port %d\n", server_port);
acm_log(0, "server_mode %s\n", server_mode_names[server_mode]);
Expand Down
8 changes: 8 additions & 0 deletions ibacm/src/acme.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ static void gen_opts_temp(FILE *f)
fprintf(f, "\n");
fprintf(f, "log_level 0\n");
fprintf(f, "\n");
fprintf(f, "# libibumad debug level:\n");
fprintf(f, "# Set the umad library internal debug level to level.\n");
fprintf(f, "# 0 - no debug (the default)\n");
fprintf(f, "# 1 - basic debug information\n");
fprintf(f, "# 2 - verbose debug information.\n");
fprintf(f, "\n");
fprintf(f, "umad_debug_level 0\n");
fprintf(f, "\n");
fprintf(f, "# lock_file:\n");
fprintf(f, "# Specifies the location of the ACM lock file used to ensure that only a\n");
fprintf(f, "# single instance of ACM is running.\n");
Expand Down

0 comments on commit ea5593d

Please sign in to comment.