This is an automated email from the ASF dual-hosted git repository.

liuhan pushed a commit to branch reduce-handle-connect-time
in repository https://gitbox.apache.org/repos/asf/skywalking-rover.git


The following commit(s) were added to refs/heads/reduce-handle-connect-time by 
this push:
     new c08ab10  add test log
c08ab10 is described below

commit c08ab10a8410632bd466bf0bbad61b82fb5beccc
Author: mrproliu <[email protected]>
AuthorDate: Fri Dec 27 14:06:18 2024 +0800

    add test log
---
 bpf/accesslog/syscalls/connect_conntrack.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/bpf/accesslog/syscalls/connect_conntrack.c 
b/bpf/accesslog/syscalls/connect_conntrack.c
index 4efac48..b12e4c8 100644
--- a/bpf/accesslog/syscalls/connect_conntrack.c
+++ b/bpf/accesslog/syscalls/connect_conntrack.c
@@ -84,6 +84,7 @@ static __always_inline int 
nf_conntrack_tuple_to_conntrack_tuple(struct connect_
 
 static __always_inline int nf_conn_aware(struct pt_regs* ctx, struct nf_conn 
*ct) {
     if (ct == NULL) {
+        bpf_printk("---test1111");
         return 0;
     }
     __u64 id = bpf_get_current_pid_tgid();
@@ -94,23 +95,28 @@ static __always_inline int nf_conn_aware(struct pt_regs* 
ctx, struct nf_conn *ct
 
     // already contains the remote address
     if (&(connect_args->remote) != NULL) {
+        bpf_printk("---test2222");
         return 0;
     }
 
     __u32 status;
     if (bpf_probe_read(&status, sizeof(status), &(ct->status)) != 0) {
+        bpf_printk("---test3333");
         return 0; // Invalid ct pointer
     }
 
     if (!(status & IPS_CONFIRMED)) {
+        bpf_printk("---test4444");
         return 0;
     }
     if (!(status & IPS_NAT_MASK)) {
+        bpf_printk("---test5555");
         return 0;
     }
 
     struct nf_conntrack_tuple_hash tuplehash[IP_CT_DIR_MAX];
     if (bpf_probe_read(&tuplehash, sizeof(tuplehash), &(ct->tuplehash)) != 0) {
+        bpf_printk("---test6666");
         return 0; // Invalid ct pointer
     }
 
@@ -118,6 +124,7 @@ static __always_inline int nf_conn_aware(struct pt_regs* 
ctx, struct nf_conn *ct
 
     conntrack_tuple_t reply_conn = {};
     if (!nf_conntrack_tuple_to_conntrack_tuple(connect_args, &reply_conn, 
&reply)) {
+        bpf_printk("---test7777");
         return 0;
     }
 
@@ -127,6 +134,7 @@ static __always_inline int nf_conn_aware(struct pt_regs* 
ctx, struct nf_conn *ct
     remote.port = reply_conn.sport;
     connect_args->remote = remote;
     bpf_map_update_elem(&conecting_args, &id, connect_args, 0);
+    bpf_printk("---test success!!!!!!!!!!!!!!!!!!!!");
 
     return 0;
 }

Reply via email to