From 61f1b778a71bdb9b7923eb21659e1b7b50c1a71f Mon Sep 17 00:00:00 2001 From: wynyibo Date: Thu, 16 Jan 2025 18:38:53 +0800 Subject: [PATCH] update --- .../net/net_watcher/include/net_watcher.h | 5 ----- .../backend/net/net_watcher/src/net_watcher.c | 22 +------------------ 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/MagicEyes/src/backend/net/net_watcher/include/net_watcher.h b/MagicEyes/src/backend/net/net_watcher/include/net_watcher.h index 8e5360637..60a4c4b5c 100644 --- a/MagicEyes/src/backend/net/net_watcher/include/net_watcher.h +++ b/MagicEyes/src/backend/net/net_watcher/include/net_watcher.h @@ -324,9 +324,4 @@ struct tcp_args_s { u64 sample_period; }; -struct ring_buffer_info -{ - struct ring_buffer *rb; - const char *name; -}; #endif /* __NET_WATCHER_H */ \ No newline at end of file diff --git a/MagicEyes/src/backend/net/net_watcher/src/net_watcher.c b/MagicEyes/src/backend/net/net_watcher/src/net_watcher.c index 7426bbb17..08468af3f 100644 --- a/MagicEyes/src/backend/net/net_watcher/src/net_watcher.c +++ b/MagicEyes/src/backend/net/net_watcher/src/net_watcher.c @@ -51,24 +51,6 @@ struct SymbolEntry symbols[300000]; struct SymbolEntry cache[CACHEMAXSIZE]; float ewma_values[NUM_LAYERS] = {0}; -// 定义一个数组存储所有的 ring_buffer 信息 -struct ring_buffer_info ring_buffers[] = { - {NULL, "rb"}, - {NULL, "udp_rb"}, - {NULL, "netfilter_rb"}, - {NULL, "kfree_rb"}, - {NULL, "icmp_rb"}, - {NULL, "tcp_rb"}, - {NULL, "dns_rb"}, - {NULL, "trace_rb"}, - {NULL, "mysql_rb"}, - {NULL, "redis_rb"}, - {NULL, "redis_stat_rb"}, - {NULL, "rtt_rb"}, - {NULL, "events"}, - {NULL, "port_rb"}, - {NULL, "rate_rb"}}; - static const char argp_program_doc[] = "Watch tcp/ip in network subsystem \n"; static const struct argp_option opts[] = { {"all", 'a', 0, 0, "set to trace CLOSED connection"}, @@ -1448,7 +1430,6 @@ void print_top_5_keys() free(pairs); } - // free int main(int argc, char **argv) { @@ -1740,7 +1721,7 @@ int main(int argc, char **argv) } } cleanup: - ring_buffer__free(rb); + ring_buffer__free(rb); ring_buffer__free(udp_rb); ring_buffer__free(netfilter_rb); ring_buffer__free(kfree_rb); @@ -1758,4 +1739,3 @@ int main(int argc, char **argv) net_watcher_bpf__destroy(skel); return err < 0 ? -err : 0; } -