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:
Jonathan R. Madsen authored and GitHub committed 2022-08-31 06:29:19 -05:00
1 orang tua c2d6589b93
melakukan e67afd33eb
17 files changed
+390 -155

No files matched your search

@@ -22,7 +22,6 @@
#include "library/components/pthread_create_gotcha.hpp"
#include "library/components/category_region.hpp"
#include "library/components/pthread_gotcha.hpp"
#include "library/components/roctracer.hpp"
#include "library/config.hpp"
#include "library/debug.hpp"
@@ -213,9 +212,8 @@ pthread_create_gotcha::wrapper::operator()() const
if(m_enable_sampling)
{
_is_sampling = true;
pthread_gotcha::push_enable_sampling_on_child_threads(false);
OMNITRACE_SCOPED_SAMPLING_ON_CHILD_THREADS(false);
_signals = sampling::setup();
pthread_gotcha::pop_enable_sampling_on_child_threads();
sampling::unblock_signals();
}
}
@@ -336,7 +334,7 @@ pthread_create_gotcha::operator()(pthread_t* thread, const pthread_attr_t* attr,
auto _active = (get_state() == ::omnitrace::State::Active && !_disabled);
auto _coverage = (get_mode() == Mode::Coverage);
auto _use_sampling = get_use_sampling();
auto _sample_child = pthread_gotcha::sampling_enabled_on_child_threads();
auto _sample_child = sampling_enabled_on_child_threads();
auto _tid = utility::get_thread_index();
auto _use_bundle = (_active && !_coverage);
const auto& _info = thread_info::init(!_active || !_sample_child || _disabled);