ebpf_mdflush.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // SPDX-License-Identifier: GPL-3.0-or-later
  2. #ifndef NETDATA_EBPF_MDFLUSH_H
  3. #define NETDATA_EBPF_MDFLUSH_H 1
  4. // Module name
  5. #define NETDATA_EBPF_MODULE_NAME_MDFLUSH "mdflush"
  6. #define NETDATA_MDFLUSH_SLEEP_MS 850000ULL
  7. // charts
  8. #define NETDATA_MDFLUSH_GLOBAL_CHART "mdflush"
  9. // configuration file
  10. #define NETDATA_DIRECTORY_MDFLUSH_CONFIG_FILE "mdflush.conf"
  11. // copy of mdflush types from kernel-collectors repo.
  12. typedef uint32_t mdflush_ebpf_key_t;
  13. typedef uint64_t mdflush_ebpf_val_t;
  14. typedef struct netdata_mdflush {
  15. // must be at top for simplified AVL tree usage.
  16. // if it's not at the top, we need to use `containerof` for almost all ops.
  17. avl_t avl;
  18. // key & name of device.
  19. // the name is generated by the key, usually as `md<unit>`.
  20. uint32_t unit;
  21. char disk_name[32];
  22. // have we defined the dimension for this device yet?
  23. bool dim_exists;
  24. // incremental flush count value.
  25. uint64_t cnt;
  26. } netdata_mdflush_t;
  27. extern void *ebpf_mdflush_thread(void *ptr);
  28. extern struct config mdflush_config;
  29. #endif