-
Notifications
You must be signed in to change notification settings - Fork 1
fix(callgrind): initialize stack on instrumentation start #15
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
Open
not-matthias
wants to merge
9
commits into
master
Choose a base branch
from
cod-2714-investigate-pytest-flamegraph-regression-final
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
669fa93
fix(callgrind): seed shadow call stack at instrumentation start
not-matthias c6fcb3b
test(callgrind): add regression tests for runtime obj-skip
not-matthias 7551ff2
test(callgrind): fail obj-skip tests when output file is missing
not-matthias 2bc4219
refactor(callgrind): use stack-local buffer for anon fn name
not-matthias f719d53
fix(callgrind): use unwinder ret addr directly without +1 offset
not-matthias 2cf9e8f
fix(callgrind): initialize nonskipped on seeded call entries
not-matthias 7b24da3
fix(callgrind): grow shadow stack before push_cxt during seeding
not-matthias 05e3842
fixup
not-matthias 21ab8bb
fixup: asdf
not-matthias File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| /* Minimal C reproducer for the runtime obj-skip leak: a fn from a | ||
| * skipped object ends up as a top-level fn= block in the callgrind | ||
| * output when it is the first BB instrumented after START. | ||
| * | ||
| * Strategy: register the lib for skip, then call into the lib BEFORE | ||
| * starting instrumentation. The lib itself calls | ||
| * CALLGRIND_START_INSTRUMENTATION mid-function, so the first BB | ||
| * processed by callgrind lives in the skipped object — which trips | ||
| * the (cxt == 0) push_cxt path that ignores the skip flag. */ | ||
|
|
||
| #define _GNU_SOURCE | ||
| #include <dlfcn.h> | ||
| #include <stdio.h> | ||
| #include "../callgrind.h" | ||
|
|
||
| extern void skipme_run(int n); | ||
|
|
||
| int main(void) | ||
| { | ||
| Dl_info info; | ||
| if (dladdr((void*)skipme_run, &info) == 0 || !info.dli_fname) { | ||
| fprintf(stderr, "dladdr failed\n"); | ||
| return 1; | ||
| } | ||
| CALLGRIND_ADD_OBJ_SKIP(info.dli_fname); | ||
|
|
||
| skipme_run(1000); | ||
|
|
||
| return 0; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| OK |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
|
|
||
|
|
||
| Events : Ir | ||
| Collected : | ||
|
|
||
| I refs: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| prereq: test -f runtime_obj_skip_c && test -f runtime_obj_skip_c_lib.so | ||
| prog-asis: ./runtime_obj_skip_c | ||
| vgopts: --instr-atstart=no --compress-strings=no --callgrind-out-file=callgrind.out.runtime_obj_skip_c | ||
| post: sh -c 'test -f callgrind.out.runtime_obj_skip_c || { echo "FAIL: callgrind output file missing"; exit 1; }; leaked=$(grep "^fn=skipme_" callgrind.out.runtime_obj_skip_c); if [ -n "$leaked" ]; then echo "FAIL: skipped fn leaked into top-level fn= block:"; echo "$leaked"; exit 1; else echo OK; fi' | ||
| cleanup: rm -f callgrind.out.runtime_obj_skip_c |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.