Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support node.stack in nflxprofile format #107

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
17 changes: 11 additions & 6 deletions app/common/flame_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,18 @@ def _get_regular_stacks(nflxprofile_nodes, root_node_id):
while queue:
(nflxprofile_node_id, parent_node_id) = queue.pop(0)
nflxprofile_node = nflxprofile_nodes[nflxprofile_node_id]
if not parent_node_id:
stacks[nflxprofile_node_id] = [
(nflxprofile_node.function_name, nflxprofile_node.libtype)
]

if parent_node_id:
stacks[nflxprofile_node_id] = stacks[parent_node_id]
else:
stacks[nflxprofile_node_id] = []

if nflxprofile_node.stack:
for frame in nflxprofile_node.stack:
stacks[nflxprofile_node_id].append((frame.function_name, frame.libtype))
else:
stacks[nflxprofile_node_id] = stacks[parent_node_id] + \
[(nflxprofile_node.function_name, nflxprofile_node.libtype)]
stacks[nflxprofile_node_id].append((nflxprofile_node.function_name, nflxprofile_node.libtype))

for child_id in nflxprofile_node.children:
queue.append((child_id, nflxprofile_node_id))

Expand Down