Skip to content

Commit

Permalink
Fix thread_info::is_valid_time when threads do not terminate
Browse files Browse the repository at this point in the history
- was discarding samples
- timemory fixes for BFD support
  • Loading branch information
jrmadsen committed Sep 28, 2022
1 parent 730c1f3 commit 1f5381e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
16 changes: 12 additions & 4 deletions source/lib/omnitrace/library/components/pthread_create_gotcha.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,18 @@ pthread_create_gotcha::shutdown()

bundles->clear();

OMNITRACE_BASIC_VERBOSE(
1 && _ndangling > 0,
"[pthread_create_gotcha::shutdown] cleaned up %lu dangling bundles\n",
_ndangling);
if(config::settings_are_configured())
{
OMNITRACE_VERBOSE(2 && _ndangling > 0,
"[pthread_create_gotcha] cleaned up %lu dangling bundles\n",
_ndangling);
}
else
{
OMNITRACE_BASIC_VERBOSE(
2 && _ndangling > 0,
"[pthread_create_gotcha] cleaned up %lu dangling bundles\n", _ndangling);
}
}

void
Expand Down
8 changes: 4 additions & 4 deletions source/lib/omnitrace/library/sampling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,10 @@ post_process()

if(_data.empty())
{
OMNITRACE_VERBOSE(
3 || get_debug_sampling(),
"Sampler data for thread %lu has %zu valid entries... (skipped)\n", i,
_raw_data.size());
OMNITRACE_VERBOSE(2 || get_debug_sampling(),
"Sampler data for thread %lu has zero valid entries out of "
"%zu... (skipped)\n",
i, _raw_data.size());
continue;
}

Expand Down
13 changes: 9 additions & 4 deletions source/lib/omnitrace/library/thread_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,20 @@ init_index_data(int64_t _tid, bool _offset = false)
if(!itr)
{
threading::offset_this_id(_offset);
itr = thread_index_data{};
itr = thread_index_data{};
int _verb = 2;
// if thread created using finalization, bump up the minimum verbosity level
if(get_state() == State::Finalized && _offset) _verb += 2;
if(!config::settings_are_configured())
{
OMNITRACE_BASIC_VERBOSE_F(
2, "Thread %li on PID %i (rank: %i) assigned omnitrace TID %li\n",
_verb, "Thread %li on PID %i (rank: %i) assigned omnitrace TID %li\n",
itr->system_value, process::get_id(), dmp::rank(), itr->sequent_value);
}
else
{
OMNITRACE_VERBOSE_F(
2, "Thread %li on PID %i (rank: %i) assigned omnitrace TID %li\n",
_verb, "Thread %li on PID %i (rank: %i) assigned omnitrace TID %li\n",
itr->system_value, process::get_id(), dmp::rank(), itr->sequent_value);
}
}
Expand Down Expand Up @@ -149,10 +152,12 @@ thread_info::set_stop(uint64_t _ts)
{
for(auto& itr : thread_info_data_t::instances())
{
if(itr && itr->index_data && itr->index_data->internal_value > _tid)
if(itr && itr->index_data && itr->index_data->internal_value != _tid)
{
if(itr->lifetime.second > _v->lifetime.second)
itr->lifetime.second = _v->lifetime.second;
else if(itr->lifetime.second == 0)
itr->lifetime.second = _v->lifetime.second;
}
}
}
Expand Down

0 comments on commit 1f5381e

Please sign in to comment.