|
@@ -29,6 +29,7 @@
|
|
|
#define METHOD_HTTP2_CLIENT_FRAMES 5
|
|
#define METHOD_HTTP2_CLIENT_FRAMES 5
|
|
|
#define METHOD_HTTP2_SERVER_FRAMES 6
|
|
#define METHOD_HTTP2_SERVER_FRAMES 6
|
|
|
|
|
|
|
|
|
|
+#define ERROR_MSG_PAYLOAD_SIZE 128
|
|
|
#define MAX_PAYLOAD_SIZE 1024 // must be power of 2
|
|
#define MAX_PAYLOAD_SIZE 1024 // must be power of 2
|
|
|
#define TRUNCATE_PAYLOAD_SIZE(size) ({ \
|
|
#define TRUNCATE_PAYLOAD_SIZE(size) ({ \
|
|
|
size = MIN(size, MAX_PAYLOAD_SIZE-1); \
|
|
size = MIN(size, MAX_PAYLOAD_SIZE-1); \
|
|
@@ -95,7 +96,8 @@ struct l7_event {
|
|
|
unsigned char app_id_from[APM_APP_ID_SIZE];
|
|
unsigned char app_id_from[APM_APP_ID_SIZE];
|
|
|
unsigned char span_id_from[APM_SPAN_ID_SIZE];
|
|
unsigned char span_id_from[APM_SPAN_ID_SIZE];
|
|
|
unsigned char type_from[APM_TYPE_FROM_SIZE];
|
|
unsigned char type_from[APM_TYPE_FROM_SIZE];
|
|
|
-
|
|
|
|
|
|
|
+ // 错误消息字段
|
|
|
|
|
+ unsigned char error_message[ERROR_MSG_PAYLOAD_SIZE];
|
|
|
// __u32 test_id;
|
|
// __u32 test_id;
|
|
|
char payload[MAX_PAYLOAD_SIZE];
|
|
char payload[MAX_PAYLOAD_SIZE];
|
|
|
} ;
|
|
} ;
|
|
@@ -1013,12 +1015,12 @@ int trace_exit_read_common(void *ctx, __u64 id, __u32 pid, __u16 is_tls, long in
|
|
|
char resp_combined_packet[5];
|
|
char resp_combined_packet[5];
|
|
|
bpf_probe_read(resp_combined_packet,MYSQL_PACKAGE_HEADER_LEN, resp_packet_header);
|
|
bpf_probe_read(resp_combined_packet,MYSQL_PACKAGE_HEADER_LEN, resp_packet_header);
|
|
|
bpf_probe_read(&resp_combined_packet[4],1, payload);
|
|
bpf_probe_read(&resp_combined_packet[4],1, payload);
|
|
|
- response = is_mysql_response(resp_combined_packet,sizeof(resp_combined_packet), req->request_type, &e->statement_id, &e->status);
|
|
|
|
|
|
|
+ response = is_mysql_response(resp_combined_packet,sizeof(resp_combined_packet), req->request_type, &e->statement_id, &e->status, e->error_message);
|
|
|
if(response) {
|
|
if(response) {
|
|
|
bpf_map_delete_elem(&active_l7_requests_mysql_resp_header_ctx, &k);
|
|
bpf_map_delete_elem(&active_l7_requests_mysql_resp_header_ctx, &k);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- response = is_mysql_response(payload, ret, req->request_type, &e->statement_id, &e->status);
|
|
|
|
|
|
|
+ response = is_mysql_response(payload, ret, req->request_type, &e->statement_id, &e->status, e->error_message);
|
|
|
}
|
|
}
|
|
|
if (req->request_type == MYSQL_COM_STMT_PREPARE) {
|
|
if (req->request_type == MYSQL_COM_STMT_PREPARE) {
|
|
|
e->method = METHOD_STATEMENT_PREPARE;
|
|
e->method = METHOD_STATEMENT_PREPARE;
|