Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion gprof2dot.py
Original file line number Diff line number Diff line change
Expand Up @@ -3129,6 +3129,7 @@ def graphs_compare(self, profile1, profile2, theme, options):

for _, function1 in sorted_iteritems(profile1.functions):
labels = []
function2 = None

name = function1.name
try:
Expand Down Expand Up @@ -3238,7 +3239,10 @@ def graphs_compare(self, profile1, profile2, theme, options):
tooltip=function1.filename,
)

calls2 = {call.callee_id: call for _, call in sorted_iteritems(function2.calls)}
if function2 is not None:
calls2 = {call.callee_id: call for _, call in sorted_iteritems(function2.calls)}
else:
calls2 = {}
functions_by_id1 = {function.id: function for _, function in sorted_iteritems(profile1.functions)}

for _, call1 in sorted_iteritems(function1.calls):
Expand Down
14 changes: 14 additions & 0 deletions tests/compare/callgrind/unmatched/unmatched1.callgrind
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# callgrind format
version: 1
creator: test
positions: line
events: Ir

fn=extra_helper
0 10
cfn=main
calls=1 0
0 4

fn=main
0 7
8 changes: 8 additions & 0 deletions tests/compare/callgrind/unmatched/unmatched2.callgrind
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# callgrind format
version: 1
creator: test
positions: line
events: Ir

fn=main
0 7
Loading