diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2008-05-08 10:34:54 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2008-05-08 10:34:54 +0100 |
commit | 6d366d4c2971d8769ab432d7a7e288368d6a18f2 (patch) | |
tree | f1bcdee4b1bd6451cad54fb31a01d2eaccf9b5fd | |
parent | 5d6514214e9e51b9ac0a34ebb91692ef35559280 (diff) |
Fix misaccumulation in callgraph.
-rw-r--r-- | src/app.c | 18 | ||||
-rw-r--r-- | src/callgraph-store.c | 21 |
2 files changed, 25 insertions, 14 deletions
@@ -1907,17 +1907,14 @@ _update_client (App *app) _client_update_alloc_fn (&app->client); _client_update_max_bytes (&app->client); - app_set_blocks (app, app->client.blocks); - - call_graph_store_update (app->client.call_graph, - app, - app->client.allocators, - app->client.last); + if (app->client.update) { + app_set_blocks (app, app->client.blocks); - summary_update ((Summary *) app->summary_total, &app->client); - summary_update ((Summary *) app->summary_current, &app->client); + call_graph_store_update (app->client.call_graph, + app, + app->client.allocators, + app->client.last); - if (app->client.update) { timeline_add_datum ((Timeline *) app->timeline, &app->client, app->client.time, app->client.allocators); @@ -1927,6 +1924,9 @@ _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 3a300d5..b8390f9 100644 --- a/src/callgraph-store.c +++ b/src/callgraph-store.c @@ -946,6 +946,7 @@ 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) { @@ -963,18 +964,28 @@ 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); - _call_graph_frame_accumulate (child, At, Ap); + child->bytes = frame->bytes; + child->allocs = frame->allocs; + child->frees = frame->frees; 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++; } |