Update config generation, join fix, sampler (#129)
- update timemory submodule - update ring_buffer to remove all dynamic allocation - update sampler + sampler allocator to use ring-buffers - fix papi_array and papi_vector labels - fix common::join with char delimiter - fix config generation without --advanced
Esse commit está contido em:
externo
+1
-1
Submodule external/timemory updated: 6baee4c8d9...1f4e7602a4
@@ -82,6 +82,10 @@ ignore_setting(const Tp& _v)
|
||||
category_view.count("settings::deprecated") == 0 &&
|
||||
_v->get_categories().count("deprecated") > 0)
|
||||
return true;
|
||||
if(category_view.count("advanced") == 0 &&
|
||||
category_view.count("settings::advanced") == 0 &&
|
||||
_v->get_categories().count("advanced") > 0)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
} // namespace
|
||||
@@ -175,7 +179,8 @@ void pop(type_list<Tp...>)
|
||||
type_list<std::string>{}));
|
||||
}
|
||||
|
||||
void update_choices(std::shared_ptr<settings>);
|
||||
void
|
||||
update_choices(const std::shared_ptr<settings>&);
|
||||
|
||||
void
|
||||
generate_config(std::string _config_file, const std::set<std::string>& _config_fmts,
|
||||
@@ -406,7 +411,7 @@ generate_config(std::string _config_file, const std::set<std::string>& _config_f
|
||||
_open(ofs, _fname, "text")
|
||||
<< "# auto-generated by omnitrace-avail (version " << OMNITRACE_VERSION_STRING
|
||||
<< ") on " << tim::get_local_datetime("%F @ %H:%M", &_time) << "\n\n"
|
||||
<< _ss.str() << "\n";
|
||||
<< _ss.str();
|
||||
}
|
||||
|
||||
// restores the original serializer
|
||||
@@ -416,7 +421,7 @@ generate_config(std::string _config_file, const std::set<std::string>& _config_f
|
||||
}
|
||||
|
||||
void
|
||||
update_choices(std::shared_ptr<settings> _settings)
|
||||
update_choices(const std::shared_ptr<settings>& _settings)
|
||||
{
|
||||
std::vector<info_type> _info = get_component_info<TIMEMORY_NATIVE_COMPONENTS_END>();
|
||||
|
||||
|
||||
@@ -79,16 +79,22 @@ template <typename DelimT, typename... Args>
|
||||
auto
|
||||
join(DelimT&& _delim, Args&&... _args)
|
||||
{
|
||||
using delim_type = std::remove_cv_t<std::remove_reference_t<DelimT>>;
|
||||
|
||||
std::stringstream _ss{};
|
||||
_ss << std::boolalpha;
|
||||
OMNITRACE_FOLD_EXPRESSION(_ss << _delim << _args);
|
||||
auto _ret = _ss.str();
|
||||
if constexpr(std::is_same<DelimT, char>::value)
|
||||
|
||||
if constexpr(std::is_same<delim_type, char>::value)
|
||||
{
|
||||
const char _delim_c[2] = { _delim, '\0' };
|
||||
OMNITRACE_FOLD_EXPRESSION(_ss << _delim_c << _args);
|
||||
auto _ret = _ss.str();
|
||||
return (_ret.length() > 1) ? _ret.substr(1) : std::string{};
|
||||
}
|
||||
else
|
||||
{
|
||||
OMNITRACE_FOLD_EXPRESSION(_ss << _delim << _args);
|
||||
auto _ret = _ss.str();
|
||||
auto&& _len = std::string{ _delim }.length();
|
||||
return (_ret.length() > _len) ? _ret.substr(_len) : std::string{};
|
||||
}
|
||||
@@ -101,16 +107,22 @@ template <typename DelimT, typename... Args>
|
||||
auto
|
||||
join(QuoteStrings&&, DelimT&& _delim, Args&&... _args)
|
||||
{
|
||||
using delim_type = std::remove_cv_t<std::remove_reference_t<DelimT>>;
|
||||
|
||||
std::stringstream _ss{};
|
||||
_ss << std::boolalpha;
|
||||
OMNITRACE_FOLD_EXPRESSION(_ss << _delim << as_string(_args));
|
||||
auto _ret = _ss.str();
|
||||
if constexpr(std::is_same<DelimT, char>::value)
|
||||
|
||||
if constexpr(std::is_same<delim_type, char>::value)
|
||||
{
|
||||
const char _delim_c[2] = { _delim, '\0' };
|
||||
OMNITRACE_FOLD_EXPRESSION(_ss << _delim_c << as_string(_args));
|
||||
auto _ret = _ss.str();
|
||||
return (_ret.length() > 1) ? _ret.substr(1) : std::string{};
|
||||
}
|
||||
else
|
||||
{
|
||||
OMNITRACE_FOLD_EXPRESSION(_ss << _delim << as_string(_args));
|
||||
auto _ret = _ss.str();
|
||||
auto&& _len = std::string{ _delim }.length();
|
||||
return (_ret.length() > _len) ? _ret.substr(_len) : std::string{};
|
||||
}
|
||||
|
||||
@@ -425,7 +425,6 @@ backtrace::configure(bool _setup, int64_t _tid)
|
||||
}
|
||||
|
||||
_sampler->stop();
|
||||
_sampler->swap_data();
|
||||
if constexpr(tim::trait::is_available<hw_counters>::value)
|
||||
{
|
||||
if(_tid == threading::get_id())
|
||||
@@ -653,27 +652,29 @@ backtrace::post_process(int64_t _tid)
|
||||
"end_ns", _end_ns);
|
||||
};
|
||||
|
||||
auto _raw_data = _sampler->get_allocator().get_data();
|
||||
_sampler->stop();
|
||||
auto _raw_data = _sampler->get_data();
|
||||
OMNITRACE_CI_THROW(
|
||||
_sampler->get_sample_count() != _raw_data.size(),
|
||||
"Error! sampler recorded %zu samples but %zu samples were returned\n",
|
||||
_sampler->get_sample_count(), _raw_data.size());
|
||||
// single sample that is useless (backtrace to unblocking signals)
|
||||
if(_raw_data.size() == 1 && _raw_data.front().size() <= 1) _raw_data.clear();
|
||||
|
||||
std::vector<sampling::bundle_t*> _data{};
|
||||
for(auto& ditr : _raw_data)
|
||||
for(auto& itr : _raw_data)
|
||||
{
|
||||
_data.reserve(_data.size() + ditr.size());
|
||||
for(auto& ritr : ditr)
|
||||
_data.reserve(_data.size() + itr.size());
|
||||
auto* _bt = itr.get<backtrace>();
|
||||
if(!_bt)
|
||||
{
|
||||
auto* _bt = ritr.get<backtrace>();
|
||||
if(!_bt)
|
||||
{
|
||||
OMNITRACE_PRINT(
|
||||
"Warning! Nullptr to backtrace instance for thread %lu...\n", _tid);
|
||||
continue;
|
||||
}
|
||||
if(_bt->empty()) continue;
|
||||
if(!pthread_create_gotcha::is_valid_execution_time(_tid, _bt->m_ts)) continue;
|
||||
_data.emplace_back(&ritr);
|
||||
OMNITRACE_PRINT("Warning! Nullptr to backtrace instance for thread %lu...\n",
|
||||
_tid);
|
||||
continue;
|
||||
}
|
||||
if(_bt->empty()) continue;
|
||||
if(!pthread_create_gotcha::is_valid_execution_time(_tid, _bt->m_ts)) continue;
|
||||
_data.emplace_back(&itr);
|
||||
}
|
||||
|
||||
if(_data.empty()) return;
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário