mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
Various GUI updates
Thu Mar 24 19:09:33 2005 Søren Sandmann <sandmann@redhat.com> * sysprof.c: Various GUI updates * TODO: update * sfile.[ch] (sformat_new_optional): Add some notes about an "optional" construction.
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
2af6447238
commit
50c62b0804
@ -1,3 +1,12 @@
|
||||
Thu Mar 24 19:09:33 2005 Søren Sandmann <sandmann@redhat.com>
|
||||
|
||||
* sysprof.c: Various GUI updates
|
||||
|
||||
* TODO: update
|
||||
|
||||
* sfile.[ch] (sformat_new_optional): Add some notes about an
|
||||
"optional" construction.
|
||||
|
||||
Wed Mar 23 00:04:07 2005 Soeren Sandmann <sandmann@redhat.com>
|
||||
|
||||
Primitive loading and saving.
|
||||
|
||||
31
TODO
31
TODO
@ -1,13 +1,35 @@
|
||||
- Figure out what's needed before 1.0
|
||||
|
||||
- Consider adding KDE-style nested callgraph view
|
||||
|
||||
- Find out what distributions it actually works on
|
||||
|
||||
- Find out how to hack around gtk+ bug causing multiple double clicks
|
||||
to get eaten.
|
||||
|
||||
- hook up about box
|
||||
|
||||
- hook up menu items view/start etc (or possibly get rid of them or move them)
|
||||
|
||||
- crashes when you ctrl-click the selected item in the top left pane
|
||||
<ian__> ssp: looks like it doesn't handle the none-selected case
|
||||
|
||||
- Move "samples" label to the toolbar, then get rid of statusbar.
|
||||
|
||||
- consider caching [filename => bin_file]
|
||||
- Have kernel modulereport the file the symbol was found in
|
||||
|
||||
- Have kernel module report the file the address was found in
|
||||
Should avoid a lot of potential broken/raciness with dlopen etc.
|
||||
|
||||
- grep FIXME
|
||||
|
||||
- hide internal stuff in ProfileDescendant
|
||||
- add an 'everything' object. It _is_ really needed for a lot of things
|
||||
- in timer, put process to sleep. Should get us more accurate data
|
||||
|
||||
- add an 'everything' object. It is really needed for a lot of things
|
||||
|
||||
- kernel module should put process to sleep before sampling. Should get us
|
||||
more accurate data
|
||||
|
||||
- loading and saving
|
||||
|
||||
- make profile.c more agnostic to processes and functions etc. Ideally
|
||||
@ -27,9 +49,6 @@
|
||||
things that are UNINTERRUPTIBLE while there are RUNNING tasks is not
|
||||
consider bad.
|
||||
|
||||
- Make sure we don't overcharge when many processes are "RUNNING". We should
|
||||
probably divide each sample with the number of runnable processes
|
||||
|
||||
DONE:
|
||||
|
||||
- consider making ProfileObject more of an object.
|
||||
|
||||
16
sfile.c
16
sfile.c
@ -152,6 +152,18 @@ sformat_new (gpointer f)
|
||||
return sformat;
|
||||
}
|
||||
|
||||
#if 0
|
||||
SFormat *
|
||||
sformat_new_optional (gpointer f)
|
||||
{
|
||||
SFormat *sformat = g_new0 (SFormat, 1);
|
||||
Fragment *fragment = f;
|
||||
|
||||
sformat->begin = state_new ();
|
||||
sformat->end = state_new ();
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
sformat_free (SFormat *format)
|
||||
{
|
||||
@ -657,7 +669,9 @@ static void
|
||||
hook_up_pointers (SFileInput *file)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
/* FIXME: we need to check the types here */
|
||||
|
||||
#if 0
|
||||
g_print ("emfle\n");
|
||||
#endif
|
||||
|
||||
8
sfile.h
8
sfile.h
@ -25,7 +25,13 @@ typedef guint SType;
|
||||
* Format *format_new (void);
|
||||
* void format_new_record (Format *f, Record *r);
|
||||
*
|
||||
*
|
||||
*
|
||||
* Consider adding optional elements:
|
||||
*
|
||||
* sformat_new_optional (gpointer content)
|
||||
*
|
||||
* enums, optionals, selections, empties
|
||||
*
|
||||
*/
|
||||
|
||||
/* - Describing Types - */
|
||||
|
||||
28
sysprof.c
28
sysprof.c
@ -35,7 +35,6 @@ struct Application
|
||||
GtkTreeView * object_view;
|
||||
GtkTreeView * callers_view;
|
||||
GtkTreeView * descendants_view;
|
||||
GtkStatusbar * statusbar;
|
||||
|
||||
GtkWidget * start_button;
|
||||
GtkWidget * profile_button;
|
||||
@ -47,6 +46,7 @@ struct Application
|
||||
GtkWidget * profile_item;
|
||||
GtkWidget * open_item;
|
||||
GtkWidget * save_as_item;
|
||||
GtkWidget * samples_label;
|
||||
|
||||
Profile * profile;
|
||||
ProfileDescendant * descendants;
|
||||
@ -90,7 +90,7 @@ show_samples_timeout (gpointer data)
|
||||
switch (app->state)
|
||||
{
|
||||
case INITIAL:
|
||||
label = g_strdup ("");
|
||||
label = g_strdup ("Samples: 0");
|
||||
break;
|
||||
|
||||
case PROFILING:
|
||||
@ -98,9 +98,8 @@ show_samples_timeout (gpointer data)
|
||||
label = g_strdup_printf ("Samples: %d", app->n_samples);
|
||||
break;
|
||||
}
|
||||
|
||||
gtk_statusbar_pop (app->statusbar, 0);
|
||||
gtk_statusbar_push (app->statusbar, 0, label);
|
||||
|
||||
gtk_label_set_label (GTK_LABEL (app->samples_label), label);
|
||||
|
||||
g_free (label);
|
||||
|
||||
@ -123,6 +122,8 @@ update_sensitivity (Application *app)
|
||||
gboolean sensitive_save_as_button;
|
||||
gboolean sensitive_start_button;
|
||||
gboolean sensitive_tree_views;
|
||||
gboolean sensitive_samples_label;
|
||||
gboolean sensitive_reset_button;
|
||||
|
||||
GtkWidget *active_radio_button;
|
||||
|
||||
@ -132,15 +133,19 @@ update_sensitivity (Application *app)
|
||||
sensitive_profile_button = FALSE;
|
||||
sensitive_save_as_button = FALSE;
|
||||
sensitive_start_button = TRUE;
|
||||
sensitive_reset_button = FALSE;
|
||||
sensitive_tree_views = FALSE;
|
||||
sensitive_samples_label = FALSE;
|
||||
active_radio_button = app->dummy_button;
|
||||
break;
|
||||
|
||||
case PROFILING:
|
||||
sensitive_profile_button = (app->n_samples > 0);
|
||||
sensitive_save_as_button = (app->n_samples > 0);
|
||||
sensitive_reset_button = (app->n_samples > 0);
|
||||
sensitive_start_button = TRUE;
|
||||
sensitive_tree_views = FALSE;
|
||||
sensitive_samples_label = TRUE;
|
||||
active_radio_button = app->start_button;
|
||||
break;
|
||||
|
||||
@ -149,6 +154,8 @@ update_sensitivity (Application *app)
|
||||
sensitive_save_as_button = TRUE;
|
||||
sensitive_start_button = TRUE;
|
||||
sensitive_tree_views = TRUE;
|
||||
sensitive_reset_button = TRUE;
|
||||
sensitive_samples_label = FALSE;
|
||||
active_radio_button = app->profile_button;
|
||||
break;
|
||||
}
|
||||
@ -162,11 +169,15 @@ update_sensitivity (Application *app)
|
||||
sensitive_save_as_button);
|
||||
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (app->start_button),
|
||||
sensitive_start_button);
|
||||
|
||||
sensitive_start_button);
|
||||
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (app->reset_button),
|
||||
sensitive_reset_button);
|
||||
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (app->object_view), sensitive_tree_views);
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (app->callers_view), sensitive_tree_views);
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (app->descendants_view), sensitive_tree_views);
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (app->samples_label), sensitive_samples_label);
|
||||
|
||||
queue_show_samples (app);
|
||||
}
|
||||
@ -896,6 +907,8 @@ build_gui (Application *app)
|
||||
|
||||
g_signal_connect (G_OBJECT (app->save_as_button), "clicked",
|
||||
G_CALLBACK (on_save_as_clicked), app);
|
||||
|
||||
app->samples_label = glade_xml_get_widget (xml, "samples_label");
|
||||
|
||||
gtk_widget_realize (GTK_WIDGET (main_window));
|
||||
set_sizes (GTK_WINDOW (main_window),
|
||||
@ -936,7 +949,6 @@ build_gui (Application *app)
|
||||
gtk_tree_view_column_set_expand (col, TRUE);
|
||||
|
||||
/* Statusbar */
|
||||
app->statusbar = (GtkStatusbar *)glade_xml_get_widget (xml, "statusbar");
|
||||
queue_show_samples (app);
|
||||
}
|
||||
|
||||
|
||||
241
sysprof.glade
241
sysprof.glade
@ -180,114 +180,171 @@
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkToolbar" id="toolbar1">
|
||||
<widget class="GtkHBox" id="hbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
|
||||
<property name="toolbar_style">GTK_TOOLBAR_BOTH_HORIZ</property>
|
||||
<property name="tooltips">True</property>
|
||||
<property name="show_arrow">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioToolButton" id="start_button">
|
||||
<widget class="GtkToolbar" id="toolbar1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">S_tart</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="stock_id">gtk-media-play</property>
|
||||
<property name="visible_horizontal">True</property>
|
||||
<property name="visible_vertical">True</property>
|
||||
<property name="is_important">True</property>
|
||||
<property name="active">False</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioToolButton" id="profile_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Profile</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="stock_id">gtk-justify-left</property>
|
||||
<property name="visible_horizontal">True</property>
|
||||
<property name="visible_vertical">True</property>
|
||||
<property name="is_important">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="group">start_button</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkToolButton" id="reset_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Reset</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="stock_id">gtk-clear</property>
|
||||
<property name="visible_horizontal">True</property>
|
||||
<property name="visible_vertical">True</property>
|
||||
<property name="is_important">False</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkToolItem" id="toolitem1">
|
||||
<property name="visible">True</property>
|
||||
<property name="visible_horizontal">True</property>
|
||||
<property name="visible_vertical">True</property>
|
||||
<property name="is_important">False</property>
|
||||
<property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
|
||||
<property name="toolbar_style">GTK_TOOLBAR_BOTH_HORIZ</property>
|
||||
<property name="tooltips">True</property>
|
||||
<property name="show_arrow">True</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkSeparatorToolItem" id="separatortoolitem1">
|
||||
<widget class="GtkRadioToolButton" id="start_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="draw">True</property>
|
||||
<property name="label" translatable="yes">S_tart</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="stock_id">gtk-media-play</property>
|
||||
<property name="visible_horizontal">True</property>
|
||||
<property name="visible_vertical">True</property>
|
||||
<property name="is_important">True</property>
|
||||
<property name="active">False</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioToolButton" id="profile_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Profile</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="stock_id">gtk-justify-left</property>
|
||||
<property name="visible_horizontal">True</property>
|
||||
<property name="visible_vertical">True</property>
|
||||
<property name="is_important">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="group">start_button</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkToolButton" id="reset_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Reset</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="stock_id">gtk-clear</property>
|
||||
<property name="visible_horizontal">True</property>
|
||||
<property name="visible_vertical">True</property>
|
||||
<property name="is_important">False</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkToolItem" id="toolitem1">
|
||||
<property name="visible">True</property>
|
||||
<property name="visible_horizontal">True</property>
|
||||
<property name="visible_vertical">True</property>
|
||||
<property name="is_important">False</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkSeparatorToolItem" id="separatortoolitem1">
|
||||
<property name="visible">True</property>
|
||||
<property name="draw">True</property>
|
||||
<property name="visible_horizontal">True</property>
|
||||
<property name="visible_vertical">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="homogeneous">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkToolButton" id="save_as_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock_id">gtk-save-as</property>
|
||||
<property name="visible_horizontal">True</property>
|
||||
<property name="visible_vertical">True</property>
|
||||
<property name="is_important">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioToolButton" id="dummy_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">dummy</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="visible_horizontal">True</property>
|
||||
<property name="visible_vertical">True</property>
|
||||
<property name="is_important">False</property>
|
||||
<property name="active">False</property>
|
||||
<property name="group">start_button</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkToolButton" id="save_as_button">
|
||||
<widget class="GtkToolbar" id="toolbar2">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock_id">gtk-save-as</property>
|
||||
<property name="visible_horizontal">True</property>
|
||||
<property name="visible_vertical">True</property>
|
||||
<property name="is_important">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
|
||||
<property name="toolbar_style">GTK_TOOLBAR_BOTH_HORIZ</property>
|
||||
<property name="tooltips">True</property>
|
||||
<property name="show_arrow">False</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkRadioToolButton" id="dummy_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">dummy</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="visible_horizontal">True</property>
|
||||
<property name="visible_vertical">True</property>
|
||||
<property name="is_important">False</property>
|
||||
<property name="active">False</property>
|
||||
<property name="group">start_button</property>
|
||||
<child>
|
||||
<widget class="GtkToolItem" id="toolitem2">
|
||||
<property name="visible">True</property>
|
||||
<property name="visible_horizontal">True</property>
|
||||
<property name="visible_vertical">True</property>
|
||||
<property name="is_important">False</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="samples_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Samples: 0</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">6</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="homogeneous">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="homogeneous">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
@ -405,18 +462,6 @@
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkStatusbar" id="statusbar">
|
||||
<property name="visible">True</property>
|
||||
<property name="has_resize_grip">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
|
||||
Reference in New Issue
Block a user