Skip to content

Commit

Permalink
draft support for multi-root call graph
Browse files Browse the repository at this point in the history
by having a root node that has neither sf
nor native_target_name set.
  • Loading branch information
timo committed May 27, 2019
1 parent a1154bc commit 36b5339
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/profiler/instrument.c
Expand Up @@ -463,7 +463,7 @@ static MVMObject * dump_call_graph_node(MVMThreadContext *tc, ProfDumpStrs *pds,
/* Use static frame memory address to get a unique ID. */
MVM_repr_bind_key_o(tc, node_hash, pds->id,
box_i(tc, (MVMint64)(uintptr_t)pcn->sf));
} else {
} else if (pcn->native_target_name) {
MVMString *function_name_string =
MVM_string_utf8_c8_decode(tc, tc->instance->VMString,
pcn->native_target_name, strlen(pcn->native_target_name));
Expand All @@ -480,6 +480,18 @@ static MVMObject * dump_call_graph_node(MVMThreadContext *tc, ProfDumpStrs *pds,
MVM_repr_bind_key_o(tc, node_hash, pds->id,
box_i(tc, (MVMint64)(uintptr_t)pcn->native_target_name));
}
else {
MVM_repr_bind_key_o(tc, node_hash, pds->name,
box_s(tc, pds->call_graph));
MVM_repr_bind_key_o(tc, node_hash, pds->file,
box_s(tc, pds->call_graph));

MVM_repr_bind_key_o(tc, node_hash, pds->line,
box_i(tc, -10));

MVM_repr_bind_key_o(tc, node_hash, pds->id,
box_i(tc, (MVMint64)(uintptr_t)pcn));
}

/* Entry counts. */
if (pcn->total_entries)
Expand Down

0 comments on commit 36b5339

Please sign in to comment.