Include parent function name in profiling data
This commit is contained in:
parent
e1446f36aa
commit
bb0b4049f7
2 changed files with 5 additions and 0 deletions
|
@ -29,6 +29,7 @@ class ProfileDataModel(DataModel):
|
|||
'tid',
|
||||
'depth',
|
||||
'function_name',
|
||||
'parent_name',
|
||||
'start_timestamp',
|
||||
'duration',
|
||||
])
|
||||
|
@ -38,6 +39,7 @@ class ProfileDataModel(DataModel):
|
|||
tid: int,
|
||||
depth: int,
|
||||
function_name: str,
|
||||
parent_name: str,
|
||||
start_timestamp: int,
|
||||
duration: int,
|
||||
) -> None:
|
||||
|
@ -45,6 +47,7 @@ class ProfileDataModel(DataModel):
|
|||
'tid': tid,
|
||||
'depth': depth,
|
||||
'function_name': function_name,
|
||||
'parent_name': parent_name,
|
||||
'start_timestamp': start_timestamp,
|
||||
'duration': duration,
|
||||
}
|
||||
|
|
|
@ -99,11 +99,13 @@ class ProfileHandler(EventHandler):
|
|||
function_depth = len(tid_functions) - 1
|
||||
(start_timestamp, start_function_name) = tid_functions.pop()
|
||||
# Add to data model
|
||||
parent_name = tid_functions[-1][1] if function_depth > 0 else None
|
||||
duration = metadata.timestamp - start_timestamp
|
||||
self._data.add_duration(
|
||||
tid,
|
||||
function_depth,
|
||||
start_function_name,
|
||||
parent_name,
|
||||
start_timestamp,
|
||||
duration
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue