Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
wynyibo committed Jan 16, 2025
1 parent 6c2cce2 commit 61f1b77
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
5 changes: 0 additions & 5 deletions MagicEyes/src/backend/net/net_watcher/include/net_watcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
22 changes: 1 addition & 21 deletions MagicEyes/src/backend/net/net_watcher/src/net_watcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down Expand Up @@ -1448,7 +1430,6 @@ void print_top_5_keys()
free(pairs);
}


// free
int main(int argc, char **argv)
{
Expand Down Expand Up @@ -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);
Expand All @@ -1758,4 +1739,3 @@ int main(int argc, char **argv)
net_watcher_bpf__destroy(skel);
return err < 0 ? -err : 0;
}

0 comments on commit 61f1b77

Please sign in to comment.