| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | #ifndef NETDATA_EBPF_MDFLUSH_H |
| 4 | #define NETDATA_EBPF_MDFLUSH_H 1 |
| 5 | |
| 6 | // Module name & description |
| 7 | #define NETDATA_EBPF_MODULE_NAME_MDFLUSH "mdflush" |
| 8 | #define NETDATA_EBPF_MD_MODULE_DESC "Show information about multi-device software flushes." |
| 9 | |
| 10 | // charts |
| 11 | #define NETDATA_MDFLUSH_GLOBAL_CHART "mdflush" |
| 12 | |
| 13 | // configuration file |
| 14 | #define NETDATA_DIRECTORY_MDFLUSH_CONFIG_FILE "mdflush.conf" |
| 15 | |
| 16 | // copy of mdflush types from kernel-collectors repo. |
| 17 | typedef uint32_t mdflush_ebpf_key_t; |
| 18 | typedef uint64_t mdflush_ebpf_val_t; |
| 19 | |
| 20 | typedef struct netdata_mdflush { |
| 21 | // must be at top for simplified AVL tree usage. |
| 22 | // if it's not at the top, we need to use `containerof` for almost all ops. |
| 23 | avl_t avl; |
| 24 | |
| 25 | // key & name of device. |
| 26 | // the name is generated by the key, usually as `md<unit>`. |
| 27 | uint32_t unit; |
| 28 | char disk_name[32]; |
| 29 | |
| 30 | // have we defined the dimension for this device yet? |
| 31 | bool dim_exists; |
| 32 | |
| 33 | // incremental flush count value. |
| 34 | uint64_t cnt; |
| 35 | } netdata_mdflush_t; |
| 36 | |
| 37 | enum netdata_mdflush_targets { |
| 38 | NETDATA_MD_FLUSH_REQUEST, |
| 39 | |
| 40 | NETDATA_MD_FLUSH_END |
| 41 | }; |
| 42 | |
| 43 | void ebpf_mdflush_thread(void *ptr); |
| 44 | |
| 45 | extern struct config mdflush_config; |
| 46 | extern netdata_ebpf_targets_t mdflush_targets[]; |
| 47 | |
| 48 | #endif |