-#ifndef _FEATURES_DATA_H
-#define _FEATURES_DATA_H
-
#include "syscall_list.h"
+struct feature {
+ size_t cnt;
+ enum syscall_id *feature_list;
+};
+
#define X(x) id_##x
enum syscall_id {
SYSCALL_LIST
id_sys_setns
};
-#endif /* _FEATURES_DATA_H */
+#define CREATE_FEATURE(x) \
+{ \
+ .cnt = sizeof(x) / sizeof(enum syscall_id), \
+ .feature_list = x \
+}
+
+static struct feature features[] = {
+ CREATE_FEATURE(id_file),
+ CREATE_FEATURE(id_irq),
+ CREATE_FEATURE(id_net),
+ CREATE_FEATURE(id_process),
+ CREATE_FEATURE(id_signal),
+ CREATE_FEATURE(id_desc)
+};
+
+enum {
+ feature_cnt = sizeof(features) / sizeof(struct feature)
+};
#include <ksyms.h>
#include <dbi_kprobes.h>
#include "ks_features.h"
-#include "features_data.h"
#include "syscall_list.h"
+#include "features_data.c"
-struct feature {
- size_t cnt;
- enum syscall_id *feature_list;
-};
-
struct ks_probe {
struct jprobe jp;
struct kretprobe rp;
int counter;
};
-
#define CREATE_JP(name) \
{ \
.entry = NULL, \
.handler = NULL \
}
-#define CREATE_FEATURE(x) \
-{ \
- .cnt = sizeof(x) / sizeof(enum syscall_id), \
- .feature_list = x \
-}
-
-
#define X(x) #x
static const char *const syscall_name[] = {
SYSCALL_LIST
#undef X
-static struct feature features[] = {
- CREATE_FEATURE(id_file),
- CREATE_FEATURE(id_irq),
- CREATE_FEATURE(id_net),
- CREATE_FEATURE(id_process),
- CREATE_FEATURE(id_signal),
- CREATE_FEATURE(id_desc)
-};
-
-enum {
- feature_cnt = sizeof(features) / sizeof(struct feature)
-};
-
-
static char *get_sys_name(size_t id)
{
return syscall_name[id];