bactria
0.0.1
The bactria library is a header-only C++14 library for profiling and tracing.
|
Go to the documentation of this file.
32 #include <type_traits>
62 static bool const activated =
is_active() && (std::getenv(
"BACTRIA_REPORTS_PLUGIN") !=
nullptr);
128 using record_int8_t = std::add_pointer_t<void(
void*,
char const*, std::int8_t)>;
142 using record_uint8_t = std::add_pointer_t<void(
void*,
char const*, std::uint8_t)>;
156 using record_int16_t = std::add_pointer_t<void(
void*,
char const*, std::int16_t)>;
184 using record_int32_t = std::add_pointer_t<void(
void*,
char const*, std::int32_t)>;
212 using record_int64_t = std::add_pointer_t<void(
void*,
char const*, std::int64_t)>;
287 auto const path = std::getenv(
"BACTRIA_REPORTS_PLUGIN");
312 throw std::runtime_error{std::string{
"Failed to load bactria reports plugin "} + path};
328 return static_cast<void*
>(
nullptr);
364 [[gnu::always_inline]]
inline auto record_value(
void* report_handle,
char const* key,
bool value) ->
void
377 [[gnu::always_inline]]
inline auto record_value(
void* report_handle,
char const* key, std::int8_t value)
391 [[gnu::always_inline]]
inline auto record_value(
void* report_handle,
char const* key, std::uint8_t value)
405 [[gnu::always_inline]]
inline auto record_value(
void* report_handle,
char const* key, std::int16_t value)
419 [[gnu::always_inline]]
inline auto record_value(
void* report_handle,
char const* key, std::uint16_t value)
433 [[gnu::always_inline]]
inline auto record_value(
void* report_handle,
char const* key, std::int32_t value)
447 [[gnu::always_inline]]
inline auto record_value(
void* report_handle,
char const* key, std::uint32_t value)
461 [[gnu::always_inline]]
inline auto record_value(
void* report_handle,
char const* key, std::int64_t value)
475 [[gnu::always_inline]]
inline auto record_value(
void* report_handle,
char const* key, std::uint64_t value)
489 [[gnu::always_inline]]
inline auto record_value(
void* report_handle,
char const* key,
float value) ->
void
502 [[gnu::always_inline]]
inline auto record_value(
void* report_handle,
char const* key,
double value) ->
void
515 [[gnu::always_inline]]
inline auto record_value(
void* report_handle,
char const* key,
char const* value)
std::add_pointer_t< void(void *, char const *, float)> record_float_t
Signature for plugin function bactria_reports_record_float().
Definition: Plugin.hpp:240
auto record_int32_ptr
Pointer to plugin function bactria_reports_record_int32().
Definition: Plugin.hpp:191
bactria-internal plugin handling.
auto record_string_ptr
Pointer to plugin function bactria_reports_record_string().
Definition: Plugin.hpp:275
auto destroy_report_ptr
Pointer to plugin function bactria_reports_destroy_report().
Definition: Plugin.hpp:93
auto is_active() -> bool
Checks whether the bactria library has been deactivated by the user.
Definition: Activation.hpp:52
std::add_pointer_t< void(void *, char const *, std::uint64_t)> record_uint64_t
Signature for plugin function bactria_reports_record_uint64().
Definition: Plugin.hpp:226
auto record_uint32_ptr
Pointer to plugin function bactria_reports_record_uint32().
Definition: Plugin.hpp:205
auto create_report_ptr
Pointer to plugin function bactria_reports_create_report().
Definition: Plugin.hpp:79
auto create_report(char const *name)
Creates a plugin-specific report handle.
Definition: Plugin.hpp:323
auto record_float_ptr
Pointer to plugin function bactria_reports_record_float().
Definition: Plugin.hpp:247
auto record_int16_ptr
Pointer to plugin function bactria_reports_record_int16().
Definition: Plugin.hpp:163
auto record_double_ptr
Pointer to plugin function bactria_reports_record_double().
Definition: Plugin.hpp:261
auto record_uint8_ptr
Pointer to plugin function bactria_reports_record_uint8().
Definition: Plugin.hpp:149
auto load_func(plugin_handle_t handle, Sig &ptr, const char *name)
The POSIX-specific function loader.
Definition: POSIX.hpp:80
std::add_pointer_t< void(void *, char const *, std::uint32_t)> record_uint32_t
Signature for plugin function bactria_reports_record_uint32().
Definition: Plugin.hpp:198
std::add_pointer_t< void(void *, char const *, std::int32_t)> record_int32_t
Signature for plugin function bactria_reports_record_int32().
Definition: Plugin.hpp:184
auto activated() -> bool
Checks for an active reports plugin.
Definition: Plugin.hpp:60
auto destroy_report(void *report_handle) noexcept
Destroys a plugin-specific report handle.
Definition: Plugin.hpp:338
auto record_int8_ptr
Pointer to plugin function bactria_reports_record_int8().
Definition: Plugin.hpp:135
auto open_plugin(const char *path)
The POSIX-specific plugin loader.
Definition: POSIX.hpp:57
std::add_pointer_t< void(void *)> write_report_t
Signature for plugin function bactria_reports_write_report().
Definition: Plugin.hpp:100
auto record_uint64_ptr
Pointer to plugin function bactria_reports_record_uint64().
Definition: Plugin.hpp:233
auto write_report_ptr
Pointer to plugin function bactria_reports_write_report().
Definition: Plugin.hpp:107
auto record_uint16_ptr
Pointer to plugin function bactria_reports_record_uint16().
Definition: Plugin.hpp:177
system::plugin_handle_t plugin_handle_t
The platform-specific plugin handle type.
Definition: Plugin.hpp:41
auto record_int64_ptr
Pointer to plugin function bactria_reports_record_int64().
Definition: Plugin.hpp:219
std::add_pointer_t< void(void *, char const *, double)> record_double_t
Signature for plugin function bactria_reports_record_double().
Definition: Plugin.hpp:254
std::add_pointer_t< void(void *, char const *, std::int64_t)> record_int64_t
Signature for plugin function bactria_reports_record_int64().
Definition: Plugin.hpp:212
std::add_pointer_t< void(void *, char const *, std::int16_t)> record_int16_t
Signature for plugin function bactria_reports_record_int16().
Definition: Plugin.hpp:156
auto record_bool_ptr
Pointer to plugin function bactria_reports_record_bool().
Definition: Plugin.hpp:121
auto record_value(void *report_handle, char const *key, char const *value) -> void
Plugin-specific string recording.
Definition: Plugin.hpp:515
std::add_pointer_t< void(void *) noexcept > destroy_report_t
Signature for plugin function bactria_reports_destroy_report().
Definition: Plugin.hpp:86
auto write_report(void *report_handle)
Plugin-specific report writing.
Definition: Plugin.hpp:351
std::add_pointer_t< void(void *, char const *, std::uint8_t)> record_uint8_t
Signature for plugin function bactria_reports_record_uint8().
Definition: Plugin.hpp:142
auto load() -> plugin_handle_t
Initializes the reports plugin.
Definition: Plugin.hpp:285
std::add_pointer_t< void *(char const *)> create_report_t
Signature for plugin function bactria_reports_create_report().
Definition: Plugin.hpp:72
std::add_pointer_t< void(void *, char const *, char const *)> record_string_t
Signature for plugin function bactria_reports_record_string().
Definition: Plugin.hpp:268
std::add_pointer_t< void(void *, char const *, bool)> record_bool_t
Signature for plugin function bactria_reports_record_bool().
Definition: Plugin.hpp:114
std::add_pointer_t< void(void *, char const *, std::int8_t)> record_int8_t
Signature for plugin function bactria_reports_record_int8().
Definition: Plugin.hpp:128
std::add_pointer_t< void(void *, char const *, std::uint16_t)> record_uint16_t
Signature for plugin function bactria_reports_record_uint16().
Definition: Plugin.hpp:170