Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
perf-instrumentation
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
safedocs-ta2-profiling
perf-instrumentation
Commits
3087d731
Commit
3087d731
authored
2 years ago
by
pompolic
Browse files
Options
Downloads
Patches
Plain Diff
Functions to compute the allocations of a single stack frame
parent
a6c29ba6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gdb-port/parser.py
+16
-0
16 additions, 0 deletions
gdb-port/parser.py
with
16 additions
and
0 deletions
gdb-port/parser.py
+
16
−
0
View file @
3087d731
...
...
@@ -220,3 +220,19 @@ class ParserStack:
def
depth
(
self
):
return
len
(
self
.
p_stack
)
def
compute_parserstack_frame_allocs
(
self
):
stack_depth
=
0
stack_events
=
None
for
index
,
ev
in
enumerate
(
self
.
stack_events
[::
-
1
]):
# Since this is meant to be called from ParserStack.pop(), the assumption here is that the first element will be a StackEvent.POP
# So we can stop gathering memory allocations at the point stack_depth becomes 0 again: that'll be the point in the list,
# where the parser we just popped from the stack had been pushed on it. Allocations prior to that are not relevant and are not considered
if
ev
[
0
]
==
StackEvent
.
POP
:
stack_depth
+=
1
elif
ev
[
0
]
==
StackEvent
.
PUSH
:
stack_depth
-=
1
if
stack_depth
==
0
:
stack_events
=
self
.
stack_events
[
-
index
:]
print
(
stack_events
)
break
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment