summaryrefslogtreecommitdiffstats
path: root/collectors/ebpf.plugin/ebpf_mdflush.h
blob: 4913ad019d1a3e97f39fbf4402c58e14d1855968 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// SPDX-License-Identifier: GPL-3.0-or-later

#ifndef NETDATA_EBPF_MDFLUSH_H
#define NETDATA_EBPF_MDFLUSH_H 1

// Module name
#define NETDATA_EBPF_MODULE_NAME_MDFLUSH "mdflush"

// charts
#define NETDATA_MDFLUSH_GLOBAL_CHART "mdflush"

// configuration file
#define NETDATA_DIRECTORY_MDFLUSH_CONFIG_FILE "mdflush.conf"

// copy of mdflush types from kernel-collectors repo.
typedef uint32_t mdflush_ebpf_key_t;
typedef uint64_t mdflush_ebpf_val_t;

typedef struct netdata_mdflush {
    // must be at top for simplified AVL tree usage.
    // if it's not at the top, we need to use `containerof` for almost all ops.
    avl_t avl;

    // key & name of device.
    // the name is generated by the key, usually as `md<unit>`.
    uint32_t unit;
    char disk_name[32];

    // have we defined the dimension for this device yet?
    bool dim_exists;

    // incremental flush count value.
    uint64_t cnt;
} netdata_mdflush_t;

void *ebpf_mdflush_thread(void *ptr);

extern struct config mdflush_config;

#endif