Support sampling duration, sampling TIDs (#142)
- Sampling duration config values - OMNITRACE_SAMPLING_DURATION - OMNITRACE_PROCESS_SAMPLING_DURATION - Disables sampling after this time (in seconds) has elapsed - Sampling thread-id config values - OMNITRACE_SAMPLING_TIDS - OMNITRACE_SAMPLING_CPUTIME_TIDS - OMNITRACE_SAMPLING_REALTIME_TIDS - Allows user to select certain threads for sampling - Miscellaneous - Tweaked the finalization verbosity messages - moved sampling-on-child-threads into runtime.hpp and runtime.cpp - fixed submodule dyninst header install
This commit is contained in:
committed by
GitHub
parent
c2d6589b93
commit
e67afd33eb
@@ -69,14 +69,6 @@ namespace
|
||||
using bundle_t = tim::lightweight_tuple<component::pthread_create_gotcha_t,
|
||||
component::pthread_mutex_gotcha_t>;
|
||||
|
||||
auto&
|
||||
get_sampling_on_child_threads_history(int64_t _idx = utility::get_thread_index())
|
||||
{
|
||||
static auto _v = utility::get_filled_array<OMNITRACE_MAX_THREADS>(
|
||||
[]() { return utility::get_reserved_vector<bool>(32); });
|
||||
return _v.at(_idx);
|
||||
}
|
||||
|
||||
auto&
|
||||
get_bundle()
|
||||
{
|
||||
@@ -112,51 +104,6 @@ pthread_gotcha::shutdown()
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
pthread_gotcha::sampling_enabled_on_child_threads()
|
||||
{
|
||||
return sampling_on_child_threads();
|
||||
}
|
||||
|
||||
bool
|
||||
pthread_gotcha::push_enable_sampling_on_child_threads(bool _v)
|
||||
{
|
||||
bool _last = sampling_on_child_threads();
|
||||
sampling_on_child_threads() = _v;
|
||||
auto& _hist = get_sampling_on_child_threads_history();
|
||||
_hist.emplace_back(_last);
|
||||
return _last;
|
||||
}
|
||||
|
||||
bool
|
||||
pthread_gotcha::pop_enable_sampling_on_child_threads()
|
||||
{
|
||||
auto& _hist = get_sampling_on_child_threads_history();
|
||||
if(!_hist.empty())
|
||||
{
|
||||
bool _restored = _hist.back();
|
||||
_hist.pop_back();
|
||||
sampling_on_child_threads() = _restored;
|
||||
}
|
||||
return sampling_on_child_threads();
|
||||
}
|
||||
|
||||
void
|
||||
pthread_gotcha::set_sampling_on_all_future_threads(bool _v)
|
||||
{
|
||||
for(size_t i = 0; i < max_supported_threads; ++i)
|
||||
get_sampling_on_child_threads_history(i).emplace_back(_v);
|
||||
}
|
||||
|
||||
bool&
|
||||
pthread_gotcha::sampling_on_child_threads()
|
||||
{
|
||||
static thread_local bool _v = get_sampling_on_child_threads_history().empty()
|
||||
? false
|
||||
: get_sampling_on_child_threads_history().back();
|
||||
return _v;
|
||||
}
|
||||
|
||||
void
|
||||
pthread_gotcha::start()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user