|
wlmaker
|
#include "wlm_graph_shared.h"#include <ctype.h>#include <stdbool.h>#include <stdint.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <libbase/libbase.h>
Classes | |
| struct | cpu_times_t |
| struct | cpugraph_state_t |
Macros | |
| #define | LINE_BUFFER_SIZE 256 |
Functions | |
| static bool | _cpu_state_arrays_alloc (cpugraph_state_t *state, const uint32_t cpu_usage_num) |
| static void | _state_free (void *app_state) |
| static wlm_graph_read_result_t | _stats_read_fn (void *app_state, wlm_graph_values_t *values) |
| int | main (const int argc, const char **argv) |
Variables | |
| static const char | _app_name [] = "wlmcpugraph" |
| static const char | _app_help [] |
CPU usage graph dock-app for wlmaker.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
| #define LINE_BUFFER_SIZE 256 |
Line buffer size for /proc/stat parsing.
|
static |
Allocates state arrays for the given number of CPUs.
| state | CPU graph state. |
| cpu_usage_num | Number of CPUs. |
|
static |
Frees all allocated state.
|
static |
Reads CPU statistics from /proc/stat.
Uses the pre-opened file handle, counts CPUs, reallocates the buffer if needed, and fills it with per-CPU usage values.
| app_state | App state (cpugraph_state_t pointer). |
| values | Buffer to fill (may reallocate data/num). |
| int main | ( | const int | argc, |
| const char ** | argv ) |
Main program.
|
static |
Application help.
|
static |
Application name.