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',
|
'tid',
|
||||||
'depth',
|
'depth',
|
||||||
'function_name',
|
'function_name',
|
||||||
|
'parent_name',
|
||||||
'start_timestamp',
|
'start_timestamp',
|
||||||
'duration',
|
'duration',
|
||||||
])
|
])
|
||||||
|
@ -38,6 +39,7 @@ class ProfileDataModel(DataModel):
|
||||||
tid: int,
|
tid: int,
|
||||||
depth: int,
|
depth: int,
|
||||||
function_name: str,
|
function_name: str,
|
||||||
|
parent_name: str,
|
||||||
start_timestamp: int,
|
start_timestamp: int,
|
||||||
duration: int,
|
duration: int,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
@ -45,6 +47,7 @@ class ProfileDataModel(DataModel):
|
||||||
'tid': tid,
|
'tid': tid,
|
||||||
'depth': depth,
|
'depth': depth,
|
||||||
'function_name': function_name,
|
'function_name': function_name,
|
||||||
|
'parent_name': parent_name,
|
||||||
'start_timestamp': start_timestamp,
|
'start_timestamp': start_timestamp,
|
||||||
'duration': duration,
|
'duration': duration,
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,11 +99,13 @@ class ProfileHandler(EventHandler):
|
||||||
function_depth = len(tid_functions) - 1
|
function_depth = len(tid_functions) - 1
|
||||||
(start_timestamp, start_function_name) = tid_functions.pop()
|
(start_timestamp, start_function_name) = tid_functions.pop()
|
||||||
# Add to data model
|
# Add to data model
|
||||||
|
parent_name = tid_functions[-1][1] if function_depth > 0 else None
|
||||||
duration = metadata.timestamp - start_timestamp
|
duration = metadata.timestamp - start_timestamp
|
||||||
self._data.add_duration(
|
self._data.add_duration(
|
||||||
tid,
|
tid,
|
||||||
function_depth,
|
function_depth,
|
||||||
start_function_name,
|
start_function_name,
|
||||||
|
parent_name,
|
||||||
start_timestamp,
|
start_timestamp,
|
||||||
duration
|
duration
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue