//#include <linux/kconfig.h>
//#include <linux/tcp.h>
//#include <net/flow.h>
//#include <net/inet_sock.h>
//#include <net/sock.h>
//#include <net/net_namespace.h>
//#include <uapi/linux/bpf.h>
#include "include/apm_trace.h"
#include "include/socket_trace.h"
//#include "vmlinux.h"// #include <asm/ptrace.h>
//#include <bpf/bpf_helpers.h>// bpf_base.h deepclash
//#include <bpf/bpf_core_read.h>// no use
//#include <bpf/bpf_tracing.h>
//#include <bpf/bpf_endian.h>
#include "common/bpf/bpf_endian.h"

#define EVENT_TYPE_PROCESS_START	1
#define EVENT_TYPE_PROCESS_EXIT		2
#define EVENT_TYPE_CONNECTION_OPEN	3
#define EVENT_TYPE_CONNECTION_CLOSE	4
#define EVENT_TYPE_CONNECTION_ERROR	5
#define EVENT_TYPE_LISTEN_OPEN		6
#define EVENT_TYPE_LISTEN_CLOSE 	7
#define EVENT_TYPE_FILE_OPEN		8
#define EVENT_TYPE_TCP_RETRANSMIT	9

#define EVENT_REASON_OOM_KILL		1

#define MIN(a,b) (((a)<(b))?(a):(b))

#define bpf_read(src, dst)                            \
({                                                    \
    if (bpf_probe_read(&dst, sizeof(dst), src) < 0) { \
        return 0;                                     \
    }                                                 \
})


//#define GOROUTINE(x) ((x)->r14)

#include "common/common.h"
#include "proc.c"
#include "file.c"

// new main
#include "socket_trace.c"

#include "tcp/state.c"
#include "tcp/retransmit.c"
//#include "l7/uprobe_base_bpf.c"
#include "l7/l7.c"
//#include "l7/gotls.c"
//#include "l7/openssl.c"
#include "utrace/go/net/server.probe.bpf.c"
#include "utrace/go/net/client.probe.bpf.c"
#include "utrace/go/net/stack.probe.bpf.c"

#include "utrace/java/net/server.probe.bpf.c"
#include "utrace/java/net/client.probe.bpf.c"
char _license[] SEC("license") = "GPL";
