6#include "../formatters/json.hpp"
7#include "../markdown.hpp"
32 out.write(
"SUSPENDED");
38 out.write(
"TERMINATED");
65 uint32_t cpu_ticks{0};
66 uint32_t memory_usage{0};
76 void *extended_metadata_ctx{
nullptr};
80 void *thread_next_ctx{
nullptr};
88 bool in_extended{
false};
96 the_state.task =
this;
98 the_state.in_extended =
false;
102 if (s ==
nullptr || s->task ==
nullptr)
106 if (!s->in_extended) {
110 out.
val_ptr = &s->task->team_id;
111 out.
print_fn = [](
const void *p,
const sink &s_out)
noexcept {
112 detail::format_unsigned<detail::radix::decimal>(s_out, *
static_cast<const uint64_t *
>(p),
false);
118 out.
print_fn = [](
const void *p,
const sink &s_out)
noexcept {
119 json::write_escaped_string(s_out, *
static_cast<const string_view *
>(p));
125 out.
print_fn = [](
const void *p,
const sink &s_out)
noexcept {
128 fmt.parse(parse_context);
133 out.
key =
"priority";
134 out.
val_ptr = &s->task->priority;
135 out.
print_fn = [](
const void *p,
const sink &s_out)
noexcept {
136 detail::format_unsigned<detail::radix::decimal>(s_out, *
static_cast<const uint8_t *
>(p),
false);
140 out.
key =
"cpu_ticks";
141 out.
val_ptr = &s->task->cpu_ticks;
142 out.
print_fn = [](
const void *p,
const sink &s_out)
noexcept {
143 detail::format_unsigned<detail::radix::decimal>(s_out, *
static_cast<const uint32_t *
>(p),
false);
147 out.
key =
"memory_usage";
148 out.
val_ptr = &s->task->memory_usage;
149 out.
print_fn = [](
const void *p,
const sink &s_out)
noexcept {
150 detail::format_unsigned<detail::radix::decimal>(s_out, *
static_cast<const uint32_t *
>(p),
false);
154 s->in_extended =
true;
160 if (s->in_extended) {
161 if (s->task->extended_metadata_fn !=
nullptr && s->task->extended_metadata_ctx !=
nullptr) {
162 return s->task->extended_metadata_fn(s->task->extended_metadata_ctx, out);
176 if (thread_next_fn !=
nullptr && thread_next_ctx !=
nullptr) {
177 return thread_next_fn(thread_next_ctx, out_thread);
Type-erased remote address-space access and remote string/object views.
Type-erased, two-word handle to a remote address space.
Definition address_space.hpp:204
Type-erased, two-word handle to an ELF image enumerator.
Definition elf_enumerator.hpp:104
Definition microfmt.hpp:881
#define MICROFMT_API_CLASS
Definition compat.hpp:181
ELF image introspection, type-erased image enumeration, and fixed-capacity registries.
reloco::sink sink
Type-erased, zero-allocation output sink.
Definition microfmt.hpp:46
bool(*)(void *ctx, thread_info &out) noexcept thread_next_fn_t
Function pointer signature for generating/iterating threads belonging to a task.
Definition task.hpp:54
bool(*)(void *ctx, property_entry &out) noexcept metadata_next_fn_t
Function pointer signature for fetching the next property entry.
Definition metadata_map.hpp:48
task_state
Definition task.hpp:15
Type-erased property entry synthesized during generation.
Definition metadata_map.hpp:24
property_print_fn_t print_fn
Definition metadata_map.hpp:27
microfmt::string_view key
Definition metadata_map.hpp:25
value_ptr< const void > val_ptr
Definition metadata_map.hpp:26
Comprehensive system task (Team) descriptor.
Definition task.hpp:59
constexpr bool get_next_thread(thread_info &out_thread) const noexcept
Fetches the next thread belonging to this task using the abstract thread generator.
Definition task.hpp:175
metadata_map make_metadata_view(metadata_state &) const &&=delete
constexpr metadata_map make_metadata_view(metadata_state &the_state) const &noexcept RELOCO_LIFETIMEBOUND
Exposes a unified metadata_map view for classic task data and extended metadata.
Definition task.hpp:95
Thread descriptor containing thread-specific attributes and CPU register context access.
Definition thread.hpp:58
Thread descriptor with telemetry and register context integration.