instrumentation: include functions with specific calls (#202)
* instrumentation: include functions with specific calls
Add the option `--caller-include <regex>` or environment variable
`OMNITRACE_REGEX_CALLER_INCLUDE` to instrument functions which contain
call to a set of functions, E.g. `--caller-include foo` instruments any
function which calls `foo`.
* Serialize caller include information
* Add test for caller include
* Tweak to the caller include test
- tweak environment
- tweak pass regexes
* Set rewrite caller example to debug
, to avoid optimizing out the call expressions that it relies on.
Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
[ROCm/rocprofiler-systems commit: 1b8f09aa2d]
이 커밋은 다음에 포함됨:
@@ -333,7 +333,7 @@ module_function::is_user_included() const
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return contains_user_callsite();
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -534,6 +534,27 @@ module_function::contains_dynamic_callsites() const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
module_function::contains_user_callsite() const
|
||||
{
|
||||
if(caller_include.empty()) return false;
|
||||
|
||||
bpvector_t<BPatch_point*> call_points;
|
||||
function->getCallPoints(call_points);
|
||||
for(const auto& call_point : call_points)
|
||||
{
|
||||
if(check_regex_restrictions(
|
||||
std::string(get_name(call_point->getCalledFunction())), caller_include))
|
||||
{
|
||||
messages.emplace_back(2, "Forcing", "function", "caller-include-regex",
|
||||
function_name);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
module_function::is_dynamic_callsite_forced() const
|
||||
{
|
||||
|
||||
새 이슈에서 참조
사용자 차단