wlmaker
Loading...
Searching...
No Matches
wlm_graph_app_config_t Struct Reference

#include <wlm_graph_shared.h>

Public Attributes

const char * app_name
const char * app_help
wlm_graph_mode_t accumulate_mode
wlm_graph_read_result_t(* stats_read_fn )(void *app_state, wlm_graph_values_t *values)
void(* regenerate_fn )(void *app_state, wlm_graph_values_t *samples, uint32_t sample_count)
void * app_state
void(* state_free_fn )(void *app_state)
const uint32_t * pixel_lut
const char *(* label_fn )(void *app_state)

Detailed Description

Configuration for a graph application.

Pass to wlm_graph_app_run() to configure the graph behavior.

Member Data Documentation

◆ accumulate_mode

wlm_graph_mode_t wlm_graph_app_config_t::accumulate_mode

Sample accumulation mode.

◆ app_help

const char* wlm_graph_app_config_t::app_help

Application help string. Shown in –help output.

◆ app_name

const char* wlm_graph_app_config_t::app_name

Application name (e.g., "wlmcpugraph"). Used for error messages.

◆ app_state

void* wlm_graph_app_config_t::app_state

App-specific state pointer, passed to callbacks.

◆ label_fn

const char *(* wlm_graph_app_config_t::label_fn) (void *app_state)

Optional callback to get a label string for display.

Called during rendering. The returned string is displayed in the bottom-left corner of the graph. Return NULL to display no label.

Parameters
app_stateThe app_state pointer from this config.
Returns
Label string (caller retains ownership), or NULL.

◆ pixel_lut

const uint32_t* wlm_graph_app_config_t::pixel_lut

Optional custom pixel lookup table (256 entries, ARGB32 format).

If non-NULL, overrides the default heat-map LUT. Index 0 maps to lowest intensity (single value active), index 255 to highest (all values active). Each entry should be fully opaque (0xff000000 | color).

◆ regenerate_fn

void(* wlm_graph_app_config_t::regenerate_fn) (void *app_state, wlm_graph_values_t *samples, uint32_t sample_count)

Optional callback to regenerate historical samples after scale change.

Called when stats_read_fn returns WLM_GRAPH_READ_OK_AND_REGENERATE. The callback should fill the samples array with regenerated values at the new scale. The current sample (that requested regeneration) is NOT included; it was already filled at the new scale by stats_read_fn. Samples are ordered newest to oldest (index 0 is the sample just before the current one). Samples without available history must have their data cleared.

Parameters
app_stateThe app_state pointer from this config.
samplesArray of sample buffers to regenerate (excludes current).
sample_countNumber of samples in the array.

◆ state_free_fn

void(* wlm_graph_app_config_t::state_free_fn) (void *app_state)

Callback to free app-specific state.

Called during cleanup to free resources in app_state.

Parameters
app_stateThe app_state pointer from this config.

◆ stats_read_fn

wlm_graph_read_result_t(* wlm_graph_app_config_t::stats_read_fn) (void *app_state, wlm_graph_values_t *values)

Callback to read stats from the system.

Called periodically to fill the values buffer. The callback owns buffer reallocation: if values->num doesn't match the required count, reallocate values->data and update values->num before filling.

Parameters
app_stateThe app_state pointer from this config.
valuesBuffer to fill (may reallocate data/num).
Returns
WLM_GRAPH_READ_OK on success, WLM_GRAPH_READ_ERROR to skip, or WLM_GRAPH_READ_OK_AND_REGENERATE to regenerate historical samples.

The documentation for this struct was generated from the following file: