[memprof: 56/76] detailwin: Allow to disable drawing the memory map



commit 672c4a889747d98f9ea9f4045fa321d227f50e99
Author: Holger Hans Peter Freyther <zecke selfish org>
Date:   Sat Nov 14 18:04:06 2009 +0100

    detailwin: Allow to disable drawing the memory map
    
    For apps that do a lot of memory allocations keeping
    up with the memory map is not possible. Workaround this
    problem by being able to disable it.

 memprof.glade   |   14 ++++++++++++++
 src/detailwin.c |    5 +++++
 src/gui.h       |    1 +
 src/main.c      |   10 ++++++++++
 4 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/memprof.glade b/memprof.glade
index 68c6524..c6535b5 100644
--- a/memprof.glade
+++ b/memprof.glade
@@ -869,6 +869,20 @@
               </packing>
             </child>
             <child>
+              <widget class="GtkToggleToolButton" id="draw_memmap">
+                <property name="visible">True</property>
+                <property name="tooltip" translatable="yes">Draw the memory map</property>
+                <property name="is_important">True</property>
+                <property name="label">Draw memory map</property>
+                <property name="active">True</property>
+                <signal name="toggled" handler="draw_memmap_toggled_cb"/>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
               <widget class="GtkToolButton" id="reset-profile-button">
                 <property name="visible">True</property>
                 <property name="label" translatable="yes">Reset</property>
diff --git a/src/detailwin.c b/src/detailwin.c
index af4f27b..6939ae1 100644
--- a/src/detailwin.c
+++ b/src/detailwin.c
@@ -181,6 +181,11 @@ dw_draw_memmap(ProcessWindow *pwin)
    gint regnum = 0;
    GdkGC *gc_none, *gc_bg, *gc_bg2, *gc_mem, *gc_mem2, *gc_swapped, *gc_present, *gc_divider, *gc_0, *gc_1;
    
+
+   /* disabled */
+   if (!pwin->draw_memmap)
+     return FALSE;
+
    widget = pwin->mem_map;
    w = widget->allocation.width;
    h = widget->allocation.height;
diff --git a/src/gui.h b/src/gui.h
index 7c0aa98..fcab392 100644
--- a/src/gui.h
+++ b/src/gui.h
@@ -62,6 +62,7 @@ struct _ProcessWindow {
 	GtkWidget *time_graph;
 	GtkWidget *mem_map;
 	guint memstats[MEMSTATS][2];
+	gboolean draw_memmap;
 };
 
 void tree_window_show   (void);
diff --git a/src/main.c b/src/main.c
index c9d3655..551ed43 100644
--- a/src/main.c
+++ b/src/main.c
@@ -952,6 +952,7 @@ static void
 init_process (ProcessWindow *pwin, MPProcess *process)
 {
 	pwin->process = process;
+	pwin->draw_memmap = TRUE;
 
 	process_set_follow_fork (pwin->process, default_follow_fork);
 	process_set_follow_exec (pwin->process, default_follow_exec);
@@ -1196,6 +1197,15 @@ generate_profile_cb (GtkWidget *widget)
 }
 
 void
+draw_memmap_toggled_cb (GtkWidget *widget)
+{
+	ProcessWindow *pwin = pwin_from_widget (widget);
+	pwin->draw_memmap = gtk_toggle_tool_button_get_active
+			(GTK_TOGGLE_TOOL_BUTTON (widget));
+	dw_update(pwin);
+}
+
+void
 reset_profile_cb (GtkWidget *widget)
 {
 	ProcessWindow *pwin = pwin_from_widget (widget);



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