-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Use pkgimages for coverage & malloc tracking by ignoring native code in tracked packages #52123
Changes from all commits
1fdaace
d7d28ca
448876b
a56b586
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8450,15 +8450,19 @@ static jl_llvm_functions_t | |
cursor = -1; | ||
}; | ||
|
||
// If a pkgimage or sysimage is being generated, disable tracking. | ||
// This means sysimage build or pkgimage precompilation workloads aren't tracked. | ||
auto do_coverage = [&] (bool in_user_code, bool is_tracked) { | ||
return (coverage_mode == JL_LOG_ALL || | ||
return (jl_generating_output() == 0 && | ||
(coverage_mode == JL_LOG_ALL || | ||
(in_user_code && coverage_mode == JL_LOG_USER) || | ||
(is_tracked && coverage_mode == JL_LOG_PATH)); | ||
(is_tracked && coverage_mode == JL_LOG_PATH))); | ||
}; | ||
auto do_malloc_log = [&] (bool in_user_code, bool is_tracked) { | ||
return (malloc_log_mode == JL_LOG_ALL || | ||
return (jl_generating_output() == 0 && | ||
(malloc_log_mode == JL_LOG_ALL || | ||
(in_user_code && malloc_log_mode == JL_LOG_USER) || | ||
(is_tracked && malloc_log_mode == JL_LOG_PATH)); | ||
(is_tracked && malloc_log_mode == JL_LOG_PATH))); | ||
Comment on lines
+8453
to
+8465
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is to avoid baking tracking-enabled native code into pkgimages, which is likely undesirable (though arguably reasonable in CI environments) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps it could be allowed if And in that case we wouldn't need to zero out the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe @Keno has an idea on how to handle IIUC the problem is that So right now I don't see away around us needing at least those two copies. |
||
}; | ||
SmallVector<unsigned, 0> current_lineinfo, new_lineinfo; | ||
auto coverageVisitStmt = [&] (size_t dbg) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name = "CovTest" | ||
uuid = "f1f4390d-b815-473a-b5dd-5af6e1d717cb" | ||
version = "0.1.0" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# This file is a part of Julia. License is MIT: https://julialang.org/license | ||
|
||
module CovTest | ||
|
||
function foo() | ||
x = 1 | ||
y = 2 | ||
z = x * y | ||
return z | ||
end | ||
|
||
function bar() | ||
x = 1 | ||
y = 2 | ||
z = x * y | ||
return z | ||
end | ||
|
||
if Base.generating_output() | ||
# precompile foo but not bar | ||
foo() | ||
end | ||
|
||
export foo, bar | ||
|
||
end #module |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should check that malloc_log/code_coverage don't reach the
generating-ouput
process?