aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/profiler/profiler.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2005-04-28 17:58:49 +0800
committerMichael Zucci <zucchi@src.gnome.org>2005-04-28 17:58:49 +0800
commit1869ccfb2c81edc429580617ce4e59f36bf29a6a (patch)
treefc3060ec51e5af14a45dbd1363f63c69d952a6f7 /plugins/profiler/profiler.c
parent317bcecd09f60134dda35f25942aed85924f9ea8 (diff)
downloadgsoc2013-evolution-1869ccfb2c81edc429580617ce4e59f36bf29a6a.tar
gsoc2013-evolution-1869ccfb2c81edc429580617ce4e59f36bf29a6a.tar.gz
gsoc2013-evolution-1869ccfb2c81edc429580617ce4e59f36bf29a6a.tar.bz2
gsoc2013-evolution-1869ccfb2c81edc429580617ce4e59f36bf29a6a.tar.lz
gsoc2013-evolution-1869ccfb2c81edc429580617ce4e59f36bf29a6a.tar.xz
gsoc2013-evolution-1869ccfb2c81edc429580617ce4e59f36bf29a6a.tar.zst
gsoc2013-evolution-1869ccfb2c81edc429580617ce4e59f36bf29a6a.zip
A profiler plugin.
2005-04-26 Not Zed <NotZed@Ximian.com> * A profiler plugin. svn path=/trunk/; revision=29238
Diffstat (limited to 'plugins/profiler/profiler.c')
-rw-r--r--plugins/profiler/profiler.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/plugins/profiler/profiler.c b/plugins/profiler/profiler.c
new file mode 100644
index 0000000000..3cb2fc8bc2
--- /dev/null
+++ b/plugins/profiler/profiler.c
@@ -0,0 +1,49 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Author: Michael Zucchi <notzed@novell.com>
+ *
+ * Copyright 2005 Novell, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * 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 Street #330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string.h>
+#include <stdio.h>
+
+#include <glib.h>
+#include <e-util/e-profile-event.h>
+
+void
+org_gnome_evolution_profiler_event(EPlugin *ep, EProfileEventTarget *t)
+{
+ static FILE *fp;
+
+ if (!fp) {
+ char *name;
+
+ name = g_strdup_printf("eprofile.%ld", (long int)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", t->tv.tv_sec, t->tv.tv_usec, t->id, t->uid);
+}