summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2007-12-04 13:11:15 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2007-12-04 13:11:29 +0000
commitc1587235ac57243d650f4fdb87961e11e78aac43 (patch)
tree0a7e199205114c207eea4a06829cd4e8ccb30db3 /src/app.c
parenta72cad93e6473bd3093884c51b0c72ee32de3c4e (diff)
Rename to odin (Óðinn) after the Norse god of wisdom.
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/src/app.c b/src/app.c
index 551ce58..de426c1 100644
--- a/src/app.c
+++ b/src/app.c
@@ -1,20 +1,20 @@
/*
- This file is part of memfault, a memory profiler with fragmentation analysis.
+ This file is part of odin, a memory profiler with fragmentation analysis.
Copyright (C) 2007 Chris Wilson <chris@chris-wilson.co.uk>
- memfault is free software; you can redistribute it and/or
+ odin 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 3 of the
License, or (at your option) any later version.
- memfault is distributed in the hope that it will be useful, but
+ odin 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 memfault. If not, see <http://www.gnu.org/licenses/>/
+ along with odin. If not, see <http://www.gnu.org/licenses/>/
The GNU General Public License is contained in the file COPYING.
*/
@@ -31,7 +31,7 @@
#include <unistd.h>
#include <errno.h>
-#include "memfault.h"
+#include "odin.h"
#include "block.h"
#include "callgraph.h"
#include "frames.h"
@@ -512,7 +512,7 @@ static void
_app_set_client_name (App *app, const gchar *client)
{
const char *type = client_type_to_string (&app->client);
- char *str = g_strconcat (client, " - memfault [", type, "]", NULL);
+ char *str = g_strconcat (client, " - Óðinn [", type, "]", NULL);
gtk_window_set_title (GTK_WINDOW (app->window), str);
g_free (str);
@@ -1198,7 +1198,7 @@ _allocator_get_time (Client *client, Allocator *A, guint32 time)
return A->time_tail;
At = client_perm_alloc (client, sizeof (AllocatorTime));
- /* we always accumulate (cf memfault) */
+ /* we always accumulate (cf odin) */
memcpy (At, A->time_tail, sizeof (AllocatorTime));
At->next = NULL;
@@ -1877,7 +1877,7 @@ execute_cmdline_vg (App *app, char **argv, GError **error)
env = "valgrind";
argvp[j++] = g_strdup (env);
argvp[j++] = g_strdup ("valgrind");
- argvp[j++] = g_strdup ("--tool=memfault");
+ argvp[j++] = g_strdup ("--tool=odin");
addr = gnet_tcp_socket_get_local_inetaddr (app->vg_log);
name = gnet_inetaddr_get_canonical_name (addr);
@@ -1922,6 +1922,7 @@ execute_cmdline_vg (App *app, char **argv, GError **error)
static gboolean
execute_cmdline_lwp (App *app, char **argv, GError **error)
{
+ const gchar *lib = LIBDIR "/lwp.so";
gchar *path;
gchar **env, **envp;
GPid child;
@@ -1931,6 +1932,13 @@ execute_cmdline_lwp (App *app, char **argv, GError **error)
g_assert (app->client.pid == 0);
+ if (! g_file_test (lib, G_FILE_TEST_EXISTS)) {
+ g_set_error (error, 0, 0,
+ "Missing light-weight profiler: '%s' not found.",
+ lib);
+ return FALSE;
+ }
+
path = gnet_unix_socket_get_path (app->lwp_events);
env = g_listenv ();
@@ -1938,7 +1946,6 @@ execute_cmdline_lwp (App *app, char **argv, GError **error)
have_preload = have_socket = FALSE;
for (n = 0; env[n] != NULL; n++) {
if (strcmp (env[n], "LD_PRELOAD") == 0) {
- const gchar *lib = "./lwp.so";
const gchar *preload = g_getenv ("LD_PRELOAD");
if (strstr (preload, lib) == NULL)
envp[n] = g_strdup_printf ("LD_PRELOAD=%s:%s", lib, preload);
@@ -1952,7 +1959,7 @@ execute_cmdline_lwp (App *app, char **argv, GError **error)
envp[n] = g_strconcat (env[n], "=", g_getenv (env[n]), NULL);
}
if (! have_preload)
- envp[n++] = g_strconcat ("LD_PRELOAD=", "./lwp.so", NULL);
+ envp[n++] = g_strconcat ("LD_PRELOAD=", lib, NULL);
if (! have_socket)
envp[n++] = g_strconcat ("LWP_PATH=unix:", path, NULL);
envp[n] = NULL;
@@ -1995,7 +2002,7 @@ int main
{
"valgrind", 0, 0,
G_OPTION_ARG_NONE, &use_valgrind,
- "Use the heavy weight memfault valgrind skin to intercept the allocations.", NULL
+ "Use the heavy weight odin valgrind skin to intercept the allocations.", NULL
},
{
G_OPTION_REMAINING, 0, 0,
@@ -2011,6 +2018,8 @@ int main
gnet_init ();
glibtop_init ();
+ g_set_application_name ("Óðinn");
+
context = g_option_context_new ("[client [args]]");
g_option_context_add_main_entries (context, options, NULL);
g_option_context_add_group (context, gtk_get_option_group (TRUE));