diff --git a/cobc/codegen.c b/cobc/codegen.c index 07c74d615..4682ccda5 100644 --- a/cobc/codegen.c +++ b/cobc/codegen.c @@ -13728,26 +13728,28 @@ output_header (const char *locbuff, const struct cb_program *cp) static void output_cob_prof_data () { - struct cb_text_list *l = procedures_list; + if (cb_flag_prof) { + struct cb_text_list *l = procedures_list; - output_local ("/* cob_prof data */\n\n"); + output_local ("/* cob_prof data */\n\n"); - output_local ("#include \n\n"); + output_local ("#include \n\n"); - output_local ("static const char *procedures_names[%d] = {\n", procedures_list_len + 1); - while (l) { - output_local (" \"%s\",\n", l->text); - l = l->next; - } - output_local (" \"\""); - output_local ("};\n"); + output_local ("static const char *procedures_names[%d] = {\n", procedures_list_len + 1); + while (l) { + output_local (" \"%s\",\n", l->text); + l = l->next; + } + output_local (" \"\""); + output_local ("};\n"); - output_local ("static struct cobprof_info *prof_info;\n"); + output_local ("static struct cobprof_info *prof_info;\n"); - output_local ("\n/* End of cob_prof data */\n"); + output_local ("\n/* End of cob_prof data */\n"); - procedures_list = NULL; - procedures_list_len = 0; + procedures_list = NULL; + procedures_list_len = 0; + } } void @@ -14025,8 +14027,7 @@ codegen_internal (struct cb_program *prog, const int subsequent_call) output_local_base_cache (); output_local_field_cache (prog); - - if (cb_flag_prof) output_cob_prof_data (); + output_cob_prof_data (); /* Report data fields */ if (prog->report_storage) { diff --git a/libcob/common.c b/libcob/common.c index 4dc66f7db..56c9ad8a1 100644 --- a/libcob/common.c +++ b/libcob/common.c @@ -495,12 +495,10 @@ static struct config_tbl gc_conf[] = { {"COB_CORE_ON_ERROR", "core_on_error", "0", coeopts, GRP_MISC, ENV_UINT | ENV_ENUMVAL, SETPOS (cob_core_on_error)}, {"COB_CORE_FILENAME", "core_filename", "./core.libcob", NULL, GRP_MISC, ENV_STR, SETPOS (cob_core_filename)}, {"COB_DUMP_FILE", "dump_file", NULL, NULL, GRP_MISC, ENV_FILE, SETPOS (cob_dump_filename)}, - /* {"COB_PROF_FILE", "prof_file", NULL, NULL, GRP_MISC, ENV_FILE, SETPOS (cob_prof_filename)}, {"COB_PROF_DISABLE", "prof_disable", "0", NULL, GRP_MISC, ENV_BOOL, SETPOS (cob_prof_disable)}, {"COB_PROF_MAX_DEPTH", "prof_max_depth", "255", NULL, GRP_MISC, ENV_UINT, SETPOS (cob_prof_max_depth)}, {"COB_IS_RUNNING_IN_TESTMODE", "testsuite_mode", "0", NULL, GRP_MISC, ENV_BOOL, SETPOS (cob_testsuite_mode)}, - */ {"COB_DUMP_WIDTH", "dump_width", "100", NULL, GRP_MISC, ENV_UINT, SETPOS (cob_dump_width)}, #ifdef _WIN32 /* checked before configuration load if set from environment in cob_common_init() */ @@ -3021,7 +3019,7 @@ call_exit_handlers_and_terminate (void) h = h->next; } } - // Fabrice cob_prof_end(); + cob_prof_end(); cob_terminate_routines (); } @@ -10168,7 +10166,7 @@ cob_init (const int argc, char **argv) cob_init_numeric (cobglobptr); cob_init_strings (cobglobptr); cob_init_move (cobglobptr, cobsetptr); - // Fabrice cob_init_prof (cobglobptr, cobsetptr); + cob_init_prof (cobglobptr, cobsetptr); cob_init_intrinsic (cobglobptr); cob_init_fileio (cobglobptr, cobsetptr); cob_init_call (cobglobptr, cobsetptr, check_mainhandle);