summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-01-26 14:47:00 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2009-01-26 14:47:00 +0000
commitc9a5f71f02eb4be2f6bf14f08dbd741bb7718bff (patch)
tree9937a8d1684ea9162951b900701cf958f91f2810
parent147e0a99d4e9a7d27009b25cb2f49b3c40536016 (diff)
Some forgotten changes.
Lost track of these changes - look like the usual motley assortment of bug fixes. #
-rw-r--r--src/app.c18
-rw-r--r--src/callgraph-store.c21
-rw-r--r--src/callgraph.c4
-rw-r--r--src/summary-chart.c17
-rw-r--r--src/summary-view.c14
5 files changed, 37 insertions, 37 deletions
diff --git a/src/app.c b/src/app.c
index 5e6358d..cff3f7e 100644
--- a/src/app.c
+++ b/src/app.c
@@ -1907,14 +1907,17 @@ _update_client (App *app)
_client_update_alloc_fn (&app->client);
_client_update_max_bytes (&app->client);
- if (app->client.update) {
- app_set_blocks (app, app->client.blocks);
+ app_set_blocks (app, app->client.blocks);
+
+ call_graph_store_update (app->client.call_graph,
+ app,
+ app->client.allocators,
+ app->client.last);
- call_graph_store_update (app->client.call_graph,
- app,
- app->client.allocators,
- app->client.last);
+ summary_update ((Summary *) app->summary_total, &app->client);
+ summary_update ((Summary *) app->summary_current, &app->client);
+ if (app->client.update) {
timeline_add_datum ((Timeline *) app->timeline, &app->client,
app->client.time, app->client.allocators);
@@ -1924,9 +1927,6 @@ _update_client (App *app)
app->client.update = FALSE;
}
- summary_update ((Summary *) app->summary_total, &app->client);
- summary_update ((Summary *) app->summary_current, &app->client);
-
if (app->client.pid && ! app->client.terminated) {
GtkTreeModel *model;
char client[1024];
diff --git a/src/callgraph-store.c b/src/callgraph-store.c
index b8390f9..3a300d5 100644
--- a/src/callgraph-store.c
+++ b/src/callgraph-store.c
@@ -946,7 +946,6 @@ call_graph_store_update (CallGraphStore *store,
_call_graph_frame_accumulate (child, At, Ap);
child->stamp = store->stamp;
- frame = child;
AA = child->allocator;
if (AA != NULL) {
@@ -964,28 +963,18 @@ call_graph_store_update (CallGraphStore *store,
min_frames = MIN (A->n_frames, AA->n_frames);
while (n < min_frames && A->frames[n] == AA->frames[n]) {
child = _call_graph_frame_new (store, AA, n, child);
- child->bytes = frame->bytes;
- child->allocs = frame->allocs;
- child->frees = frame->frees;
+ _call_graph_frame_accumulate (child, At, Ap);
child->allocator = NULL;
n++;
}
+ if (n < AA->n_frames)
+ _call_graph_frame_new (store, AA, n, child);
if (n < A->n_frames)
_call_graph_frame_new (store, A, n, child);
- if (n < AA->n_frames) {
- At = AA->time_tail;
- Ap = At->prev;
- while (Ap != NULL && Ap->time > since)
- Ap = Ap->prev;
- if (Ap == NULL)
- Ap = &nil;
-
- if (At->time <= since || At->n_allocs - Ap->n_allocs == 0)
- _call_graph_frame_new (store, AA, n, child);
- }
break;
- }
+ } else
+ frame = child;
}
updated++;
}
diff --git a/src/callgraph.c b/src/callgraph.c
index 49bad1a..6084c76 100644
--- a/src/callgraph.c
+++ b/src/callgraph.c
@@ -337,8 +337,8 @@ call_graph_query_tooltip (GtkWidget *widget,
child = child->filter[0];
} while (child->n_filter);
- len = g_snprintf (calls + 20, 20, "%d", child->allocs);
- pretty_print_number (calls + 20, len, calls);
+ len = g_snprintf (calls, 20, "%d", child->allocs);
+ pretty_print_number (calls, len, calls + 20);
g_string_append_printf (string, "%s (%.0f%%) calls:",
calls, child->allocs * 100. / frame->allocs);
diff --git a/src/summary-chart.c b/src/summary-chart.c
index 7196fb3..4744419 100644
--- a/src/summary-chart.c
+++ b/src/summary-chart.c
@@ -277,7 +277,6 @@ summary_chart_expose (GtkWidget *widget, GdkEventExpose *ev)
if (self->image != NULL) {
cairo_matrix_t matrix;
- cairo_save (cr);
cairo_fill_preserve (cr);
cairo_clip (cr);
@@ -287,7 +286,7 @@ summary_chart_expose (GtkWidget *widget, GdkEventExpose *ev)
cairo_pattern_set_matrix (self->image, &matrix);
cairo_set_source (cr, self->image);
cairo_paint (cr);
- cairo_restore (cr);
+ cairo_reset_clip (cr);
} else
cairo_fill (cr);
@@ -563,8 +562,11 @@ summary_chart_query_tooltip (GtkWidget *widget,
logical_rect = ink_rect;
n_allocs = A->time_tail->n_allocs;
- if (! allocators_store_is_cumulative (self->store))
- n_allocs -= A->time_tail->n_frees;
+ if (! allocators_store_is_cumulative (self->store) &&
+ A->time_tail->prev)
+ {
+ n_allocs -= A->time_tail->freed;
+ }
g_string_append (string, "\n\nMost frequent allocation callsite, ");
len = g_snprintf (calls + 40, 40, "%u", n_allocs);
@@ -597,8 +599,11 @@ summary_chart_query_tooltip (GtkWidget *widget,
*prev = next;
} else {
n_allocs = AA->time_tail->n_allocs;
- if (! allocators_store_is_cumulative (self->store))
- n_allocs -= AA->time_tail->n_frees;
+ if (! allocators_store_is_cumulative (self->store) &&
+ AA->time_tail->prev)
+ {
+ n_allocs -= AA->time_tail->freed;
+ }
this_allocs += n_allocs;
prev = &l->next;
}
diff --git a/src/summary-view.c b/src/summary-view.c
index ea32290..e24945a 100644
--- a/src/summary-view.c
+++ b/src/summary-view.c
@@ -175,8 +175,11 @@ summary_view_query_tooltip (GtkWidget *widget,
A = sum->largest;
n_allocs = A->time_tail->n_allocs;
- if (! allocators_store_is_cumulative ((AllocatorsStore *) model))
- n_allocs -= A->time_tail->n_frees;
+ if (! allocators_store_is_cumulative ((AllocatorsStore *) model) &&
+ A->time_tail->prev)
+ {
+ n_allocs -= A->time_tail->freed;
+ }
string = g_string_new ("Most frequent allocation callsite, ");
len = g_snprintf (calls + 40, 40, "%u", n_allocs);
@@ -213,8 +216,11 @@ summary_view_query_tooltip (GtkWidget *widget,
*prev = next;
} else {
n_allocs = AA->time_tail->n_allocs;
- if (! allocators_store_is_cumulative ((AllocatorsStore *) model))
- n_allocs -= AA->time_tail->n_frees;
+ if (! allocators_store_is_cumulative ((AllocatorsStore *) model) &&
+ AA->time_tail->prev)
+ {
+ n_allocs -= AA->time_tail->freed;
+ }
this_allocs += n_allocs;
prev = &l->next;
}