|
|
@@ -281,6 +281,10 @@ void send_event(void *ctx, struct l7_event *e, struct connection_id cid, struct
|
|
|
e->connection_timestamp = conn->timestamp;
|
|
|
e->fd = cid.fd;
|
|
|
e->pid = cid.pid;
|
|
|
+ if (e->protocol == PROTOCOL_KAFKA)
|
|
|
+ {
|
|
|
+ cw_bpf_debug("[Request][KAFKA] begin send data -------->");
|
|
|
+ }
|
|
|
long error = bpf_perf_event_output(ctx, &l7_events, BPF_F_CURRENT_CPU, e, sizeof(*e));
|
|
|
if (error ==0){
|
|
|
cw_add_event_count(e->trace_id);
|
|
|
@@ -687,6 +691,10 @@ int trace_enter_write(void *ctx, __u64 fd, __u16 is_tls, char *buf, __u64 size,
|
|
|
if (prev_req && prev_req->protocol == PROTOCOL_KAFKA) {
|
|
|
req->ns = prev_req->ns;
|
|
|
}
|
|
|
+ cw_bpf_debug("[Request][KAFKA] start -------->");
|
|
|
+ bpf_printk("[Request][KAFKA] start -------->");
|
|
|
+ cw_bpf_debug("[Request][KAFKA] correlation_id start is %d -------->", req->request_id);
|
|
|
+ bpf_printk("[Request][KAFKA] correlation_id start is %d -------->", req->request_id);
|
|
|
// __u64 before_topic_length;
|
|
|
// __s16 s16_method_type;
|
|
|
// __s16 topic_length = kafka_request_topic_length_data(payload, size, &s16_method_type, &before_topic_length);
|
|
|
@@ -1238,7 +1246,12 @@ int trace_exit_read(void *ctx, __u64 id, __u32 pid, __u16 is_tls, long int ret)
|
|
|
e->component_dport = conn->dport;
|
|
|
__builtin_memcpy(&e->component_saddr, &conn->saddr, sizeof(e->component_saddr));
|
|
|
__builtin_memcpy(&e->component_daddr, &conn->daddr, sizeof(e->component_daddr));
|
|
|
- response = is_kafka_response(payload, req->request_id);
|
|
|
+ __s32 real_request_id;
|
|
|
+ response = is_kafka_response(payload, req->request_id, &real_request_id);
|
|
|
+ cw_bpf_debug("[Request][KAFKA] end -------->");
|
|
|
+ bpf_printk("[Request][KAFKA] end -------->");
|
|
|
+ // cw_bpf_debug("[Request][KAFKA] correlation_id end is %d, real is %d -------->", req->request_id, real_request_id);
|
|
|
+
|
|
|
// if(response)
|
|
|
// {
|
|
|
// struct mq_data *mq_data_ptr = bpf_map_lookup_elem(&apm_l7_request_mq_data_map, &req->request_id);
|