ebpf_mdflush.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. // charts
  7. #define NETDATA_MDFLUSH_GLOBAL_CHART "mdflush"
  8. // configuration file
  9. #define NETDATA_DIRECTORY_MDFLUSH_CONFIG_FILE "mdflush.conf"
  10. // copy of mdflush types from kernel-collectors repo.
  11. typedef uint32_t mdflush_ebpf_key_t;
  12. typedef uint64_t mdflush_ebpf_val_t;
  13. typedef struct netdata_mdflush {
  14. // must be at top for simplified AVL tree usage.
  15. // if it's not at the top, we need to use `containerof` for almost all ops.
  16. avl_t avl;
  17. // key & name of device.
  18. // the name is generated by the key, usually as `md<unit>`.
  19. uint32_t unit;
  20. char disk_name[32];
  21. // have we defined the dimension for this device yet?
  22. bool dim_exists;
  23. // incremental flush count value.
  24. uint64_t cnt;
  25. } netdata_mdflush_t;
  26. enum netdata_mdflush_targets {
  27. NETDATA_MD_FLUSH_REQUEST,
  28. NETDATA_MD_FLUSH_END
  29. };
  30. void *ebpf_mdflush_thread(void *ptr);
  31. extern struct config mdflush_config;
  32. extern netdata_ebpf_targets_t mdflush_targets[];
  33. #endif