summaryrefslogtreecommitdiffstats
path: root/collectors/macos.plugin/plugin_macos.h
blob: 0815c59c3183992e1a88023ee026e9211179e359 (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
41
42
43
// SPDX-License-Identifier: GPL-3.0-or-later


#ifndef NETDATA_PLUGIN_MACOS_H
#define NETDATA_PLUGIN_MACOS_H 1

#include "../../daemon/common.h"

#if (TARGET_OS == OS_MACOS)

#define NETDATA_PLUGIN_HOOK_MACOS \
    { \
        .name = "PLUGIN[macos]", \
        .config_section = CONFIG_SECTION_PLUGINS, \
        .config_name = "macos", \
        .enabled = 1, \
        .thread = NULL, \
        .init_routine = NULL, \
        .start_routine = macos_main \
    },

void *macos_main(void *ptr);

#define GETSYSCTL_BY_NAME(name, var) getsysctl_by_name(name, &(var), sizeof(var))

extern int getsysctl_by_name(const char *name, void *ptr, size_t len);

extern int do_macos_sysctl(int update_every, usec_t dt);
extern int do_macos_mach_smi(int update_every, usec_t dt);
extern int do_macos_iokit(int update_every, usec_t dt);


#else // (TARGET_OS == OS_MACOS)

#define NETDATA_PLUGIN_HOOK_MACOS

#endif // (TARGET_OS == OS_MACOS)





#endif /* NETDATA_PLUGIN_MACOS_H */