diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-03-29 03:53:39 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:41:50 +0800 |
commit | 57ea14220ee233c2670743fd128835af2fc163c2 (patch) | |
tree | 94f63205ec999d764d4a1c6a7e4fb2d25d25ac63 | |
parent | 2199258d17d231ef5956ff4bb834699175d67324 (diff) | |
download | gsoc2013-evolution-57ea14220ee233c2670743fd128835af2fc163c2.tar.gz gsoc2013-evolution-57ea14220ee233c2670743fd128835af2fc163c2.tar.zst gsoc2013-evolution-57ea14220ee233c2670743fd128835af2fc163c2.zip |
Remove the profiler plugin.
This plugin was for developers, but no one uses it anymore. Plus the
only profiling hooks left in Evolution were in the MessageList widget,
which performs fine. There's better ways to collect profiling data
these days anyway (sysprof, systemtap, etc.).
-rw-r--r-- | configure.ac | 18 | ||||
-rw-r--r-- | e-util/Makefile.am | 2 | ||||
-rw-r--r-- | e-util/e-profile-event.c | 156 | ||||
-rw-r--r-- | e-util/e-profile-event.h | 106 | ||||
-rw-r--r-- | mail/message-list.c | 11 | ||||
-rw-r--r-- | plugins/profiler/Makefile.am | 23 | ||||
-rw-r--r-- | plugins/profiler/org-gnome-evolution-profiler.eplug.xml | 15 | ||||
-rw-r--r-- | plugins/profiler/profiler.c | 62 | ||||
-rw-r--r-- | shell/main.c | 4 |
9 files changed, 1 insertions, 396 deletions
diff --git a/configure.ac b/configure.ac index ef69b1bf19..6b3bc14912 100644 --- a/configure.ac +++ b/configure.ac @@ -1415,22 +1415,7 @@ dist_plugins_standard="$plugins_standard audio-inline image-inline pst-import" plugins_experimental_always="external-editor" plugins_experimental="$plugins_experimental_always $TNEF_ATTACHMENTS" -dist_plugins_experimental="$plugins_experimental_always profiler tnef-attachments contacts-map" - -dnl ****************************** -dnl Profiling support -dnl ****************************** -AC_ARG_ENABLE([profiling], - AS_HELP_STRING([--enable-profiling], - [Enable profiling plugin.]), - [enable_profiling=$enableval],[enable_profiling=no]) - -case x"$enable_profiling" in -x | xyes) - plugins_experimental="$plugins_experimental profiler" - AC_DEFINE(ENABLE_PROFILING,1,[Profiling Hooks Enabled]) - ;; -esac +dist_plugins_experimental="$plugins_experimental_always tnef-attachments contacts-map" dnl ****************************************************************** dnl The following plugins have additional library dependencies. @@ -1776,7 +1761,6 @@ plugins/mail-to-task/Makefile plugins/mailing-list-actions/Makefile plugins/mark-all-read/Makefile plugins/prefer-plain/Makefile -plugins/profiler/Makefile plugins/pst-import/Makefile plugins/publish-calendar/Makefile plugins/sa-junk-plugin/Makefile diff --git a/e-util/Makefile.am b/e-util/Makefile.am index a92f615263..83452013a8 100644 --- a/e-util/Makefile.am +++ b/e-util/Makefile.am @@ -44,7 +44,6 @@ eutilinclude_HEADERS = \ e-plugin.h \ e-plugin-ui.h \ e-plugin-util.h \ - e-profile-event.h \ e-selection.h \ e-signature.h \ e-signature-list.h \ @@ -120,7 +119,6 @@ libeutil_la_SOURCES = \ e-plugin-ui.c \ e-plugin-util.c \ e-print.c \ - e-profile-event.c \ e-selection.c \ e-signature.c \ e-signature-list.c \ diff --git a/e-util/e-profile-event.c b/e-util/e-profile-event.c deleted file mode 100644 index 7ca11c5d37..0000000000 --- a/e-util/e-profile-event.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see <http://www.gnu.org/licenses/> - * - * - * Authors: - * Michael Zucchi <notzed@ximian.com> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> -#include <stdlib.h> - -#include <glib.h> - -#include "e-profile-event.h" - -static EProfileEvent *e_profile_event; - -G_DEFINE_TYPE ( - EProfileEvent, - e_profile_event, - E_TYPE_EVENT) - -static void -eme_target_free (EEvent *ep, EEventTarget *t) -{ - switch (t->type) { - case E_PROFILE_EVENT_TARGET: { - EProfileEventTarget *s = (EProfileEventTarget *)t; - - g_free (s->id); - g_free (s->uid); - break; } - } - - ((EEventClass *)e_profile_event_parent_class)->target_free (ep, t); -} - -static void -e_profile_event_class_init (EProfileEventClass *class) -{ - ((EEventClass *)class)->target_free = eme_target_free; -} - -static void -e_profile_event_init (EProfileEvent *event) -{ -} - -EProfileEvent * -e_profile_event_peek (void) -{ - if (e_profile_event == NULL) { - e_profile_event = g_object_new ( - e_profile_event_get_type (), NULL); - e_event_construct ( - &e_profile_event->popup, - "org.gnome.evolution.profile.events"); - } - - return e_profile_event; -} - -EProfileEventTarget * -e_profile_event_target_new (EProfileEvent *eme, - const gchar *id, - const gchar *uid, - guint32 flags) -{ - EProfileEventTarget *t = e_event_target_new ( - &eme->popup, E_PROFILE_EVENT_TARGET, sizeof (*t)); - GTimeVal tv; - - t->id = g_strdup (id); - t->uid = g_strdup (uid); - t->target.mask = ~flags; - g_get_current_time (&tv); - t->tv.tv_sec = tv.tv_sec; - t->tv.tv_usec = tv.tv_usec; - - return t; -} - -#ifdef ENABLE_PROFILING -void -e_profile_event_emit (const gchar *id, const gchar *uid, guint32 flags) -{ - EProfileEvent *epe = e_profile_event_peek (); - EProfileEventTarget *t = e_profile_event_target_new (epe, id, uid, flags); - - e_event_emit((EEvent *)epe, "event", (EEventTarget *)t); -} -#else -/* simply keep macro from header file expand to "nothing". -#undef e_profile_event_emit -static void -e_profile_event_emit (const gchar *id, const gchar *uid, guint32 flags) -{ -}*/ -#endif - -/* ********************************************************************** */ - -static const EEventHookTargetMask emeh_profile_masks[] = { - { "start", E_PROFILE_EVENT_START }, - { "end", E_PROFILE_EVENT_END }, - { "cancel", E_PROFILE_EVENT_CANCEL }, - { NULL } -}; - -static const EEventHookTargetMap emeh_targets[] = { - { "event", E_PROFILE_EVENT_TARGET, emeh_profile_masks }, - { NULL } -}; - -G_DEFINE_TYPE ( - EProfileEventHook, - e_profile_event_hook, - E_TYPE_EVENT_HOOK) - -static void -e_profile_event_hook_class_init (EProfileEventHookClass *class) -{ - gint i; - - ((EPluginHookClass *)class)->id = - "org.gnome.evolution.profile.events:1.0"; - - for (i=0;emeh_targets[i].type;i++) - e_event_hook_class_add_target_map ( - (EEventHookClass *) class, &emeh_targets[i]); - - ((EEventHookClass *)class)->event = (EEvent *)e_profile_event_peek (); -} - -static void -e_profile_event_hook_init (EProfileEventHook *hook) -{ -} diff --git a/e-util/e-profile-event.h b/e-util/e-profile-event.h deleted file mode 100644 index 800ce99008..0000000000 --- a/e-util/e-profile-event.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see <http://www.gnu.org/licenses/> - * - * - * Authors: - * Michel Zucchi <notzed@ximian.com> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifndef __E_PROFILE_EVENT_H__ -#define __E_PROFILE_EVENT_H__ - -#include <glib-object.h> -#include <sys/time.h> - -#include "e-util/e-event.h" - -G_BEGIN_DECLS - -typedef struct _EProfileEvent EProfileEvent; -typedef struct _EProfileEventClass EProfileEventClass; - -/* Current target description */ -enum _e_profile_event_target_t { - E_PROFILE_EVENT_TARGET -}; - -/* Flags that qualify a target (UNIMPLEMENTED) */ -enum { - E_PROFILE_EVENT_START = 1<< 0, - E_PROFILE_EVENT_END = 1<< 1, - E_PROFILE_EVENT_CANCEL = 1<< 2 -}; - -typedef struct _EProfileEventTarget EProfileEventTarget; - -struct _EProfileEventTarget { - EEventTarget target; - - struct timeval tv; - gchar *id; /* id of event */ - gchar *uid; /* uid of event (folder/message, etc) */ -}; - -typedef struct _EEventItem EProfileEventItem; - -/* The object */ -struct _EProfileEvent { - EEvent popup; - - struct _EProfileEventPrivate *priv; -}; - -struct _EProfileEventClass { - EEventClass popup_class; -}; - -GType e_profile_event_get_type (void); - -EProfileEvent *e_profile_event_peek (void); - -EProfileEventTarget * -e_profile_event_target_new (EProfileEvent *emp, - const gchar *id, - const gchar *uid, - guint32 flags); - -/* we don't want ANY rubbish code lying around if we have profiling off */ -#ifdef ENABLE_PROFILING -void e_profile_event_emit (const gchar *id, const gchar *uid, guint32 flags); -#else -#define e_profile_event_emit(a, b, c) -#endif - -/* ********************************************************************** */ - -typedef struct _EProfileEventHook EProfileEventHook; -typedef struct _EProfileEventHookClass EProfileEventHookClass; - -struct _EProfileEventHook { - EEventHook hook; -}; - -struct _EProfileEventHookClass { - EEventHookClass hook_class; -}; - -GType e_profile_event_hook_get_type (void); - -G_END_DECLS - -#endif /* __E_PROFILE_EVENT_H__ */ diff --git a/mail/message-list.c b/mail/message-list.c index 6306b7238e..72c962e937 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -39,7 +39,6 @@ #include "e-util/e-account-utils.h" #include "e-util/e-icon-factory.h" #include "e-util/e-poolv.h" -#include "e-util/e-profile-event.h" #include "e-util/e-util-private.h" #include "e-util/e-util.h" @@ -4527,8 +4526,6 @@ regen_list_exec (struct _regen_list_msg *m, if (cursor) m->last_row = e_tree_table_adapter_row_of_node (e_tree_get_table_adapter (tree), cursor); - e_profile_event_emit("list.getuids", camel_folder_get_full_name (m->folder), 0); - /* if we have hidedeleted on, use a search to find it out, merge with existing search if set */ if (!camel_folder_has_search_capability (m->folder)) { /* if we have no search capability, dont let search or hide deleted work */ @@ -4608,8 +4605,6 @@ regen_list_exec (struct _regen_list_msg *m, return; } - e_profile_event_emit("list.threaduids", camel_folder_get_full_name (m->folder), 0); - /* camel_folder_summary_prepare_fetch_all (m->folder->summary, NULL); */ if (!g_cancellable_is_cancelled (cancellable)) { /* update/build a new tree */ @@ -4669,8 +4664,6 @@ regen_list_done (struct _regen_list_msg *m) g_signal_handlers_block_by_func (e_tree_get_table_adapter (tree), ml_tree_sorting_changed, m->ml); - e_profile_event_emit("list.buildtree", camel_folder_get_full_name (m->folder), 0); - if (m->dotree) { gboolean forcing_expand_state = m->ml->expand_all || m->ml->collapse_all; @@ -4776,8 +4769,6 @@ regen_list_free (struct _regen_list_msg *m) { gint i; - e_profile_event_emit("list.regenerated", camel_folder_get_full_name (m->folder), 0); - if (m->summary) { for (i = 0; i < m->summary->len; i++) camel_folder_free_message_info (m->folder, m->summary->pdata[i]); @@ -4817,8 +4808,6 @@ static MailMsgInfo regen_list_info = { static gboolean ml_regen_timeout (struct _regen_list_msg *m) { - e_profile_event_emit("list.regenerate", camel_folder_get_full_name (m->folder), 0); - g_mutex_lock (m->ml->regen_lock); m->ml->regen = g_list_prepend (m->ml->regen, m); g_mutex_unlock (m->ml->regen_lock); diff --git a/plugins/profiler/Makefile.am b/plugins/profiler/Makefile.am deleted file mode 100644 index 2a61fbafbe..0000000000 --- a/plugins/profiler/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -LIBS = $(SHELL_LIBS) - -@EVO_PLUGIN_RULE@ - -plugin_DATA = org-gnome-evolution-profiler.eplug - -plugin_LTLIBRARIES = liborg-gnome-evolution-profiler.la - -liborg_gnome_evolution_profiler_la_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - -I$(top_srcdir) \ - $(SHELL_CFLAGS) - -liborg_gnome_evolution_profiler_la_SOURCES = profiler.c - -liborg_gnome_evolution_profiler_la_LDFLAGS = -module -avoid-version $(NO_UNDEFINED) - -EXTRA_DIST = org-gnome-evolution-profiler.eplug.xml - -BUILT_SOURCES = $(plugin_DATA) -CLEANFILES = $(BUILT_SOURCES) - --include $(top_srcdir)/git.mk diff --git a/plugins/profiler/org-gnome-evolution-profiler.eplug.xml b/plugins/profiler/org-gnome-evolution-profiler.eplug.xml deleted file mode 100644 index 97720132be..0000000000 --- a/plugins/profiler/org-gnome-evolution-profiler.eplug.xml +++ /dev/null @@ -1,15 +0,0 @@ -<e-plugin-list> - <e-plugin - id="org.gnome.evolution.profiler" - type="shlib" - _name="Evolution Profiler" - location="@PLUGINDIR@/liborg-gnome-evolution-profiler@SOEXT@"> - - <_description>Profile data events in Evolution (for developers only).</_description> - <author name="Michael Zucchi" email="notzed@novell.com"/> - - <hook class="org.gnome.evolution.profile.events:1.0"> - <event id="event" handle="org_gnome_evolution_profiler_event" target="event"/> - </hook> - </e-plugin> -</e-plugin-list> diff --git a/plugins/profiler/profiler.c b/plugins/profiler/profiler.c deleted file mode 100644 index 9744a684de..0000000000 --- a/plugins/profiler/profiler.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see <http://www.gnu.org/licenses/> - * - * - * Authors: - * Michael Zucchi <notzed@novell.com> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> -#include <stdio.h> -#include <sys/types.h> -#include <unistd.h> - -#include <glib.h> -#include <e-util/e-profile-event.h> - -void org_gnome_evolution_profiler_event (EPlugin *ep, EProfileEventTarget *t); - -gint e_plugin_lib_enable (EPlugin *ep, gint enable); - -gint -e_plugin_lib_enable (EPlugin *ep, gint enable) -{ - return 0; -} - -void -org_gnome_evolution_profiler_event (EPlugin *ep, EProfileEventTarget *t) -{ - static FILE *fp; - - if (!fp) { - gchar *name; - - name = g_strdup_printf("eprofile.%ld", (glong) getpid()); - fp = fopen(name, "w"); - if (fp) - fprintf(stderr, "Generating profiling data in '%s'\n", name); - g_free (name); - } - - if (fp) - fprintf(fp, "%d.%d: %s,%s\n", (gint) t->tv.tv_sec, (gint) t->tv.tv_usec, t->id, t->uid); -} diff --git a/shell/main.c b/shell/main.c index a27b6b9495..001d6bd843 100644 --- a/shell/main.c +++ b/shell/main.c @@ -66,7 +66,6 @@ #include "e-util/e-import.h" #include "e-util/e-plugin.h" #include "e-util/e-plugin-ui.h" -#include "e-util/e-profile-event.h" #include "e-util/e-util-private.h" #include "e-util/e-util.h" #ifdef G_OS_WIN32 @@ -721,9 +720,6 @@ main (gint argc, gchar **argv) /* Register built-in plugin hook types. */ es_event_hook_get_type (); e_import_hook_get_type (); -#ifdef ENABLE_PROFILING - e_profile_event_hook_get_type (); -#endif e_plugin_ui_hook_get_type (); /* All EPlugin and EPluginHook subclasses should be |