Support external (i.e. user-defined) trace annotations (#195)
* Support external (i.e. user-defined) trace annotations
- tweaked the python examples to be more balanced
- updated the user-api example to conform to user API changes
- moved the get/set for State and ThreadState to state.{hpp,cpp}
- introduced user-provided trace annotations
- added perfetto python category
- moved coverage impl files around
- created enumerations for mapping category enums to category types
- created enumerations for mapping annotation type enums to annotation values
- moved tracing::add_perfetto_annotations to tracing/annotation.hpp
- utility make_index_sequence_range
- libomnitrace-dl: omnitrace_push_category_region
- libomnitrace-dl: omnitrace_pop_category_region
- libomnitrace-user: omnitrace_user_push_annotated_region
- libomnitrace-user: omnitrace_user_pop_annotated_region
- libpyomnitrace: support extra annotations via annotate_trace config value
- filename
- line
- last attempted instr in bytecode (lasti)
- argcount
- num local variables
- stacksize
- omnitrace-python: -a / --annotate-traces option
* tweak ubuntu-focal workflow
* Fix installation of omnitrace-user headers
* ubuntu-focal-codecov workflow update
- Install texinfo
* Update timemory submodule
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
1b8f09aa2d
Коммит
642b6b95ca
@@ -244,55 +244,6 @@ get_preinit_bundle()
|
||||
return _v;
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
auto&
|
||||
get_thread_state_history(int64_t _idx = utility::get_thread_index())
|
||||
{
|
||||
static auto _v = utility::get_filled_array<OMNITRACE_MAX_THREADS>(
|
||||
[]() { return utility::get_reserved_vector<ThreadState>(32); });
|
||||
|
||||
return _v.at(_idx);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
ThreadState&
|
||||
get_thread_state()
|
||||
{
|
||||
static thread_local ThreadState _v{ ThreadState::Enabled };
|
||||
return _v;
|
||||
}
|
||||
|
||||
ThreadState
|
||||
set_thread_state(ThreadState _n)
|
||||
{
|
||||
auto _o = get_thread_state();
|
||||
get_thread_state() = _n;
|
||||
return _o;
|
||||
}
|
||||
|
||||
ThreadState
|
||||
push_thread_state(ThreadState _v)
|
||||
{
|
||||
if(get_thread_state() >= ThreadState::Completed) return get_thread_state();
|
||||
|
||||
return get_thread_state_history().emplace_back(set_thread_state(_v));
|
||||
}
|
||||
|
||||
ThreadState
|
||||
pop_thread_state()
|
||||
{
|
||||
if(get_thread_state() >= ThreadState::Completed) return get_thread_state();
|
||||
|
||||
auto& _hist = get_thread_state_history();
|
||||
if(!_hist.empty())
|
||||
{
|
||||
set_thread_state(_hist.back());
|
||||
_hist.pop_back();
|
||||
}
|
||||
return get_thread_state();
|
||||
}
|
||||
|
||||
bool
|
||||
sampling_enabled_on_child_threads()
|
||||
{
|
||||
|
||||
Ссылка в новой задаче
Block a user