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
This commit is contained in:
Jonathan R. Madsen
2022-11-11 07:31:14 -06:00
committed by GitHub
parent 1b8f09aa2d
commit 642b6b95ca
40 changed files with 1280 additions and 430 deletions
-23
View File
@@ -107,23 +107,6 @@ get_cpu_cid_entry(uint64_t _cid, int64_t _tid = threading::get_id()) TIMEMORY_HO
tim::mutex_t&
get_cpu_cid_stack_lock(int64_t _tid = threading::get_id()) TIMEMORY_HOT;
ThreadState&
get_thread_state() TIMEMORY_HOT;
/// returns old state
ThreadState set_thread_state(ThreadState) TIMEMORY_HOT;
ThreadState push_thread_state(ThreadState) TIMEMORY_HOT;
ThreadState
pop_thread_state() TIMEMORY_HOT;
struct scoped_thread_state
{
scoped_thread_state(ThreadState _v) { push_thread_state(_v); }
~scoped_thread_state() { pop_thread_state(); }
};
// query current value
bool
sampling_enabled_on_child_threads();
@@ -147,12 +130,6 @@ struct scoped_child_sampling
};
} // namespace omnitrace
#define OMNITRACE_SCOPED_THREAD_STATE(STATE) \
::omnitrace::scoped_thread_state OMNITRACE_VARIABLE(_scoped_thread_state_, __LINE__) \
{ \
::omnitrace::STATE \
}
#define OMNITRACE_SCOPED_SAMPLING_ON_CHILD_THREADS(VALUE) \
::omnitrace::scoped_child_sampling OMNITRACE_VARIABLE(_scoped_child_sampling_, \
__LINE__) \