Sampler improvements (#22)

* Sampler improvements

- roctracer_flush_activity
- papi_array in backtrace
- fixed sampler trait specializations
- split main_bundle into main and gotcha bundles
- cmake option display

* timemory update

* EINTR handling + debug_{pid,tid}

- sampler handles EINTR for sem_init and sem_destroy
- OMNITRACE_DEBUG_{TIDS,PIDS} env variables

* Increase waitForStatusChange
Dieser Commit ist enthalten in:
Jonathan R. Madsen
2022-01-27 21:31:08 -06:00
committet von GitHub
Ursprung 8648410309
Commit eccba14f00
14 geänderte Dateien mit 433 neuen und 372 gelöschten Zeilen
+15 -2
Datei anzeigen
@@ -34,15 +34,19 @@
#include <timemory/backends/threading.hpp>
#include <string>
#include <string_view>
#include <unordered_set>
namespace omnitrace
{
// bundle of components around omnitrace_init and omnitrace_finalize
using main_bundle_t =
tim::lightweight_tuple<comp::wall_clock, comp::peak_rss, comp::cpu_clock,
comp::cpu_util, comp::roctracer, comp::user_global_bundle,
fork_gotcha_t, mpi_gotcha_t, pthread_gotcha_t>;
comp::cpu_util, comp::roctracer>;
using gotcha_bundle_t =
tim::lightweight_tuple<fork_gotcha_t, mpi_gotcha_t, pthread_gotcha_t>;
// bundle of components used in instrumentation
using instrumentation_bundle_t =
@@ -88,6 +92,12 @@ get_debug_env();
bool
get_debug();
bool
get_debug_tid();
bool
get_debug_pid();
int
get_verbose_env();
@@ -184,6 +194,9 @@ get_state();
std::unique_ptr<main_bundle_t>&
get_main_bundle();
std::unique_ptr<gotcha_bundle_t>&
get_gotcha_bundle();
std::atomic<uint64_t>&
get_cpu_cid();
+9 -3
Datei anzeigen
@@ -36,13 +36,19 @@ namespace omnitrace
bool
get_debug();
bool
get_debug_tid();
bool
get_debug_pid();
bool
get_critical_trace_debug();
} // namespace omnitrace
#if defined(TIMEMORY_USE_MPI)
# define OMNITRACE_CONDITIONAL_PRINT(COND, ...) \
if(COND) \
if((COND) && get_debug_tid() && get_debug_pid()) \
{ \
fflush(stderr); \
tim::auto_lock_t _lk{ tim::type_mutex<decltype(std::cerr)>() }; \
@@ -53,7 +59,7 @@ get_critical_trace_debug();
}
#else
# define OMNITRACE_CONDITIONAL_PRINT(COND, ...) \
if(COND) \
if((COND) && get_debug_tid() && get_debug_pid()) \
{ \
fflush(stderr); \
tim::auto_lock_t _lk{ tim::type_mutex<decltype(std::cerr)>() }; \
@@ -65,7 +71,7 @@ get_critical_trace_debug();
#endif
#define OMNITRACE_CONDITIONAL_BASIC_PRINT(COND, ...) \
if(COND) \
if((COND) && get_debug_tid() && get_debug_pid()) \
{ \
fflush(stderr); \
tim::auto_lock_t _lk{ tim::type_mutex<decltype(std::cerr)>() }; \
+12
Datei anzeigen
@@ -49,6 +49,9 @@ using component::sampling_cpu_clock;
using component::sampling_percent;
using component::sampling_wall_clock;
std::unique_ptr<std::set<int>>&
get_signal_types(int64_t _tid);
std::set<int>
setup();
@@ -68,3 +71,12 @@ get_sampler(int64_t _tid = threading::get_id());
} // namespace sampling
} // namespace omnitrace
TIMEMORY_DEFINE_CONCRETE_TRAIT(prevent_reentry, omnitrace::sampling::sampler_t,
std::true_type)
TIMEMORY_DEFINE_CONCRETE_TRAIT(check_signals, omnitrace::sampling::sampler_t,
std::false_type)
TIMEMORY_DEFINE_CONCRETE_TRAIT(buffer_size, omnitrace::sampling::sampler_t,
TIMEMORY_ESC(std::integral_constant<size_t, 256>))