-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[lldb] Avoid force loading symbol files in statistics collection #129593
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
bca07d6
Avoid force loading symbol files in statistics collection
dmpots 2a64754
Add unit test for new GetSymtab overload
dmpots 86b8e93
Create target without loading dependents
dmpots b63d34a
Add comment explaning assumption around symbol loading
dmpots 44dea6a
Extend unit test to show that we cache the symbol table
dmpots 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# This test validates that statistics generation does not force loading | ||
# symbol tables. In order to avoid other sources of symbol loading we | ||
# create the target without loading dependents and do not actually | ||
# run it. Running the target is a problem because there are various | ||
# instrumentation plugins (e.g. ASAN) that are always enabled and force | ||
# symbol loading. If you see this test start to fail we may have added | ||
# a new source of symbol loading unexpectedly. | ||
|
||
# Build a simple test executable. | ||
# RUN: %clang_host -g %S/Inputs/main.c -o %t-main.exe | ||
|
||
# When we enable symbol preload and dump stats there should be a non-zero | ||
# time for parsing symbol tables for the main module. | ||
# RUN: %lldb -O "settings set plugin.jit-loader.gdb.enable off" \ | ||
# RUN: -O "settings set target.preload-symbols true" \ | ||
# RUN: -o 'target create --no-dependents "%t-main.exe"' \ | ||
# RUN: -o "statistics dump" \ | ||
# RUN: -o "q" \ | ||
# RUN: | FileCheck %s -check-prefixes=CHECK,PRELOAD_TRUE | ||
|
||
# Find the module stats for the main executable and make sure | ||
# we are looking at the symbol parse time for that module. | ||
# CHECK: "modules": [ | ||
# CHECK: { | ||
# CHECK: "path": {{.*}}-main.exe | ||
# CHECK-NOT: } | ||
|
||
# PRELOAD_TRUE: "symbolTableParseTime": | ||
# PRELOAD_TRUE-SAME: {{[1-9]+}} | ||
|
||
# When we disable symbol preload and dump stats the symbol table | ||
# for main should not be parsed and have a time of 0. | ||
# RUN: %lldb -O "settings set plugin.jit-loader.gdb.enable off" \ | ||
# RUN: -O "settings set target.preload-symbols false" \ | ||
# RUN: -o 'target create --no-dependents "%t-main.exe"' \ | ||
# RUN: -o "statistics dump" \ | ||
# RUN: -o "q" \ | ||
# RUN: | FileCheck %s -check-prefixes=CHECK,PRELOAD_FALSE | ||
|
||
# PRELOAD_FALSE: "symbolTableParseTime": 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
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.