From 14f6597c1f9cf5ecfd48d0ef620d03c709f00d74 Mon Sep 17 00:00:00 2001 From: "JunSeok, Kim" Date: Thu, 14 Sep 2017 16:20:28 +0900 Subject: [PATCH] ESTART: add T-trace log at ESTART log Change-Id: I751928cea19d97d4d78ea8a08b111fa96fb27291 --- src/bin/e.h | 4 +- src/bin/e_comp.c | 25 ++-- src/bin/e_comp_screen.c | 47 ++++---- src/bin/e_comp_wl.c | 4 +- src/bin/e_main.c | 315 +++++++++++++++++++++++++++--------------------- src/bin/e_module.c | 10 +- 6 files changed, 224 insertions(+), 181 deletions(-) diff --git a/src/bin/e.h b/src/bin/e.h index e63d874..18d5f94 100644 --- a/src/bin/e.h +++ b/src/bin/e.h @@ -106,7 +106,7 @@ void *alloca (size_t); # define TRACE_DS_END() traceEnd(TTRACE_TAG_WINDOW_MANAGER) # define TRACE_DS_ASYNC_BEGIN(KEY, NAME, ...) traceAsyncBegin(TTRACE_TAG_WINDOW_MANAGER, KEY, "DS:"#NAME, ##__VA_ARGS__) # define TRACE_DS_ASYNC_END(KEY, NAME, ...) traceAsyncEnd(TTRACE_TAG_WINDOW_MANAGER, KEY, "DS:"#NAME, ##__VA_ARGS__) -# define TRACE_DS_MARK(NAME, ...) traceBegin(TTRACE_TAG_WINDOW_MANAGER, "DS:"#NAME, ##__VA_ARGS__) +# define TRACE_DS_MARK(NAME, ...) traceMark(TTRACE_TAG_WINDOW_MANAGER, "DS:"#NAME, ##__VA_ARGS__) # define TRACE_INPUT_BEGIN(NAME, ...) traceBegin(TTRACE_TAG_INPUT, "INPUT:SERVER:"#NAME, ##__VA_ARGS__) # define TRACE_INPUT_END() traceEnd(TTRACE_TAG_INPUT) # else @@ -312,6 +312,8 @@ typedef struct _E_Rect E_Rect; # include "e_includes.h" E_API double e_main_ts(const char *str); +E_API double e_main_ts_begin(const char *str); +E_API double e_main_ts_end(const char *str); struct _E_Rect { diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c index 7ee3d8b..b449544 100644 --- a/src/bin/e_comp.c +++ b/src/bin/e_comp.c @@ -1465,19 +1465,19 @@ e_comp_init(void) ignores = eina_hash_pointer_new(NULL); - e_main_ts("\tE_Comp_Data Init"); + e_main_ts_begin("\tE_Comp_Data Init"); e_comp_cfdata_edd_init(&conf_edd, &conf_match_edd); - e_main_ts("\tE_Comp_Data Init Done"); + e_main_ts_end("\tE_Comp_Data Init Done"); - e_main_ts("\tE_Comp_Data Load"); + e_main_ts_begin("\tE_Comp_Data Load"); conf = e_config_domain_load("e_comp", conf_edd); - e_main_ts("\tE_Comp_Data Load Done"); + e_main_ts_end("\tE_Comp_Data Load Done"); if (!conf) { - e_main_ts("\tE_Comp_Data New"); + e_main_ts_begin("\tE_Comp_Data New"); conf = e_comp_cfdata_config_new(); - e_main_ts("\tE_Comp_Data New Done"); + e_main_ts_end("\tE_Comp_Data New Done"); } // comp config versioning - add this in. over time add epochs etc. if @@ -1501,15 +1501,16 @@ e_comp_init(void) if (conf->hwc_ignore_primary) e_comp->hwc_ignore_primary = EINA_TRUE; - e_main_ts("\tE_Comp_Screen Init"); + e_main_ts_begin("\tE_Comp_Screen Init"); if (!e_comp_screen_init()) { + e_main_ts_end("\tE_Comp_Screen Init Failed"); ERR("Fail to init e_comp_screen"); e_object_del(E_OBJECT(e_comp)); E_FREE_FUNC(ignores, eina_hash_free); return EINA_FALSE; } - e_main_ts("\tE_Comp_Screen Init Done"); + e_main_ts_end("\tE_Comp_Screen Init Done"); e_comp->comp_type = E_PIXMAP_TYPE_WL; @@ -1596,16 +1597,16 @@ E_API void e_comp_deferred_job(void) { /* Bg update */ - e_main_ts("\tE_BG_Zone Update"); + e_main_ts_begin("\tE_BG_Zone Update"); if (e_zone_current_get()->bg_object) e_bg_zone_update(e_zone_current_get(), E_BG_TRANSITION_DESK); else e_bg_zone_update(e_zone_current_get(), E_BG_TRANSITION_START); - e_main_ts("\tE_BG_Zone Update Done"); + e_main_ts_end("\tE_BG_Zone Update Done"); - e_main_ts("\tE_Comp_Wl_Deferred"); + e_main_ts_begin("\tE_Comp_Wl_Deferred"); e_comp_wl_deferred_job(); - e_main_ts("\tE_Comp_Wl_Deferred Done"); + e_main_ts_end("\tE_Comp_Wl_Deferred Done"); } E_API void diff --git a/src/bin/e_comp_screen.c b/src/bin/e_comp_screen.c index 6aeec10..ca54928 100644 --- a/src/bin/e_comp_screen.c +++ b/src/bin/e_comp_screen.c @@ -719,14 +719,15 @@ _e_comp_screen_engine_init(void) e_comp->e_comp_screen = e_comp_screen; e_comp_screen->rotation = screen_rotation; - e_main_ts("\tE_Outputs Init"); + e_main_ts_begin("\tE_Outputs Init"); if (!_e_comp_screen_init_outputs(e_comp_screen)) { + e_main_ts_end("\tE_Outputs Init Failed"); e_error_message_show(_("Enlightenment cannot initialize outputs!\n")); _e_comp_screen_engine_deinit(); return EINA_FALSE; } - e_main_ts("\tE_Outputs Init Done"); + e_main_ts_end("\tE_Outputs Init Done"); /* get the primary output */ output = e_comp_screen_primary_output_get(e_comp_screen); @@ -760,10 +761,10 @@ _e_comp_screen_engine_init(void) if ((e_comp_gl_get()) && (e_comp_config_get()->engine == E_COMP_ENGINE_GL)) { - e_main_ts("\tEE_GL_DRM New"); + e_main_ts_begin("\tEE_GL_DRM New"); e_comp->ee = ecore_evas_gl_drm_new(NULL, 0, 0, 0, scr_w, scr_h); snprintf(buf, sizeof(buf), "\tEE_GL_DRM New Done %p %dx%d", e_comp->ee, scr_w, scr_h); - e_main_ts(buf); + e_main_ts_end(buf); if (!e_comp->ee) e_comp_gl_set(EINA_FALSE); @@ -772,7 +773,7 @@ _e_comp_screen_engine_init(void) Evas_GL *evasgl = NULL; Evas_GL_API *glapi = NULL; - e_main_ts("\tEvas_GL New"); + e_main_ts_begin("\tEvas_GL New"); evasgl = evas_gl_new(ecore_evas_get(e_comp->ee)); if (evasgl) { @@ -782,11 +783,11 @@ _e_comp_screen_engine_init(void) e_comp_gl_set(EINA_FALSE); ecore_evas_free(e_comp->ee); e_comp->ee = NULL; - e_main_ts("\tEvas_GL New Failed 1"); + e_main_ts_end("\tEvas_GL New Failed 1"); } else { - e_main_ts("\tEvas_GL New Done"); + e_main_ts_end("\tEvas_GL New Done"); } } else @@ -794,7 +795,7 @@ _e_comp_screen_engine_init(void) e_comp_gl_set(EINA_FALSE); ecore_evas_free(e_comp->ee); e_comp->ee = NULL; - e_main_ts("\tEvas_GL New Failed 2"); + e_main_ts_end("\tEvas_GL New Failed 2"); } evas_gl_free(evasgl); } @@ -803,10 +804,10 @@ _e_comp_screen_engine_init(void) /* fallback to framebuffer drm (non-accel) */ if (!e_comp->ee) { - e_main_ts("\tEE_DRM New"); + e_main_ts_begin("\tEE_DRM New"); e_comp->ee = ecore_evas_drm_new(NULL, 0, 0, 0, scr_w, scr_h); snprintf(buf, sizeof(buf), "\tEE_DRM New Done %p %dx%d", e_comp->ee, scr_w, scr_h); - e_main_ts(buf); + e_main_ts_end(buf); } if (!e_comp->ee) @@ -1008,9 +1009,9 @@ e_comp_screen_init() if (e_config->xkb.use_cache && !dont_use_xkb_cache) { - e_main_ts("\tDRM Keymap Init"); + e_main_ts_begin("\tDRM Keymap Init"); _e_comp_screen_keymap_set(&ctx, &map); - e_main_ts("\tDRM Keymap Init Done"); + e_main_ts_end("\tDRM Keymap Init Done"); } if (!_e_comp_screen_engine_init()) @@ -1019,24 +1020,24 @@ e_comp_screen_init() goto failed_comp_screen; } - e_main_ts("\tE_Comp_Wl Init"); + e_main_ts_begin("\tE_Comp_Wl Init"); if (!e_comp_wl_init()) { - goto failed_comp_screen; + goto failed_comp_screen_with_ts; } - e_main_ts("\tE_Comp_Wl Init Done"); + e_main_ts_end("\tE_Comp_Wl Init Done"); /* get the current screen geometry */ ecore_evas_screen_geometry_get(e_comp->ee, NULL, NULL, &w, &h); /* canvas */ - e_main_ts("\tE_Comp_Canvas Init"); + e_main_ts_begin("\tE_Comp_Canvas Init"); if (!e_comp_canvas_init(w, h)) { e_error_message_show(_("Enlightenment cannot initialize outputs!\n")); - goto failed_comp_screen; + goto failed_comp_screen_with_ts; } - e_main_ts("\tE_Comp_Canvas Init Done"); + e_main_ts_end("\tE_Comp_Canvas Init Done"); /* pointer */ ecore_evas_pointer_xy_get(e_comp->ee, @@ -1045,12 +1046,12 @@ e_comp_screen_init() evas_event_feed_mouse_in(e_comp->evas, 0, NULL); - e_main_ts("\tE_Pointer New"); + e_main_ts_begin("\tE_Pointer New"); if ((comp->pointer = e_pointer_canvas_new(comp->ee, EINA_TRUE))) { e_pointer_hide(comp->pointer); } - e_main_ts("\tE_Pointer New Done"); + e_main_ts_end("\tE_Pointer New Done"); /* FIXME: We need a way to trap for user changing the keymap inside of E * without the event coming from X11 */ @@ -1062,14 +1063,14 @@ e_comp_screen_init() /* FIXME: This is just for testing at the moment.... * happens to jive with what drm does */ - e_main_ts("\tE_Comp_WL Keymap Init"); + e_main_ts_begin("\tE_Comp_WL Keymap Init"); e_comp_wl_input_keymap_set(e_comp_wl_input_keymap_default_rules_get(), e_comp_wl_input_keymap_default_model_get(), e_comp_wl_input_keymap_default_layout_get(), e_comp_wl_input_keymap_default_variant_get(), e_comp_wl_input_keymap_default_options_get(), ctx, map); - e_main_ts("\tE_Comp_WL Keymap Init Done"); + e_main_ts_end("\tE_Comp_WL Keymap Init Done"); /* try to add tizen_video to wayland globals */ if (!wl_global_create(e_comp_wl->wl.disp, &tizen_screen_rotation_interface, 1, @@ -1104,6 +1105,8 @@ e_comp_screen_init() return EINA_TRUE; +failed_comp_screen_with_ts: + e_main_ts_end("\tE_Comp_Screen init failed"); failed_comp_screen: _e_comp_screen_engine_deinit(); diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index b251d96..70e534a 100755 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -4444,7 +4444,7 @@ _e_comp_wl_gl_init(void *data EINA_UNUSED) if (!e_comp_gl_get()) return; /* create dummy evas gl to bind wayland display of enlightenment to egl display */ - e_main_ts("\tE_Comp_Wl_GL Init"); + e_main_ts_begin("\tE_Comp_Wl_GL Init"); /* if wl_drm module doesn't call e_comp_canvas_init yet, * then we should get evas from ecore_evas. @@ -4486,7 +4486,7 @@ _e_comp_wl_gl_init(void *data EINA_UNUSED) /* for native surface */ e_comp->gl = 1; - e_main_ts("\tE_Comp_Wl_GL Init Done"); + e_main_ts_end("\tE_Comp_Wl_GL Init Done"); return; diff --git a/src/bin/e_main.c b/src/bin/e_main.c index de70f39..d5a38ba 100644 --- a/src/bin/e_main.c +++ b/src/bin/e_main.c @@ -16,9 +16,28 @@ printf("ESTART: %1.5f [%1.5f] - %s\n", t1 - t0, t1 - t2, x); \ t2 = t1; \ } + +# define TSB(x) \ + do { \ + TRACE_DS_BEGIN(ESTART: %s, x); \ + TS(x); \ + } while (0) +# define TSE(x) \ + do { \ + TRACE_DS_END(); \ + TS(x); \ + } while (0) +# define TSM(x) \ + do { \ + TRACE_DS_MARK(ESTART: %s, x); \ + TS(x); \ + } while (0) static double t0, t1, t2; #else # define TS(x) +# define TSB(x) +# define TSE(x) +# define TSM(x) #endif /* * i need to make more use of these when i'm baffled as to when something is @@ -224,82 +243,79 @@ _e_main_subsystem_defer(void *data EINA_UNUSED) TRACE_DS_BEGIN(MAIN:DEFERRED INTERNAL SUBSYSTEMS INIT); - TS("[DEFERRED] DPMS Init"); + TSB("[DEFERRED] DPMS Init"); if (!e_dpms_init()) { e_error_message_show(_("Enlightenment cannot set up dpms.\n")); - _e_main_shutdown(-1); + goto failed; } - TS("[DEFERRED] DPMS Init Done"); + TSE("[DEFERRED] DPMS Init Done"); _e_main_shutdown_push(e_dpms_shutdown); - TS("[DEFERRED] Screens Init: win"); + TSB("[DEFERRED] Screens Init: win"); if (!e_win_init()) { e_error_message_show(_("Enlightenment cannot setup elementary trap!\n")); - TRACE_DS_END(); - _e_main_shutdown(-1); + goto failed; } - TS("[DEFERRED] Screens Init: win Done"); + TSE("[DEFERRED] Screens Init: win Done"); - TS("[DEFERRED] E_Dnd Init"); + TSB("[DEFERRED] E_Dnd Init"); if (!e_dnd_init()) { e_error_message_show(_("Enlightenment cannot set up its dnd system.\n")); - _e_main_shutdown(-1); + goto failed; } - TS("[DEFERRED] E_Dnd Init Done"); + TSE("[DEFERRED] E_Dnd Init Done"); _e_main_shutdown_push(e_dnd_shutdown); - TS("[DEFERRED] E_Scale Init"); + TSB("[DEFERRED] E_Scale Init"); if (!e_scale_init()) { e_error_message_show(_("Enlightenment cannot set up its scale system.\n")); - TRACE_DS_END(); - _e_main_shutdown(-1); + goto failed; } - TS("[DEFERRED] E_Scale Init Done"); + TSE("[DEFERRED] E_Scale Init Done"); _e_main_shutdown_push(e_scale_shutdown); - TS("[DEFERRED] E_Test_Helper Init"); + TSB("[DEFERRED] E_Test_Helper Init"); e_test_helper_init(); _e_main_shutdown_push(e_test_helper_shutdown); - TS("[DEFERRED] E_Test_Helper Done"); + TSE("[DEFERRED] E_Test_Helper Done"); - TS("[DEFERRED] E_INFO_SERVER Init"); + TSB("[DEFERRED] E_INFO_SERVER Init"); e_info_server_init(); _e_main_shutdown_push(e_info_server_shutdown); - TS("[DEFERRED] E_INFO_SERVER Done"); + TSE("[DEFERRED] E_INFO_SERVER Done"); TRACE_DS_END(); TRACE_DS_BEGIN(MAIN:DEFERRED COMP JOB); /* try to do deferred job of any subsystems*/ - TS("[DEFERRED] Compositor's deferred job"); + TSB("[DEFERRED] Compositor's deferred job"); e_comp_deferred_job(); - TS("[DEFERRED] Compositor's deferred job Done"); + TSE("[DEFERRED] Compositor's deferred job Done"); - TRACE_DS_END(); if (e_config->use_e_policy) { - TRACE_DS_BEGIN(MAIN:DEFERRED POLICY JOB); - - TS("[DEFERRED] E_Policy's deferred job"); + TSB("[DEFERRED] E_Policy's deferred job"); e_policy_deferred_job(); - TS("[DEFERRED] E_Policy's deferred job Done"); - - TRACE_DS_END(); + TSE("[DEFERRED] E_Policy's deferred job Done"); } - TRACE_DS_BEGIN(MAIN:DEFERRED MODULE JOB); - TS("[DEFERRED] E_Module's deferred job"); + TSB("[DEFERRED] E_Module's deferred job"); e_module_deferred_job(); - TS("[DEFERRED] E_Module's deferred job Done"); + TSE("[DEFERRED] E_Module's deferred job Done"); TRACE_DS_END(); TRACE_DS_END(); - return ECORE_CALLBACK_DONE; + +failed: + TSE("INIT FAILED"); + TRACE_DS_END(); + TRACE_DS_END(); + _e_main_shutdown(-1); } static Eina_Bool @@ -331,7 +347,7 @@ main(int argc, char **argv) printf("ESTART(main) %1.5f\n", t0); #endif TRACE_DS_BEGIN(MAIN:BEGIN STARTUP); - TS("Begin Startup"); + TSB("Begin Startup"); PRCTL("[Winsys] start of main"); /* trap deadly bug signals and allow some form of sane recovery */ @@ -344,7 +360,7 @@ main(int argc, char **argv) /* handler will not function properly */ if (!getenv("NOTIFY_SOCKET")) { - TS("Signal Trap"); + TSB("Signal Trap"); action.sa_sigaction = e_sigseg_act; action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO; sigemptyset(&action.sa_mask); @@ -364,7 +380,7 @@ main(int argc, char **argv) action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO; sigemptyset(&action.sa_mask); sigaction(SIGABRT, &action, NULL); - TS("Signal Trap Done"); + TSE("Signal Trap Done"); } t = ecore_time_unix_get(); @@ -380,31 +396,31 @@ main(int argc, char **argv) if (getenv("E_START_MTRACK")) e_util_env_set("MTRACK", NULL); - TS("Eina Init"); + TSB("Eina Init"); if (!eina_init()) { e_error_message_show(_("Enlightenment cannot initialize Eina!\n")); - _e_main_shutdown(-1); + goto failed; } - TS("Eina Init Done"); + TSE("Eina Init Done"); _e_main_shutdown_push(eina_shutdown); #ifdef OBJECT_HASH_CHECK - TS("E_Object Hash Init"); + TSB("E_Object Hash Init"); e_object_hash_init(); - TS("E_Object Hash Init Done"); + TSE("E_Object Hash Init Done"); #endif - TS("E_Log Init"); + TSB("E_Log Init"); if (!e_log_init()) { e_error_message_show(_("Enlightenment could not create a logging domain!\n")); - _e_main_shutdown(-1); + goto failed; } - TS("E_Log Init Done"); + TSE("E_Log Init Done"); _e_main_shutdown_push(e_log_shutdown); - TS("Determine Prefix"); + TSB("Determine Prefix"); if (!e_prefix_determine(argv[0])) { fprintf(stderr, @@ -413,24 +429,24 @@ main(int argc, char **argv) " This is because it is not on Linux AND has been\n" " executed strangely. This is unusual.\n"); } - TS("Determine Prefix Done"); + TSE("Determine Prefix Done"); /* for debugging by redirecting stdout of e to a log file to tail */ setvbuf(stdout, NULL, _IONBF, 0); - TS("Parse Arguments"); + TSB("Parse Arguments"); _e_main_parse_arguments(argc, argv); - TS("Parse Arguments Done"); + TSE("Parse Arguments Done"); /*** Initialize Core EFL Libraries We Need ***/ - TS("Eet Init"); + TSB("Eet Init"); if (!eet_init()) { e_error_message_show(_("Enlightenment cannot initialize Eet!\n")); - _e_main_shutdown(-1); + goto failed; } - TS("Eet Init Done"); + TSE("Eet Init Done"); _e_main_shutdown_push(eet_shutdown); /* Allow ecore to not load system modules. @@ -439,13 +455,13 @@ main(int argc, char **argv) */ ecore_app_no_system_modules(); - TS("Ecore Init"); + TSB("Ecore Init"); if (!ecore_init()) { e_error_message_show(_("Enlightenment cannot initialize Ecore!\n")); - _e_main_shutdown(-1); + goto failed; } - TS("Ecore Init Done"); + TSE("Ecore Init Done"); _e_main_shutdown_push(ecore_shutdown); e_first_frame = getenv("E_FIRST_FRAME"); @@ -454,137 +470,137 @@ main(int argc, char **argv) else e_first_frame = NULL; - TS("EIO Init"); + TSB("EIO Init"); if (!eio_init()) { e_error_message_show(_("Enlightenment cannot initialize EIO!\n")); - _e_main_shutdown(-1); + goto failed; } - TS("EIO Init Done"); + TSE("EIO Init Done"); _e_main_shutdown_push(eio_shutdown); ecore_app_args_set(argc, (const char **)argv); - TS("Ecore Event Handlers"); + TSB("Ecore Event Handlers"); if (!ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _e_main_cb_signal_exit, NULL)) { e_error_message_show(_("Enlightenment cannot set up an exit signal handler.\n" "Perhaps you are out of memory?")); - _e_main_shutdown(-1); + goto failed; } if (!ecore_event_handler_add(ECORE_EVENT_SIGNAL_HUP, _e_main_cb_signal_hup, NULL)) { e_error_message_show(_("Enlightenment cannot set up a HUP signal handler.\n" "Perhaps you are out of memory?")); - _e_main_shutdown(-1); + goto failed; } if (!ecore_event_handler_add(ECORE_EVENT_SIGNAL_USER, _e_main_cb_signal_user, NULL)) { e_error_message_show(_("Enlightenment cannot set up a USER signal handler.\n" "Perhaps you are out of memory?")); - _e_main_shutdown(-1); + goto failed; } - TS("Ecore Event Handlers Done"); + TSE("Ecore Event Handlers Done"); - TS("Ecore_File Init"); + TSB("Ecore_File Init"); if (!ecore_file_init()) { e_error_message_show(_("Enlightenment cannot initialize Ecore_File!\n")); - _e_main_shutdown(-1); + goto failed; } - TS("Ecore_File Init Done"); + TSE("Ecore_File Init Done"); _e_main_shutdown_push(ecore_file_shutdown); _idle_before = ecore_idle_enterer_before_add(_e_main_cb_idle_before, NULL); - TS("XDG_DATA_DIRS Init"); + TSB("XDG_DATA_DIRS Init"); _xdg_data_dirs_augment(); - TS("XDG_DATA_DIRS Init Done"); + TSE("XDG_DATA_DIRS Init Done"); - TS("Ecore_Evas Init"); + TSB("Ecore_Evas Init"); if (!ecore_evas_init()) { e_error_message_show(_("Enlightenment cannot initialize Ecore_Evas!\n")); - _e_main_shutdown(-1); + goto failed; } - TS("Ecore_Evas Init Done"); + TSE("Ecore_Evas Init Done"); /* e doesn't sync to compositor - it should be one */ ecore_evas_app_comp_sync_set(0); - TS("Edje Init"); + TSB("Edje Init"); if (!edje_init()) { e_error_message_show(_("Enlightenment cannot initialize Edje!\n")); - _e_main_shutdown(-1); + goto failed; } - TS("Edje Init Done"); + TSE("Edje Init Done"); _e_main_shutdown_push(edje_shutdown); /*** Initialize E Subsystems We Need ***/ - TS("E Directories Init"); + TSB("E Directories Init"); /* setup directories we will be using for configurations storage etc. */ if (!_e_main_dirs_init()) { e_error_message_show(_("Enlightenment cannot create directories in your home directory.\n" "Perhaps you have no home directory or the disk is full?")); - _e_main_shutdown(-1); + goto failed; } - TS("E Directories Init Done"); + TSE("E Directories Init Done"); _e_main_shutdown_push(_e_main_dirs_shutdown); - TS("E_Config Init"); + TSB("E_Config Init"); if (!e_config_init()) { e_error_message_show(_("Enlightenment cannot set up its config system.\n")); - _e_main_shutdown(-1); + goto failed; } - TS("E_Config Init Done"); + TSE("E_Config Init Done"); _e_main_shutdown_push(e_config_shutdown); - TS("E_Env Init"); + TSB("E_Env Init"); if (!e_env_init()) { e_error_message_show(_("Enlightenment cannot set up its environment.\n")); - _e_main_shutdown(-1); + goto failed; } - TS("E_Env Init Done"); + TSE("E_Env Init Done"); _e_main_shutdown_push(e_env_shutdown); ecore_exe_run_priority_set(e_config->priority); - TS("E Paths Init"); + TSB("E Paths Init"); if (!_e_main_path_init()) { e_error_message_show(_("Enlightenment cannot set up paths for finding files.\n" "Perhaps you are out of memory?")); - _e_main_shutdown(-1); + goto failed; } - TS("E Paths Init Done"); + TSE("E Paths Init Done"); _e_main_shutdown_push(_e_main_path_shutdown); ecore_animator_frametime_set(1.0 / e_config->framerate); - TS("E_Theme Init"); + TSB("E_Theme Init"); if (!e_theme_init()) { e_error_message_show(_("Enlightenment cannot set up its theme system.\n")); - _e_main_shutdown(-1); + goto failed; } - TS("E_Theme Init Done"); + TSE("E_Theme Init Done"); _e_main_shutdown_push(e_theme_shutdown); - TS("E_Actions Init"); + TSB("E_Actions Init"); if (!e_actions_init()) { e_error_message_show(_("Enlightenment cannot set up its actions system.\n")); - _e_main_shutdown(-1); + goto failed; } - TS("E_Actions Init Done"); + TSE("E_Actions Init Done"); _e_main_shutdown_push(e_actions_shutdown); /* these just add event handlers and can't fail @@ -608,59 +624,59 @@ main(int argc, char **argv) } TRACE_DS_END(); - TS("E_Pointer Init"); + TSB("E_Pointer Init"); if (!e_pointer_init()) { e_error_message_show(_("Enlightenment cannot set up its pointer system.\n")); - _e_main_shutdown(-1); + goto failed; } - TS("E_Pointer Init Done"); + TSE("E_Pointer Init Done"); _e_main_shutdown_push(e_pointer_shutdown); TRACE_DS_BEGIN(MAIN:SCREEN INIT); - TS("Screens Init"); + TSB("Screens Init"); if (!_e_main_screens_init()) { e_error_message_show(_("Enlightenment set up window management for all the screens on your system\n" "failed. Perhaps another window manager is running?\n")); - _e_main_shutdown(-1); + goto failed; } - TS("Screens Init Done"); + TSE("Screens Init Done"); _e_main_shutdown_push(_e_main_screens_shutdown); TRACE_DS_END(); if (e_config->eom_enable) { - TS("Eom Init"); + TSB("Eom Init"); if (!e_eom_init()) { e_error_message_show(_("Enlightenment cannot set up eom.\n")); - _e_main_shutdown(-1); + goto failed; } - TS("Eom Init Done"); + TSE("Eom Init Done"); _e_main_shutdown_push(e_eom_shutdown); } - TS("E_Screensaver Init"); + TSB("E_Screensaver Init"); if (!e_screensaver_init()) { e_error_message_show(_("Enlightenment cannot configure the X screensaver.\n")); - _e_main_shutdown(-1); + goto failed; } - TS("E_Screensaver Init Done"); + TSE("E_Screensaver Init Done"); _e_main_shutdown_push(e_screensaver_shutdown); - TS("E_Comp Freeze"); + TSB("E_Comp Freeze"); e_comp_all_freeze(); - TS("E_Comp Freeze Done"); + TSE("E_Comp Freeze Done"); - TS("E_Grabinput Init"); + TSB("E_Grabinput Init"); if (!e_grabinput_init()) { e_error_message_show(_("Enlightenment cannot set up its grab input handling system.\n")); - _e_main_shutdown(-1); + goto failed; } - TS("E_Grabinput Init Done"); + TSE("E_Grabinput Init Done"); _e_main_shutdown_push(e_grabinput_shutdown); TS("E_Gesture Init"); @@ -669,69 +685,69 @@ main(int argc, char **argv) ecore_event_handler_add(E_EVENT_MODULE_INIT_END, _e_main_deferred_job_schedule, NULL); - TS("E_Module Init"); + TSB("E_Module Init"); if (!e_module_init()) { e_error_message_show(_("Enlightenment cannot set up its module system.\n")); - _e_main_shutdown(-1); + goto failed; } - TS("E_Module Init Done"); + TSE("E_Module Init Done"); _e_main_shutdown_push(e_module_shutdown); - TS("E_Mouse Init"); + TSB("E_Mouse Init"); if (!e_mouse_update()) { e_error_message_show(_("Enlightenment cannot configure the mouse settings.\n")); - _e_main_shutdown(-1); + goto failed; } - TS("E_Mouse Init Done"); + TSE("E_Mouse Init Done"); - TS("E_Icon Init"); + TSB("E_Icon Init"); if (!e_icon_init()) { e_error_message_show(_("Enlightenment cannot initialize the Icon Cache system.\n")); - _e_main_shutdown(-1); + goto failed; } - TS("E_Icon Init Done"); + TSE("E_Icon Init Done"); _e_main_shutdown_push(e_icon_shutdown); if (e_config->use_e_policy) { - TS("E_Policy Init"); + TSB("E_Policy Init"); if (!e_policy_init()) { e_error_message_show(_("Enlightenment cannot setup policy system!\n")); - _e_main_shutdown(-1); + goto failed; } - TS("E_Policy Init Done"); + TSE("E_Policy Init Done"); _e_main_shutdown_push(e_policy_shutdown); } - TS("E_Process Init"); + TSB("E_Process Init"); if (!e_process_init()) { e_error_message_show(_("Enlightenment cannot setup process managing system!\n")); - _e_main_shutdown(-1); + goto failed; } - TS("E_Process Init Done"); + TSE("E_Process Init Done"); _e_main_shutdown_push(e_process_shutdown); - TS("E_Security Init"); + TSB("E_Security Init"); if (!e_security_init()) { e_error_message_show(_("Enlightenment cannot setup security system!\n")); - _e_main_shutdown(-1); + goto failed; } - TS("E_Security Init Done"); + TSE("E_Security Init Done"); _e_main_shutdown_push(e_security_shutdown); - TS("Load Modules"); + TSB("Load Modules"); _e_main_modules_load(safe_mode); - TS("Load Modules Done"); + TSE("Load Modules Done"); - TS("E_Comp Thaw"); + TSB("E_Comp Thaw"); e_comp_all_thaw(); - TS("E_Comp Thaw Done"); + TSE("E_Comp Thaw Done"); _idle_after = ecore_idle_enterer_add(_e_main_cb_idle_after, NULL); @@ -740,7 +756,7 @@ main(int argc, char **argv) e_util_env_set("E_RESTART", "1"); - TS("MAIN LOOP AT LAST"); + TSM("MAIN LOOP AT LAST"); if (e_config->create_wm_ready) _e_main_create_wm_ready(); @@ -748,10 +764,10 @@ main(int argc, char **argv) TRACE_DS_END(); #ifdef HAVE_SYSTEMD - TS("[WM] Send start-up completion"); + TSM("[WM] Send start-up completion"); sd_notify(0, "READY=1"); #else - TS("[WM] Skip sending start-up completion. (no systemd)"); + TSM("[WM] Skip sending start-up completion. (no systemd)"); #endif ecore_main_loop_begin(); @@ -776,6 +792,11 @@ main(int argc, char **argv) e_prefix_shutdown(); return 0; + +failed: + TSE("INIT FAILED"); + TRACE_DS_END(); + _e_main_shutdown(-1); } E_API double @@ -789,6 +810,20 @@ e_main_ts(const char *str) return ret; } +E_API double +e_main_ts_begin(const char *str) +{ + TRACE_DS_BEGIN(ESTART: %s, str); + return e_main_ts(str); +} + +E_API double +e_main_ts_end(const char *str) +{ + TRACE_DS_END(); + return e_main_ts(str); +} + /* local functions */ static void _e_main_shutdown(int errcode) @@ -1118,16 +1153,18 @@ _e_main_path_shutdown(void) static int _e_main_screens_init(void) { - TS("\tscreens: client"); + TSB("\tscreens: client"); if (!e_client_init()) return 0; + TSE("\tscreens: client Done"); - TS("Compositor Init"); + TSB("Compositor Init"); PRCTL("[Winsys] start of compositor init"); if (!e_comp_init()) { e_error_message_show(_("Enlightenment cannot create a compositor.\n")); _e_main_shutdown(-1); } + TSE("Compositor Init Done"); PRCTL("[Winsys] end of compositor init"); _e_main_desk_restore(); @@ -1253,14 +1290,14 @@ _e_main_cb_idle_after(void *data EINA_UNUSED) #ifdef E_RELEASE_BUILD if (first_idle) { - TS("SLEEP"); + TSM("SLEEP"); first_idle = 0; e_precache_end = EINA_TRUE; } #else if (first_idle++ < 60) { - TS("SLEEP"); + TSM("SLEEP"); if (!first_idle) e_precache_end = EINA_TRUE; } @@ -1283,7 +1320,7 @@ _e_main_create_wm_ready(void) _wmready_checker = fopen(path_wm_ready, "wb"); if (_wmready_checker) { - TS("[WM] WINDOW MANAGER is READY!!!"); + TSM("[WM] WINDOW MANAGER is READY!!!"); PRCTL("[Winsys] WINDOW MANAGER is READY!!!"); fclose(_wmready_checker); @@ -1294,19 +1331,19 @@ _e_main_create_wm_ready(void) if (_tmp_wm_ready_checker) { - TS("[WM] temporary wm_ready path is created."); + TSM("[WM] temporary wm_ready path is created."); PRCTL("[Winsys] temporary wm_ready path is created."); fclose(_tmp_wm_ready_checker); } else { - TS("[WM] temporary wm_ready path create failed."); + TSM("[WM] temporary wm_ready path create failed."); PRCTL("[Winsys] temporary wm_ready path create failed."); } } else { - TS("[WM] WINDOW MANAGER is READY. BUT, failed to create .wm_ready file."); + TSM("[WM] WINDOW MANAGER is READY. BUT, failed to create .wm_ready file."); PRCTL("[Winsys] WINDOW MANAGER is READY. BUT, failed to create .wm_ready file."); } } diff --git a/src/bin/e_module.c b/src/bin/e_module.c index cf6d8ea..ae02e06 100644 --- a/src/bin/e_module.c +++ b/src/bin/e_module.c @@ -326,7 +326,7 @@ e_module_new(const char *name) if (!m) return NULL; snprintf(str, sizeof(str), "\t%s Module Open", name); - e_main_ts(str); + e_main_ts_begin(str); if (name[0] != '/') { @@ -491,7 +491,7 @@ init_done: if (modpath) eina_stringshare_del(modpath); snprintf(str, sizeof(str), "\t%s Module Open Done m:%p", name, m); - e_main_ts(str); + e_main_ts_end(str); return m; } @@ -526,7 +526,7 @@ e_module_enable(E_Module *m) if ((m->enabled) || (m->error)) return 0; snprintf(str, sizeof(str), "\t%s Module Enable", m->name); - e_main_ts(str); + e_main_ts_begin(str); m->data = m->func.init(m); if (m->data) @@ -551,13 +551,13 @@ e_module_enable(E_Module *m) } snprintf(str, sizeof(str), "\t%s Module Enable Done 1", m->name); - e_main_ts(str); + e_main_ts_end(str); return 1; } snprintf(str, sizeof(str), "\t%s Module Enable Done 0", m->name); - e_main_ts(str); + e_main_ts_end(str); return 0; } -- 2.7.4