diff --git a/src/probes/extends/ebpf.probe/src/ksliprobe/tc_tstamp.bpf.c b/src/probes/extends/ebpf.probe/src/ksliprobe/tc_tstamp.bpf.c index a594b8fc6f48fcb0a7eacba1f7a32c7fed082c54..6aefd5bc1e538ab63717e69990e15333a957c66e 100644 --- a/src/probes/extends/ebpf.probe/src/ksliprobe/tc_tstamp.bpf.c +++ b/src/probes/extends/ebpf.probe/src/ksliprobe/tc_tstamp.bpf.c @@ -19,6 +19,7 @@ #include "bpf.h" #include +#include "ksliprobe.h" SEC("tc") int get_start_ts(struct __sk_buff *skb) diff --git a/src/probes/extends/ebpf.probe/src/pgsliprobe/pgsliprobe.h b/src/probes/extends/ebpf.probe/src/pgsliprobe/pgsliprobe.h index 668ca74097af11e11c53fe47fc60831f8bf71c83..5d49fd5c60b09e0805a6a73463ae47cc5f2b2c23 100644 --- a/src/probes/extends/ebpf.probe/src/pgsliprobe/pgsliprobe.h +++ b/src/probes/extends/ebpf.probe/src/pgsliprobe/pgsliprobe.h @@ -15,11 +15,15 @@ #ifndef __PGSLIPROBE_H__ #define __PGSLIPROBE_H__ -#define TC_PROG "tc_tstamp.bpf.o" +#define TC_TSTAMP_PROG "tc_tstamp.bpf.o" #define SLI_OK 0 #define SLI_ERR (-1) +#if ((CURRENT_KERNEL_VERSION == KERNEL_VERSION(4, 18, 0)) || (CURRENT_KERNEL_VERSION >= KERNEL_VERSION(5, 10, 0))) +#define KERNEL_SUPPORT_TSTAMP +#endif + struct ogsli_args_s { __u64 period; // Sampling period, unit ns }; diff --git a/src/probes/extends/ebpf.probe/src/pgsliprobe/pgsliprobe_bpf.h b/src/probes/extends/ebpf.probe/src/pgsliprobe/pgsliprobe_bpf.h index 34f1787bd8f76c1e66c282e4aa848fce7aabf8dd..e5afad77bab01ab47a89b4b6be5c90e4e0e6b6e9 100644 --- a/src/probes/extends/ebpf.probe/src/pgsliprobe/pgsliprobe_bpf.h +++ b/src/probes/extends/ebpf.probe/src/pgsliprobe/pgsliprobe_bpf.h @@ -15,10 +15,6 @@ #ifndef __PGSLIPROBE_BPF_H__ #define __PGSLIPROBE_BPF_H__ -#if ((CURRENT_KERNEL_VERSION == KERNEL_VERSION(4, 18, 0)) || (CURRENT_KERNEL_VERSION >= KERNEL_VERSION(5, 10, 0))) -#define KERNEL_SUPPORT_TSTAMP -#endif - #ifndef __PERIOD #define __PERIOD NS(30) #endif diff --git a/src/probes/extends/ebpf.probe/src/pgsliprobe/tc_tstamp.bpf.c b/src/probes/extends/ebpf.probe/src/pgsliprobe/tc_tstamp.bpf.c index 2ba5634a319efb4dd8137b9fdd9f023dadec8239..5d0474bf9e88b7579657b1d0735c4272ee0b538c 100644 --- a/src/probes/extends/ebpf.probe/src/pgsliprobe/tc_tstamp.bpf.c +++ b/src/probes/extends/ebpf.probe/src/pgsliprobe/tc_tstamp.bpf.c @@ -19,13 +19,15 @@ #include "bpf.h" #include +#include "pgsliprobe.h" + SEC("tc") int get_start_ts(struct __sk_buff *skb) { #ifdef KERNEL_SUPPORT_TSTAMP - skb->tstamp = bpf_ktime_get_ns(); + skb->tstamp = bpf_ktime_get_ns(); #endif - return 0; + return 0; } char g_license[] SEC("license") = "GPL";