--- libbonobo/activation-server/activation-context-corba.c 2004-01-06 03:57:03.000000000 -0600 +++ libbonobo/activation-server/activation-context-corba.c 2006-03-09 11:51:17.000000000 -0600 @@ -446,6 +446,23 @@ impl_Bonobo_ActivationContext_removeDire } static void +program_log (const char *format, ...) +{ + va_list args; + char *formatted, *str; + + va_start (args, format); + formatted = g_strdup_vprintf (format, args); + va_end (args); + + str = g_strdup_printf ("MARK: %s: %s", g_get_prgname(), formatted); + g_free (formatted); + + access (str, F_OK); + g_free (str); +} + +static void ac_do_activation (ActivationContext *actx, Bonobo_ServerInfo *server, const Bonobo_ActivationEnvironment *environment, @@ -540,9 +557,11 @@ ac_do_activation (ActivationContext } else { CORBA_Object retval; + program_log ("activation-context-corba.c: calling Bonobo_ObjectDirectory_activate()"); retval = Bonobo_ObjectDirectory_activate ( actx->obj, server->iid, BONOBO_OBJREF (actx), environment, flags, client, ctx, ev); + program_log ("activation-context-corba.c: finished Bonobo_ObjectDirectory_activate()"); if (ev->_major == CORBA_NO_EXCEPTION) { char tbuf[512]; @@ -580,18 +599,26 @@ impl_Bonobo_ActivationContext_activateMa int i; char *hostname; + program_log ("activation-context-corba.c: start i_B_AC_activateMatchingFull(requirements=\"%s\")", requirements); + +/* program_log ("activation-context-corba.c: calling ac_update_lists()"); */ ac_update_lists (actx, ev); +/* program_log ("activation-context-corba.c: finished ac_update_lists()"); */ actx->refs++; items = g_alloca (actx->total_servers * sizeof (Bonobo_ServerInfo *)); +/* program_log ("activation-context-corba.c: calling ac_query_run()"); */ ac_query_run (actx, requirements, selection_order, ctx, items, ev); +/* program_log ("activation-context-corba.c: finished ac_query_run()"); */ if (ev->_major != CORBA_NO_EXCEPTION) goto out; +/* program_log ("activation-context-corba.c: calling ac_CORBA_Context_get_value(\"hostname\")"); */ hostname = ac_CORBA_Context_get_value (ctx, "hostname", ev); +/* program_log ("activation-context-corba.c: finished ac_CORBA_Context_get_value(\"hostname\")"); */ retval = Bonobo_ActivationResult__alloc (); retval->res._d = Bonobo_ACTIVATION_RESULT_NONE; @@ -600,8 +627,10 @@ impl_Bonobo_ActivationContext_activateMa && (i < actx->total_servers); i++) { curitem = items[i]; + program_log ("activation-context-corba.c: calling ac_do_activation(%s)", curitem->location_info); ac_do_activation (actx, curitem, environment, retval, flags, hostname, client, ctx, ev); + program_log ("activation-context-corba.c: finished ac_do_activation(%s)", curitem->location_info); } if (retval->res._d == Bonobo_ACTIVATION_RESULT_NONE) @@ -617,6 +646,8 @@ impl_Bonobo_ActivationContext_activateMa actx->refs--; + program_log ("activation-context-corba.c: end i_B_AC_activateMatchingFull(requirements=\"%s\")", requirements); + return retval; } --- libbonobo/activation-server/activation-server-main.c 2005-04-15 19:37:07.000000000 -0500 +++ libbonobo/activation-server/activation-server-main.c 2006-03-09 12:32:19.000000000 -0600 @@ -365,6 +365,8 @@ main (int argc, char *argv[]) #endif const gchar *debug_output_env; + g_set_prgname ("bonobo-activation-server"); + #ifdef G_OS_WIN32 whereami (); #endif --- libbonobo/activation-server/object-directory-activate.c 2006-03-09 15:08:57.000000000 -0600 +++ libbonobo/activation-server/object-directory-activate.c 2006-03-09 13:04:27.000000000 -0600 @@ -37,6 +37,23 @@ #include "server.h" #include "activation-server-corba-extensions.h" +static void +program_log (const char *format, ...) +{ + va_list args; + char *formatted, *str; + + va_start (args, format); + formatted = g_strdup_vprintf (format, args); + va_end (args); + + str = g_strdup_printf ("MARK: %s: %s", g_get_prgname(), formatted); + g_free (formatted); + + access (str, F_OK); + g_free (str); +} + static CORBA_Object od_server_activate_factory (Bonobo_ServerInfo *si, ODActivationInfo *actinfo, @@ -140,8 +157,10 @@ od_server_activate_exe (Bonobo_ServerInf args[i++] = "--oaf-ior-fd=%d"; +/* program_log ("object-directory-activate.c: calling CORBA_ORB_object_to_string (bonobo_activation_orb_get ())"); */ iorstr = CORBA_ORB_object_to_string ( bonobo_activation_orb_get (), od_obj, ev); +/* program_log ("object-directory-activate.c: finished CORBA_ORB_object_to_string (bonobo_activation_orb_get ())"); */ if (ev->_major != CORBA_NO_EXCEPTION) iorstr = NULL; @@ -161,9 +180,11 @@ od_server_activate_exe (Bonobo_ServerInf * if necessary */ iid = g_strdup (si->iid); +/* program_log ("object-directory-activate.c: calling bonobo_activation_server_by_forking()"); */ retval = bonobo_activation_server_by_forking ( (const char **) args, TRUE, fd_arg, environment, iorstr, iid, FALSE, bonobo_object_directory_re_check_fn, actinfo, ev); +/* program_log ("object-directory-activate.c: finished bonobo_activation_server_by_forking()"); */ g_free (iid); CORBA_free (iorstr); @@ -182,11 +203,23 @@ od_server_activate (Bonobo_ServerInfo g_return_val_if_fail (ev->_major == CORBA_NO_EXCEPTION, CORBA_OBJECT_NIL); - if (!strcmp (si->server_type, "exe")) - return od_server_activate_exe (si, actinfo, od_obj, environment, ev); + if (!strcmp (si->server_type, "exe")) { + CORBA_Object retval; + + program_log ("object-directory-activate.c: calling od_server_activate_exe()"); + retval = od_server_activate_exe (si, actinfo, od_obj, environment, ev); + program_log ("object-directory-activate.c: finished od_server_activate_exe()"); + return retval; + } - else if (!strcmp (si->server_type, "factory")) - return od_server_activate_factory (si, actinfo, environment, client, ev); + else if (!strcmp (si->server_type, "factory")) { + CORBA_Object retval; + + program_log ("object-directory-activate.c: calling od_server_activate_factory()"); + retval = od_server_activate_factory (si, actinfo, environment, client, ev); + program_log ("object-directory-activate.c: calling od_server_activate_factory()"); + return retval; + } else if (!strcmp (si->server_type, "shlib")) g_warning (_("We don't handle activating shlib objects in a remote process yet")); --- libbonobo/bonobo-activation/bonobo-activation-fork-server.c 2006-03-09 15:08:57.000000000 -0600 +++ libbonobo/bonobo-activation/bonobo-activation-fork-server.c 2006-03-09 13:08:29.000000000 -0600 @@ -24,7 +24,7 @@ */ #include - +#include #include #include #include @@ -206,6 +206,23 @@ handle_exepipe (GIOChannel * source, return retval; } +static void +program_log (const char *format, ...) +{ + va_list args; + char *formatted, *str; + + va_start (args, format); + formatted = g_strdup_vprintf (format, args); + va_end (args); + + str = g_strdup_printf ("MARK: %s: %s", g_get_prgname(), formatted); + g_free (formatted); + + access (str, F_OK); + g_free (str); +} + CORBA_Object bonobo_activation_server_by_forking ( const char **cmd_const, @@ -229,6 +246,7 @@ bonobo_activation_server_by_forking ( GMainContext *context; char **newenv = NULL; char **cmd; + static GTimer *timer = NULL; #if defined(__APPLE__) && defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H) # include @@ -243,6 +261,8 @@ bonobo_activation_server_by_forking ( g_return_val_if_fail (cmd_const [0] != NULL, CORBA_OBJECT_NIL); g_return_val_if_fail (act_iid != NULL, CORBA_OBJECT_NIL); + program_log ("bonobo-activation-fork-server.c: start bonobo_activation_server_by_forking()"); + ai.environment = environment; ai.act_iid = act_iid; ai.exename = cmd_const [0]; @@ -254,8 +274,10 @@ bonobo_activation_server_by_forking ( #endif if (!use_new_loop && - (retval = scan_list (running_activations, &ai, ev)) != CORBA_OBJECT_NIL) + (retval = scan_list (running_activations, &ai, ev)) != CORBA_OBJECT_NIL) { + program_log ("bonobo-activation-fork-server.c: end bonobo_activation_server_by_forking() prematurely"); return retval; + } pipe (iopipes); @@ -333,10 +355,31 @@ bonobo_activation_server_by_forking ( ai.iorbuf[0] = '\0'; ai.done = FALSE; + + if (!timer) + timer = g_timer_new (); + if (g_slist_length (running_activations)) + { + EXEActivateInfo *blocked_ai = g_slist_last (running_activations)->data; + char *a, *b; + g_timer_start (timer); + a = g_path_get_basename (ai.exename); + b = g_path_get_basename (blocked_ai->exename); + program_log ("ACTIVATION OF '%s' BLOCKING ACTIVATION OF '%s' ", + a, b); + g_free (a); + g_free (b); + } running_activations = g_slist_prepend (running_activations, &ai); /* Spawn */ + { + char *a; + a = g_path_get_basename (ai.exename); + program_log ("bonobo-activation-fork-server.c: spawning %s", a); + g_free (a); + } if (!g_spawn_async (NULL, (gchar **) cmd, newenv, G_SPAWN_LEAVE_DESCRIPTORS_OPEN | G_SPAWN_SEARCH_PATH | @@ -352,6 +395,8 @@ bonobo_activation_server_by_forking ( g_error_free (error); error = NULL; + program_log ("bonobo-activation-fork-server.c: finished g_spawn_async() with an error"); + errval = Bonobo_GeneralError__alloc (); errval->description = CORBA_string_dup (error_message); g_free (error_message); @@ -360,6 +405,8 @@ bonobo_activation_server_by_forking ( ex_Bonobo_GeneralError, errval); running_activations = g_slist_remove (running_activations, &ai); + if (!running_activations) + g_timer_stop (timer); g_source_destroy (source); g_source_unref (source); @@ -371,6 +418,7 @@ bonobo_activation_server_by_forking ( g_strfreev (cmd); + program_log ("bonobo-activation-fork-server.c: end bonobo_activation_server_by_forking() prematurely"); return CORBA_OBJECT_NIL; } @@ -389,9 +437,17 @@ bonobo_activation_server_by_forking ( g_strfreev (cmd); /* Get the IOR from the pipe */ - while (!ai.done) { - g_main_context_iteration (context, TRUE); - } + { + char *a; + a = g_path_get_basename (ai.exename); + program_log ("bonobo-activation-fork-server.c: spinning until ai.done for %s", a); + + while (!ai.done) { + g_main_context_iteration (context, TRUE); + } + program_log ("bonobo-activation-fork-server.c: end spinning for %s", a); + g_free (a); + } g_source_destroy (source); g_source_unref (source); @@ -403,10 +459,27 @@ bonobo_activation_server_by_forking ( g_main_context_unref (context); running_activations = g_slist_remove (running_activations, &ai); + if (g_slist_length (running_activations)) + { + EXEActivateInfo *blocked_ai = g_slist_last (running_activations)->data; + char *a, *b; + + a = g_path_get_basename (ai.exename); + b = g_path_get_basename (blocked_ai->exename); + program_log ("ACTIVATION OF '%s' COMPLETED; UNBLOCKING ACTIVATION OF '%s' " + "time burned so far %g secs", + a, b, + g_timer_elapsed (timer, NULL)); + g_free (a); + g_free (b); + } + if (!running_activations) + g_timer_stop (timer); retval = exe_activate_info_to_retval (&ai, ev); close (iopipes[0]); + program_log ("bonobo-activation-fork-server.c: end bonobo_activation_server_by_forking()"); return retval; } --- libbonobo/bonobo-activation/bonobo-activation-register.c 2005-01-30 09:07:45.000000000 -0600 +++ libbonobo/bonobo-activation/bonobo-activation-register.c 2006-03-09 12:55:23.000000000 -0600 @@ -226,6 +226,23 @@ bonobo_activation_register_active_server return rv; } +static void +program_log (const char *format, ...) +{ + va_list args; + char *formatted, *str; + + va_start (args, format); + formatted = g_strdup_vprintf (format, args); + va_end (args); + + str = g_strdup_printf ("MARK: %s: %s", g_get_prgname(), formatted); + g_free (formatted); + + access (str, F_OK); + g_free (str); +} + /** * bonobo_activation_register_active_server_ext: * @iid: IID of the server to register. @@ -269,6 +286,8 @@ bonobo_activation_register_active_server g_return_val_if_fail (existing != NULL, Bonobo_ACTIVATION_REG_ERROR); *existing = CORBA_OBJECT_NIL; + program_log ("REGISTERING IID %s", iid); + CORBA_exception_init (&ev); #ifdef BONOBO_ACTIVATION_DEBUG @@ -345,6 +364,7 @@ bonobo_activation_register_active_server bonobo_activation_orb_get (), obj, &ev); if (ev._major == CORBA_NO_EXCEPTION) { + program_log ("NOTIFYING B-A-S WITH OUR IOR"); fprintf (fh, "%s\n", iorstr); CORBA_free (iorstr); } --- libbonobo/bonobo-activation/bonobo-activation-activate.c 2005-02-22 06:08:45.000000000 -0600 +++ libbonobo/bonobo-activation/bonobo-activation-activate.c 2006-03-09 19:59:34.000000000 -0600 @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -46,6 +47,23 @@ bonobo_activation_set_test_components_en { } +static void +program_log (const char *format, ...) +{ + va_list args; + char *formatted, *str; + + va_start (args, format); + formatted = g_strdup_vprintf (format, args); + va_end (args); + + str = g_strdup_printf ("MARK: %s: %s", g_get_prgname(), formatted); + g_free (formatted); + + access (str, F_OK); + g_free (str); +} + gboolean bonobo_activation_get_test_components_enabled (void) { @@ -272,12 +290,16 @@ bonobo_activation_query (const char g_return_val_if_fail (requirements != NULL, CORBA_OBJECT_NIL); + program_log ("bonobo_activation_query(requirements = %s) START", requirements); + ac = bonobo_activation_activation_context_get (); g_return_val_if_fail (ac != NULL, CORBA_OBJECT_NIL); retval = query_cache_lookup (requirements, selection_order, &active); - if (retval) + if (retval) { + program_log ("bonobo_activation_query(requirements = %s) END with cached query", requirements); return retval; + } if (!opt_ev) { CORBA_exception_init (&tempenv); @@ -287,9 +309,11 @@ bonobo_activation_query (const char copy_strv_to_sequence (selection_order, &selorder); + program_log ("bonobo_activation_query() calling Bonobo_ActivationContext_query()"); retval = Bonobo_ActivationContext_query ( ac, requirements, &selorder, bonobo_activation_context_get (), ev); + program_log ("bonobo_activation_query() finished Bonobo_ActivationContext_query()"); if (ev->_major == CORBA_NO_EXCEPTION) { if (!active) @@ -300,6 +324,8 @@ bonobo_activation_query (const char if (!opt_ev) CORBA_exception_free (&tempenv); + program_log ("bonobo_activation_query(requirements = %s) END", requirements); + return retval; } @@ -366,6 +392,8 @@ bonobo_activation_activate (const char g_return_val_if_fail (requirements != NULL, CORBA_OBJECT_NIL); + program_log ("bonobo_activation_activate(requirements = %s) START", requirements); + ac = bonobo_activation_activation_context_get (); g_return_val_if_fail (ac != NULL, CORBA_OBJECT_NIL); @@ -376,19 +404,23 @@ bonobo_activation_activate (const char ev = opt_ev; copy_strv_to_sequence (selection_order, &selorder); - + + program_log ("bonobo_activation_activate() calling Bonobo_ActivationContext_activateMatchingFull()"); result = Bonobo_ActivationContext_activateMatchingFull (ac, requirements, &selorder, &activation_environment, flags, bonobo_activation_client_get (), bonobo_activation_context_get (), ev); + program_log ("bonobo_activation_activate() finished Bonobo_ActivationContext_activateMatchingFull()"); if (ev->_major == CORBA_SYSTEM_EXCEPTION && !strcmp (ev->_id, ex_CORBA_BAD_OPERATION)) /* fall-back */ { g_message ("TESTME: Fall-back activate"); + program_log ("bonobo_activation_activate() calling Bonobo_ActivationContext_activateMatching()"); result = Bonobo_ActivationContext_activateMatching (ac, requirements, &selorder, &activation_environment, flags, bonobo_activation_context_get (), ev); + program_log ("bonobo_activation_activate() finished Bonobo_ActivationContext_activateMatching()"); } if (ev->_major == CORBA_NO_EXCEPTION) @@ -397,6 +429,8 @@ bonobo_activation_activate (const char if (!opt_ev) CORBA_exception_free (&tempenv); + program_log ("bonobo_activation_activate(requirements = %s) END", requirements); + return retval; } @@ -428,14 +462,19 @@ bonobo_activation_activate_from_id (cons g_return_val_if_fail (aid != NULL, CORBA_OBJECT_NIL); + program_log ("bonobo_activation_activate_from_id(%s) START", aid); + if (!strncmp ("OAFIID:", aid, 7)) { char *requirements; + CORBA_Object retval; requirements = g_alloca (strlen (aid) + sizeof ("iid == ''")); sprintf (requirements, "iid == '%s'", aid); - return bonobo_activation_activate ( + retval = bonobo_activation_activate ( requirements, NULL, flags, ret_aid, opt_ev); + program_log ("bonobo_activation_activate_from_id(%s) END", aid); + return retval; } if (!opt_ev) { @@ -453,14 +492,19 @@ bonobo_activation_activate_from_id (cons return CORBA_OBJECT_NIL; } + program_log ("bonobo_activation_activate_from_id() calling Bonobo_ActivationContext_activateFromAidFull()"); result = Bonobo_ActivationContext_activateFromAidFull (ac, aid, flags, bonobo_activation_client_get (), bonobo_activation_context_get (), ev); + program_log ("bonobo_activation_activate_from_id() finished Bonobo_ActivationContext_activateFromAidFull()"); if (ev->_major == CORBA_SYSTEM_EXCEPTION && - !strcmp (ev->_id, ex_CORBA_BAD_OPERATION)) /* fall-back */ + !strcmp (ev->_id, ex_CORBA_BAD_OPERATION)) /* fall-back */ { + program_log ("bonobo_activation_activate_from_id() calling Bonobo_ActivationContext_activateFromAid()"); result = Bonobo_ActivationContext_activateFromAid (ac, aid, flags, bonobo_activation_context_get (), ev); + program_log ("bonobo_activation_activate_from_id() finished Bonobo_ActivationContext_activateFromAid()"); + } if (ev->_major == CORBA_NO_EXCEPTION) retval = handle_activation_result (result, ret_aid, ev); @@ -468,6 +512,8 @@ bonobo_activation_activate_from_id (cons if (!opt_ev) CORBA_exception_free (&tempenv); + program_log ("bonobo_activation_activate_from_id(%s) END", aid); + return retval; } @@ -532,11 +578,15 @@ activation_async_callback (CORBA_Object async_data->user_cb (retval, NULL, async_data->user_data); + program_log ("activation_async_callback(): got an object!"); + clean_out: g_free (async_data); return; return_exception: + program_log ("activation_async_callback(): got an error!"); + if (!strcmp (ev->_id, "IDL:Bonobo/GeneralError:1.0")) { err = ev->_any._value; @@ -592,6 +642,8 @@ bonobo_activation_activate_async (const Bonobo_ActivationClient client; gpointer args [5]; + program_log ("bonobo_activation_activate_async (requirements = %s) START", requirements); + if (!requirements) { async_cb (CORBA_OBJECT_NIL, ASYNC_ERROR_NO_REQUIREMENTS, user_data); return; @@ -638,6 +690,8 @@ bonobo_activation_activate_async (const if (!opt_ev) CORBA_exception_free (&tempenv); + program_log ("bonobo_activation_activate_async (requirements = %s) END", requirements); + return; } @@ -674,6 +728,8 @@ bonobo_activation_activate_from_id_async Bonobo_ActivationClient client; gpointer args [3]; + program_log ("bonobo_activation_activate_from_id_async(%s) START", aid); + if (!aid) { async_cb (CORBA_OBJECT_NIL, ASYNC_ERROR_NO_AID, user_data); return; @@ -687,6 +743,7 @@ bonobo_activation_activate_from_id_async bonobo_activation_activate_async ( requirements, NULL, flags, async_cb, user_data, opt_ev); + program_log ("bonobo_activation_activate_from_id_async(%s) END", aid); return; } @@ -703,6 +760,7 @@ bonobo_activation_activate_from_id_async CORBA_exception_free (&tempenv); async_cb (CORBA_OBJECT_NIL, ASYNC_ERROR_NO_CONTEXT, user_data); + program_log ("bonobo_activation_activate_from_id_async(%s) END with no-context error", aid); return; } @@ -731,6 +789,8 @@ bonobo_activation_activate_from_id_async if (!opt_ev) CORBA_exception_free (&tempenv); + program_log ("bonobo_activation_activate_from_id_async(%s) END", aid); + return; }