ebpf_mdflush.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 & description
  5. #define NETDATA_EBPF_MODULE_NAME_MDFLUSH "mdflush"
  6. #define NETDATA_EBPF_MD_MODULE_DESC "Show information about multi-device software flushes."
  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. enum netdata_mdflush_targets {
  28. NETDATA_MD_FLUSH_REQUEST,
  29. NETDATA_MD_FLUSH_END
  30. };
  31. void *ebpf_mdflush_thread(void *ptr);
  32. extern struct config mdflush_config;
  33. extern netdata_ebpf_targets_t mdflush_targets[];
  34. #endif