-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganize headers and add macro that defines architecture.
- Loading branch information
1 parent
423fde7
commit 6d51a2a
Showing
5 changed files
with
101 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
#ifndef _NETDATA_CACHE_H_ | ||
#define _NETDATA_CACHE_H_ 1 | ||
|
||
#include <linux/sched.h> | ||
|
||
typedef struct netdata_cachestat { | ||
__u64 add_to_page_cache_lru; | ||
__u64 mark_page_accessed; | ||
__u64 account_page_dirtied; | ||
__u64 mark_buffer_dirty; | ||
} netdata_cachestat_t; | ||
|
||
enum cachestat_counters { | ||
NETDATA_KEY_CALLS_ADD_TO_PAGE_CACHE_LRU, | ||
NETDATA_KEY_CALLS_MARK_PAGE_ACCESSED, | ||
NETDATA_KEY_CALLS_ACCOUNT_PAGE_DIRTIED, | ||
NETDATA_KEY_CALLS_MARK_BUFFER_DIRTY, | ||
|
||
NETDATA_CACHESTAT_END | ||
}; | ||
|
||
#endif /* _NETDATA_CACHE_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
#ifndef _NETDATA_EBPF_ | ||
#define _NETDATA_EBPF_ 1 | ||
|
||
#include <linux/sched.h> | ||
|
||
#include "netdata_cache.h" | ||
#include "netdata_network.h" | ||
#include "netdata_process.h" | ||
|
||
struct netdata_error_report_t { | ||
char comm[TASK_COMM_LEN]; | ||
__u32 pid; | ||
|
||
int type; | ||
int err; | ||
}; | ||
|
||
// Copied from linux/samples/bpf/tracex1_kern.c | ||
#define _(P) \ | ||
({ \ | ||
typeof(P) val = 0; \ | ||
bpf_probe_read(&val, sizeof(val), &(P)); \ | ||
val; \ | ||
}) | ||
|
||
// Copied from linux/samples/bpf/trace_common.h | ||
#ifdef __x86_64__ | ||
#define NETDATA_SYSCALL(SYS) "__x64_sys_" __stringify(SYS) | ||
#elif defined(__s390x__) | ||
#define NETDATA_SYSCALL(SYS) "__s390x_" __stringify(SYS) | ||
#else | ||
#define NETDATA_SYSCALL(SYS) "sys_" __stringify(SYS) | ||
#endif | ||
|
||
#endif /* _NETDATA_EBPF_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
#ifndef _NETDATA_NETWORK_H_ | ||
#define _NETDATA_NETWORK_H_ 1 | ||
|
||
#include <linux/sched.h> | ||
|
||
enum socket_counters { | ||
NETDATA_KEY_CALLS_TCP_SENDMSG, | ||
NETDATA_KEY_ERROR_TCP_SENDMSG, | ||
NETDATA_KEY_BYTES_TCP_SENDMSG, | ||
|
||
NETDATA_KEY_CALLS_TCP_CLEANUP_RBUF, | ||
NETDATA_KEY_ERROR_TCP_CLEANUP_RBUF, | ||
NETDATA_KEY_BYTES_TCP_CLEANUP_RBUF, | ||
|
||
NETDATA_KEY_CALLS_TCP_CLOSE, | ||
|
||
NETDATA_KEY_CALLS_UDP_RECVMSG, | ||
NETDATA_KEY_ERROR_UDP_RECVMSG, | ||
NETDATA_KEY_BYTES_UDP_RECVMSG, | ||
|
||
NETDATA_KEY_CALLS_UDP_SENDMSG, | ||
NETDATA_KEY_ERROR_UDP_SENDMSG, | ||
NETDATA_KEY_BYTES_UDP_SENDMSG, | ||
|
||
NETDATA_KEY_TCP_RETRANSMIT, | ||
|
||
NETDATA_SOCKET_COUNTER | ||
}; | ||
|
||
#endif /* _NETDATA_NETWORK_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters