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>
61 static bool const activated =
is_active() && (std::getenv(
"BACTRIA_RANGES_PLUGIN") !=
nullptr);
71 using create_event_t = std::add_pointer_t<
void*(std::uint32_t,
char const*, std::uint32_t) noexcept>;
100 = std::add_pointer_t<void(
void*,
char const*,
char const*, std::uint32_t,
char const*) noexcept>;
115 = std::add_pointer_t<
void*(
char const*, std::uint32_t,
char const*, std::uint32_t) noexcept>;
177 auto const path = std::getenv(
"BACTRIA_RANGES_PLUGIN");
195 throw std::runtime_error{std::string{
"Failed to load bactria ranges plugin "} + path};
207 char const* cat_name,
208 std::uint32_t cat_id) noexcept
213 return static_cast<void*
>(
nullptr);
223 [[gnu::always_inline]]
inline auto destroy_event(
void* event_handle) noexcept
238 char const* event_name,
240 std::uint32_t lineno,
241 char const* caller) noexcept
244 (
fire_event_ptr)(event_handle, event_name, source, lineno, caller);
257 char const* cat_name,
258 std::uint32_t cat_id) noexcept
263 return static_cast<void*
>(
nullptr);
273 [[gnu::always_inline]]
inline auto destroy_range(
void* range_handle) noexcept
286 [[gnu::always_inline]]
inline auto start_range(
void* range_handle) noexcept
299 [[gnu::always_inline]]
inline auto stop_range(
void* range_handle) noexcept
auto destroy_range_ptr
Pointer to plugin function bactria_ranges_destroy_range().
Definition: Plugin.hpp:136
bactria-internal plugin handling.
auto stop_range(void *range_handle) noexcept
Plugin-specific range stopping.
Definition: Plugin.hpp:299
auto fire_event_ptr
Pointer to plugin function bactria_ranges_fire_event().
Definition: Plugin.hpp:107
std::add_pointer_t< void(void *) noexcept > stop_range_t
Signature for plugin function bactria_ranges_stop_range().
Definition: Plugin.hpp:158
std::add_pointer_t< void(void *) noexcept > destroy_event_t
Signature for plugin function bactria_ranges_destroy_event().
Definition: Plugin.hpp:85
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 *) noexcept > destroy_range_t
Signature for plugin function bactria_ranges_destroy_range().
Definition: Plugin.hpp:129
auto load_func(plugin_handle_t handle, Sig &ptr, const char *name)
The POSIX-specific function loader.
Definition: POSIX.hpp:80
auto start_range(void *range_handle) noexcept
Plugin-specific range starting.
Definition: Plugin.hpp:286
auto create_event_ptr
Pointer to plugin function bactria_ranges_create_event().
Definition: Plugin.hpp:78
auto activated() -> bool
Checks for an active reports plugin.
Definition: Plugin.hpp:60
auto start_range_ptr
Pointer to plugin function bactria_ranges_start_range().
Definition: Plugin.hpp:151
auto destroy_event(void *event_handle) noexcept
Destroys a plugin-specific event handle.
Definition: Plugin.hpp:223
auto open_plugin(const char *path)
The POSIX-specific plugin loader.
Definition: POSIX.hpp:57
system::plugin_handle_t plugin_handle_t
The platform-specific plugin handle type.
Definition: Plugin.hpp:41
auto create_range(char const *name, std::uint32_t color, char const *cat_name, std::uint32_t cat_id) noexcept
Creates a plugin-specific range handle.
Definition: Plugin.hpp:254
auto create_range_ptr
Pointer to plugin function bactria_ranges_create_range().
Definition: Plugin.hpp:122
auto destroy_range(void *range_handle) noexcept
Destroys a plugin-specific range handle.
Definition: Plugin.hpp:273
std::add_pointer_t< void *(char const *, std::uint32_t, char const *, std::uint32_t) noexcept > create_range_t
Signature for plugin function bactria_ranges_create_range().
Definition: Plugin.hpp:115
auto create_event(std::uint32_t color, char const *cat_name, std::uint32_t cat_id) noexcept
Creates a plugin-specific event handle.
Definition: Plugin.hpp:205
auto fire_event(void *event_handle, char const *event_name, char const *source, std::uint32_t lineno, char const *caller) noexcept
Plugin-specific event firing.
Definition: Plugin.hpp:236
auto stop_range_ptr
Pointer to plugin function bactria_ranges_stop_range().
Definition: Plugin.hpp:165
auto load() -> plugin_handle_t
Initializes the reports plugin.
Definition: Plugin.hpp:285
std::add_pointer_t< void(void *, char const *, char const *, std::uint32_t, char const *) noexcept > fire_event_t
Signature for plugin function bactria_ranges_fire_event().
Definition: Plugin.hpp:100
auto destroy_event_ptr
Pointer to plugin function bactria_ranges_destroy_event().
Definition: Plugin.hpp:92
std::add_pointer_t< void(void *) noexcept > start_range_t
Signature for plugin function bactria_ranges_start_range().
Definition: Plugin.hpp:143
std::add_pointer_t< void *(std::uint32_t, char const *, std::uint32_t) noexcept > create_event_t
Signature for plugin function bactria_ranges_create_event().
Definition: Plugin.hpp:71