ebpf_functions.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // SPDX-License-Identifier: GPL-3.0-or-later
  2. #ifndef NETDATA_EBPF_FUNCTIONS_H
  3. #define NETDATA_EBPF_FUNCTIONS_H 1
  4. #ifdef NETDATA_DEV_MODE
  5. // Common
  6. static inline void EBPF_PLUGIN_FUNCTIONS(const char *NAME, const char *DESC) {
  7. fprintf(stdout, "%s \"%s\" 10 \"%s\"\n", PLUGINSD_KEYWORD_FUNCTION, NAME, DESC);
  8. }
  9. #endif
  10. // configuration file & description
  11. #define NETDATA_DIRECTORY_FUNCTIONS_CONFIG_FILE "functions.conf"
  12. #define NETDATA_EBPF_FUNCTIONS_MODULE_DESC "Show information about current function status."
  13. // function list
  14. #define EBPF_FUNCTION_THREAD "ebpf_thread"
  15. #define EBPF_FUNCTION_SOCKET "ebpf_socket"
  16. // thread constants
  17. #define EBPF_PLUGIN_THREAD_FUNCTION_DESCRIPTION "Detailed information about eBPF threads."
  18. #define EBPF_PLUGIN_THREAD_FUNCTION_ERROR_THREAD_NOT_FOUND "ebpf.plugin does not have thread named "
  19. #define EBPF_THREADS_SELECT_THREAD "thread:"
  20. #define EBPF_THREADS_ENABLE_CATEGORY "enable:"
  21. #define EBPF_THREADS_DISABLE_CATEGORY "disable:"
  22. #define EBPF_THREAD_STATUS_RUNNING "running"
  23. #define EBPF_THREAD_STATUS_STOPPED "stopped"
  24. // socket constants
  25. #define EBPF_PLUGIN_SOCKET_FUNCTION_DESCRIPTION "Detailed information about open sockets."
  26. #define EBPF_FUNCTION_SOCKET_FAMILY "family:"
  27. #define EBPF_FUNCTION_SOCKET_PERIOD "period:"
  28. #define EBPF_FUNCTION_SOCKET_RESOLVE "resolve:"
  29. #define EBPF_FUNCTION_SOCKET_RANGE "range:"
  30. #define EBPF_FUNCTION_SOCKET_PORT "port:"
  31. #define EBPF_FUNCTION_SOCKET_RESET "reset"
  32. #define EBPF_FUNCTION_SOCKET_INTERFACES "interfaces"
  33. void *ebpf_function_thread(void *ptr);
  34. #endif