|
wlmaker
|
#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) |
Configuration for a graph application.
Pass to wlm_graph_app_run() to configure the graph behavior.
| wlm_graph_mode_t wlm_graph_app_config_t::accumulate_mode |
Sample accumulation mode.
| const char* wlm_graph_app_config_t::app_help |
Application help string. Shown in –help output.
| const char* wlm_graph_app_config_t::app_name |
Application name (e.g., "wlmcpugraph"). Used for error messages.
| void* wlm_graph_app_config_t::app_state |
App-specific state pointer, passed to callbacks.
| 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.
| app_state | The app_state pointer from this config. |
| 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).
| 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.
| app_state | The app_state pointer from this config. |
| samples | Array of sample buffers to regenerate (excludes current). |
| sample_count | Number of samples in the array. |
| 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.
| app_state | The app_state pointer from this config. |
| 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.
| app_state | The app_state pointer from this config. |
| values | Buffer to fill (may reallocate data/num). |