MassifG Overview Graph

MassifG Overview Graph — A graph visualizing massif output over time

Synopsis

                    MassifgGraph;
void                massifg_graph_init                  (void);
MassifgGraph *      massifg_graph_new                   (void);
void                massifg_graph_free                  (MassifgGraph *graph);
void                massifg_graph_set_data              (MassifgGraph *graph,
                                                         MassifgOutputData *data);
MassifgOutputData * massifg_graph_get_data              (MassifgGraph *graph);
void                massifg_graph_set_show_details      (MassifgGraph *graph,
                                                         gboolean show_details);
void                massifg_graph_set_show_legend       (MassifgGraph *graph,
                                                         gboolean show_legend);
GtkWidget *         massifg_graph_get_widget            (MassifgGraph *graph);
gboolean            massifg_graph_render_to_cairo       (MassifgGraph *graph,
                                                         cairo_t *cr,
                                                         gint width,
                                                         gint height);
gboolean            massifg_graph_render_to_png         (MassifgGraph *graph,
                                                         gchar *filename,
                                                         int w,
                                                         int h);

Description

Implements the graphing functionality of MassifG

Currently two modes are supported by the graph, one "simple" and one "detailed". The "simple" mode shows an area plot over stack, heap and heap allocation overhead memory usage for each snapshot. The "detailed" mode shows an area plot, which is broken down to show how different functions contribute to the heap memory usage for each snapshot. Currently only the first children of the heap tree is displayed in detailed mode

Details

MassifgGraph

typedef struct {
	MassifgOutputData *data;
	GtkWidget *widget;
	GError *error;

	gboolean detailed;
	gboolean has_legend;

	GogPlot *plot;
} MassifgGraph;

massifg_graph_init ()

void                massifg_graph_init                  (void);

Initialize what is neccesary to use the graph. Note: Must be called before the first call to massifg_graph_new()


massifg_graph_new ()

MassifgGraph *      massifg_graph_new                   (void);

Create a new MassifgGraph.

Returns :

A new MassifgGraph. Free with massifg_graph_free()

massifg_graph_free ()

void                massifg_graph_free                  (MassifgGraph *graph);

Free a MassifgGraph

graph :

A MassifgGraph

massifg_graph_set_data ()

void                massifg_graph_set_data              (MassifgGraph *graph,
                                                         MassifgOutputData *data);

Set the data to visualize

graph :

A MassifgGraph

data :

MassifgOutputData to visualize in graph

massifg_graph_get_data ()

MassifgOutputData * massifg_graph_get_data              (MassifgGraph *graph);

Get the data the graph visualizes

graph :

A MassifgGraph

Returns :

the MassifgOutputData the graph is visualizing

massifg_graph_set_show_details ()

void                massifg_graph_set_show_details      (MassifgGraph *graph,
                                                         gboolean show_details);

Enable/disable detailed graph view

graph :

A MassifgGraph

show_details :

TRUE for detailed view, FALSE for simple view

massifg_graph_set_show_legend ()

void                massifg_graph_set_show_legend       (MassifgGraph *graph,
                                                         gboolean show_legend);

Enable/disable display of legend

graph :

A MassifgGraph

show_legend :

TRUE to enable, FALSE to disable

massifg_graph_get_widget ()

GtkWidget *         massifg_graph_get_widget            (MassifgGraph *graph);

Get the widget that displays the graph

graph :

A MassifgGraph

Returns :

The GtkWidget that displays the graph

massifg_graph_render_to_cairo ()

gboolean            massifg_graph_render_to_cairo       (MassifgGraph *graph,
                                                         cairo_t *cr,
                                                         gint width,
                                                         gint height);

Render graph to a cairo context

graph :

A MassifgGraph to render

cr :

cairo_t context to render to

width :

width of the rendered output

height :

height of the rendered output

Returns :

TRUE on success, FALSE on failure

massifg_graph_render_to_png ()

gboolean            massifg_graph_render_to_png         (MassifgGraph *graph,
                                                         gchar *filename,
                                                         int w,
                                                         int h);

Render the graph to a PNG file

graph :

A MassifgGraph to render

filename :

Path to file to render to. Will be created if not existing, or overwritten if existing

w :

width of the rendered output

h :

height of the rendered output

Returns :

TRUE on success, FALSE on failure