@@ -54,11 +54,11 @@ static inline void update_cluster_active_connections(const struct cluster_stats_
5454 }
5555
5656 if (!stats ) {
57- BPF_LOG (ERR , CIRCUIT_BREAKER , "failed to get cluster stats" );
57+ BPF_LOG (ERR , CIRCUIT_BREAKER , "failed to get cluster stats\n " );
5858 return ;
5959 }
6060 if (delta < 0 && - delta > stats -> active_connections ) {
61- BPF_LOG (ERR , CIRCUIT_BREAKER , "invalid delta update" );
61+ BPF_LOG (ERR , CIRCUIT_BREAKER , "invalid delta update\n " );
6262 return ;
6363 }
6464
@@ -68,7 +68,7 @@ static inline void update_cluster_active_connections(const struct cluster_stats_
6868 DEBUG ,
6969 CIRCUIT_BREAKER ,
7070 "update existing stats(netns_cookie = %lld, cluster_id = %ld), "
71- "current active connections: %d" ,
71+ "current active connections: %d\n " ,
7272 key -> netns_cookie ,
7373 key -> cluster_id ,
7474 stats -> active_connections );
@@ -92,23 +92,23 @@ static inline int on_cluster_sock_bind(ctx_buff_t *ctx, const Cluster__Cluster *
9292 DEBUG ,
9393 CIRCUIT_BREAKER ,
9494 "Current active connections %d exceeded max connections "
95- "%d, reject connection" ,
95+ "%d, reject connection\n " ,
9696 stats -> active_connections ,
9797 cbs -> max_connections );
9898 return -1 ;
9999 }
100100 }
101101
102- BPF_LOG (DEBUG , CIRCUIT_BREAKER , "record sock bind for cluster id = %ld" , cluster_id );
102+ BPF_LOG (DEBUG , CIRCUIT_BREAKER , "record sock bind for cluster id = %ld\n " , cluster_id );
103103
104104 struct cluster_sock_data * data = NULL ;
105105 if (!ctx -> sk ) {
106- BPF_LOG (WARN , CIRCUIT_BREAKER , "provided sock is NULL" );
106+ BPF_LOG (WARN , CIRCUIT_BREAKER , "provided sock is NULL\n " );
107107 return 0 ;
108108 }
109109 data = bpf_sk_storage_get (& map_of_cluster_sock , ctx -> sk , 0 , BPF_LOCAL_STORAGE_GET_F_CREATE );
110110 if (!data ) {
111- BPF_LOG (ERR , CIRCUIT_BREAKER , "on_cluster_sock_bind call bpf_sk_storage_get failed" );
111+ BPF_LOG (ERR , CIRCUIT_BREAKER , "on_cluster_sock_bind call bpf_sk_storage_get failed\n " );
112112 return 0 ;
113113 }
114114 data -> cluster_id = cluster_id ;
@@ -119,7 +119,7 @@ static inline struct cluster_sock_data *get_cluster_sk_data(struct bpf_sock *sk)
119119{
120120 struct cluster_sock_data * data = NULL ;
121121 if (!sk ) {
122- BPF_LOG (DEBUG , CIRCUIT_BREAKER , "provided sock is NULL" );
122+ BPF_LOG (DEBUG , CIRCUIT_BREAKER , "provided sock is NULL\n " );
123123 return NULL ;
124124 }
125125
@@ -144,11 +144,11 @@ static inline void on_cluster_sock_connect(struct bpf_sock_ops *ctx)
144144 DEBUG ,
145145 CIRCUIT_BREAKER ,
146146 "increase cluster active connections(netns_cookie = %lld, cluster "
147- "id = %ld)" ,
147+ "id = %ld)\n " ,
148148 key .netns_cookie ,
149149 key .cluster_id );
150150 update_cluster_active_connections (& key , 1 );
151- BPF_LOG (DEBUG , CIRCUIT_BREAKER , "record sock connection for cluster id = %ld" , data -> cluster_id );
151+ BPF_LOG (DEBUG , CIRCUIT_BREAKER , "record sock connection for cluster id = %ld\n " , data -> cluster_id );
152152}
153153
154154static inline void on_cluster_sock_close (struct bpf_sock_ops * ctx )
@@ -169,10 +169,10 @@ static inline void on_cluster_sock_close(struct bpf_sock_ops *ctx)
169169 DEBUG ,
170170 CIRCUIT_BREAKER ,
171171 "decrease cluster active connections(netns_cookie = %lld, cluster "
172- "id = %ld)" ,
172+ "id = %ld)\n " ,
173173 key .netns_cookie ,
174174 key .cluster_id );
175- BPF_LOG (DEBUG , CIRCUIT_BREAKER , "record sock close for cluster id = %ld" , data -> cluster_id );
175+ BPF_LOG (DEBUG , CIRCUIT_BREAKER , "record sock close for cluster id = %ld\n " , data -> cluster_id );
176176}
177177
178178#endif
0 commit comments