From c05d5a5d66adbc17c08683b50a46fb9f9b456457 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Mon, 29 Jan 2018 01:29:59 -0800 Subject: [PATCH] callgraph: code style cleanup --- lib/callgraph/sp-callgraph-profile.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/callgraph/sp-callgraph-profile.c b/lib/callgraph/sp-callgraph-profile.c index 9ff538aa..f224638c 100644 --- a/lib/callgraph/sp-callgraph-profile.c +++ b/lib/callgraph/sp-callgraph-profile.c @@ -230,7 +230,6 @@ sp_callgraph_profile_generate_worker (GTask *task, StackStash *resolved_stash = NULL; guint count = 0; gboolean ret = FALSE; - guint j; g_assert (G_IS_TASK (task)); g_assert (gen != NULL); @@ -250,7 +249,7 @@ sp_callgraph_profile_generate_worker (GTask *task, g_ptr_array_add (resolvers, sp_elf_symbol_resolver_new ()); g_ptr_array_add (resolvers, sp_jitmap_symbol_resolver_new ()); - for (j = 0; j < resolvers->len; j++) + for (guint j = 0; j < resolvers->len; j++) { SpSymbolResolver *resolver = g_ptr_array_index (resolvers, j); @@ -328,6 +327,9 @@ sp_callgraph_profile_generate_worker (GTask *task, if (!sp_selection_contains (selection, sample->frame.time)) continue; + if (sample->n_addrs == 0) + continue; + cmdline = g_hash_table_lookup (cmdlines, GINT_TO_POINTER (sample->frame.pid)); node = stack_stash_add_trace (stash, sample->addrs, sample->n_addrs, 1); @@ -357,7 +359,7 @@ sp_callgraph_profile_generate_worker (GTask *task, } else { - for (j = 0; j < resolvers->len; j++) + for (guint j = 0; j < resolvers->len; j++) { SpSymbolResolver *resolver = g_ptr_array_index (resolvers, j); GQuark tag = 0;