gnome-settings-daemon r229 - in trunk: . gnome-settings-daemon



Author: mccann
Date: Mon Mar 24 18:13:09 2008
New Revision: 229
URL: http://svn.gnome.org/viewvc/gnome-settings-daemon?rev=229&view=rev

Log:
2008-03-24  William Jon McCann  <jmccann redhat com>

	* gnome-settings-daemon/gnome-settings-manager.c:
	(gnome_settings_manager_start):
	* gnome-settings-daemon/gnome-settings-profile.c:
	(_gnome_settings_profile_log):
	* gnome-settings-daemon/gnome-settings-profile.h:
	* gnome-settings-daemon/main.c: (main):
	Add missing files.  Add some more profiling points.



Added:
   trunk/gnome-settings-daemon/gnome-settings-profile.c
   trunk/gnome-settings-daemon/gnome-settings-profile.h
Modified:
   trunk/ChangeLog
   trunk/gnome-settings-daemon/gnome-settings-manager.c
   trunk/gnome-settings-daemon/main.c

Modified: trunk/gnome-settings-daemon/gnome-settings-manager.c
==============================================================================
--- trunk/gnome-settings-daemon/gnome-settings-manager.c	(original)
+++ trunk/gnome-settings-daemon/gnome-settings-manager.c	Mon Mar 24 18:13:09 2008
@@ -313,8 +313,12 @@
 gnome_settings_manager_start (GnomeSettingsManager *manager,
                               GError              **error)
 {
+        gboolean ret;
+
         g_debug ("Starting settings manager");
 
+        ret = FALSE;
+
         gnome_settings_profile_start (NULL);
 
         if (!g_module_supported ()) {
@@ -324,14 +328,16 @@
                              GNOME_SETTINGS_MANAGER_ERROR_GENERAL,
                              "Plugins not supported");
 
-                return FALSE;
+                goto out;
         }
 
         _load_all (manager);
 
+        ret = TRUE;
+ out:
         gnome_settings_profile_end (NULL);
 
-        return TRUE;
+        return ret;
 }
 
 gboolean

Added: trunk/gnome-settings-daemon/gnome-settings-profile.c
==============================================================================
--- (empty file)
+++ trunk/gnome-settings-daemon/gnome-settings-profile.c	Mon Mar 24 18:13:09 2008
@@ -0,0 +1,65 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2005 William Jon McCann <mccann jhu edu>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors: William Jon McCann <mccann jhu edu>
+ *
+ */
+
+#include "config.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <stdarg.h>
+#include <signal.h>
+#include <time.h>
+#include <unistd.h>
+
+#include <glib.h>
+#include <glib/gstdio.h>
+
+#include "gnome-settings-profile.h"
+
+void
+_gnome_settings_profile_log (const char *func,
+                             const char *note,
+                             const char *format,
+                             ...)
+{
+        va_list args;
+        char   *str;
+        char   *formatted;
+
+        if (format == NULL) {
+                formatted = g_strdup ("");
+        } else {
+                va_start (args, format);
+                formatted = g_strdup_vprintf (format, args);
+                va_end (args);
+        }
+
+        if (func != NULL) {
+                str = g_strdup_printf ("MARK: %s %s: %s %s", g_get_prgname(), func, note ? note : "", formatted);
+        } else {
+                str = g_strdup_printf ("MARK: %s: %s %s", g_get_prgname(), note ? note : "", formatted);
+        }
+
+        g_free (formatted);
+
+        g_access (str, F_OK);
+        g_free (str);
+}

Added: trunk/gnome-settings-daemon/gnome-settings-profile.h
==============================================================================
--- (empty file)
+++ trunk/gnome-settings-daemon/gnome-settings-profile.h	Mon Mar 24 18:13:09 2008
@@ -0,0 +1,53 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2005 William Jon McCann <mccann jhu edu>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors: William Jon McCann <mccann jhu edu>
+ *
+ */
+
+#ifndef __GNOME_SETTINGS_PROFILE_H
+#define __GNOME_SETTINGS_PROFILE_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+#ifdef ENABLE_PROFILING
+#ifdef G_HAVE_ISO_VARARGS
+#define gnome_settings_profile_start(...) _gnome_settings_profile_log (G_STRFUNC, "start", __VA_ARGS__)
+#define gnome_settings_profile_end(...)   _gnome_settings_profile_log (G_STRFUNC, "end", __VA_ARGS__)
+#define gnome_settings_profile_msg(...)   _gnome_settings_profile_log (NULL, NULL, __VA_ARGS__)
+#elif defined(G_HAVE_GNUC_VARARGS)
+#define gnome_settings_profile_start(format...) _gnome_settings_profile_log (G_STRFUNC, "start", format)
+#define gnome_settings_profile_end(format...)   _gnome_settings_profile_log (G_STRFUNC, "end", format)
+#define gnome_settings_profile_msg(format...)   _gnome_settings_profile_log (NULL, NULL, format)
+#endif
+#else
+#define gnome_settings_profile_start(...)
+#define gnome_settings_profile_end(...)
+#define gnome_settings_profile_msg(...)
+#endif
+
+void            _gnome_settings_profile_log    (const char *func,
+                                                const char *note,
+                                                const char *format,
+                                                ...) G_GNUC_PRINTF (3, 4);
+
+G_END_DECLS
+
+#endif /* __GNOME_SETTINGS_PROFILE_H */

Modified: trunk/gnome-settings-daemon/main.c
==============================================================================
--- trunk/gnome-settings-daemon/main.c	(original)
+++ trunk/gnome-settings-daemon/main.c	Mon Mar 24 18:13:09 2008
@@ -200,6 +200,8 @@
         manager = NULL;
         program = NULL;
 
+        gnome_settings_profile_start (NULL);
+
         bindtextdomain (GETTEXT_PACKAGE, GNOME_SETTINGS_LOCALEDIR);
         bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
         textdomain (GETTEXT_PACKAGE);
@@ -208,6 +210,7 @@
 
         g_type_init ();
 
+        gnome_settings_profile_start ("gtk init");
         error = NULL;
         if (! gtk_init_with_args (&argc, &argv, NULL, entries, NULL, &error)) {
                 if (error != NULL) {
@@ -218,6 +221,7 @@
                 }
                 exit (1);
         }
+        gnome_settings_profile_end ("gtk init");
 
         g_log_set_default_handler (gsd_log_default_handler, NULL);
 
@@ -276,6 +280,7 @@
         }
 
         g_debug ("SettingsDaemon finished");
+        gnome_settings_profile_end (NULL);
 
         return 0;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]