Преглед изворни кода

Feature #TASK_QT-18250 临时让grpc uprobe函数全部return,解决euspace加载问题。

rock пре 6 месеци
родитељ
комит
9f1f26f252

+ 4 - 0
ebpftracer/ebpf/utrace/go/net/grpc.client.probe.bpf.c

@@ -94,6 +94,7 @@ u64 status_message_pos = 48;        //使用固定值48即可,不再处理多
 // func (cc *ClientConn) Invoke(ctx context.Context, method string, args, reply interface{}, opts ...CallOption) error
 SEC("uprobe/ClientConn_Invoke")
 int uprobe_ClientConn_Invoke(struct pt_regs *ctx) {
+    return 0;
     // bpf_printk("enter the uprobe_ClientConn_Invoke \n");
     // positions
     u64 clientconn_pos = 1;
@@ -178,6 +179,7 @@ int uprobe_ClientConn_Invoke(struct pt_regs *ctx) {
 // func (cc *ClientConn) Invoke(ctx context.Context, method string, args, reply interface{}, opts ...CallOption) error
 SEC("uprobe/ClientConn_Invoke")
 int uprobe_ClientConn_Invoke_Returns(struct pt_regs *ctx) {
+    return 0;
     // bpf_printk("enter the uprobe_ClientConn_Invoke_Returns \n");
     void *key = (void *)GOROUTINE(ctx);
     struct grpc_client_request_t *grpc_span = bpf_map_lookup_elem(&grpc_client_events, &key);
@@ -388,6 +390,7 @@ cw_append_item_to_slice(void *new_item, u32 item_size, void *slice_user_ptr) {
 
 SEC("uprobe/loopyWriter_headerHandler")
 int uprobe_LoopyWriter_HeaderHandler(struct pt_regs *ctx) {
+    return 0;
     void *headerFrame_ptr = get_argument(ctx, 2);
     // bpf_printk("enter the get header handler storage\n");
 
@@ -498,6 +501,7 @@ int uprobe_LoopyWriter_HeaderHandler(struct pt_regs *ctx) {
 SEC("uprobe/http2Client_NewStream")
 // func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (*Stream, error)
 int uprobe_http2Client_NewStream(struct pt_regs *ctx) {
+    return 0;
     // bpf_printk("enter the uprobe_http2Client_NewStream \n");
     __u32 tgid = (__u32)(bpf_get_current_pid_tgid() >> 32);
 	struct ebpf_proc_info *info =

+ 5 - 1
ebpftracer/ebpf/utrace/go/net/grpc.server.probe.bpf.c

@@ -306,6 +306,7 @@ handleStream(struct pt_regs *ctx, void *stream_ptr, struct go_iface *go_context)
 // This is only compatible with versions < 1.69.0 of the Server.
 SEC("uprobe/server_handleStream")
 int uprobe_server_handleStream(struct pt_regs *ctx) {
+    return 0;
     // bpf_printk("enter the uprobe_server_handleStream");
     u64 stream_pos = 4;
     void *stream_ptr = get_argument(ctx, stream_pos);
@@ -329,6 +330,7 @@ int uprobe_server_handleStream(struct pt_regs *ctx) {
 // UPROBE_RETURN(server_handleStream, struct grpc_request_t, grpc_events) 
 SEC("uprobe/server_handleStream")
 int uprobe_server_handleStream_Returns(struct pt_regs *ctx) {  
+    return 0;
     // bpf_printk("enter the uprobe_server_handleStream return");     
     void *key = (void *)GOROUTINE(ctx);
     __u64 id = bpf_get_current_pid_tgid();
@@ -440,7 +442,7 @@ int uprobe_server_handleStream_Returns(struct pt_regs *ctx) {
 // This is only compatible with versions > 1.69.0 of the Server.
 SEC("uprobe/server_handleStream2")
 int uprobe_server_handleStream2(struct pt_regs *ctx) {
-
+    return 0;
     __u32 tgid = (__u32)(bpf_get_current_pid_tgid() >> 32);
 	struct ebpf_proc_info *info =
 		bpf_map_lookup_elem(&proc_info_map, &tgid);
@@ -490,6 +492,7 @@ int uprobe_server_handleStream2(struct pt_regs *ctx) {
 // This is only compatible with versions > 1.69.0 of the Server.
 SEC("uprobe/server_handleStream2")
 int uprobe_server_handleStream2_Returns(struct pt_regs *ctx) {
+    return 0;
     u64 server_stream_pos = 4;
     void *server_stream_ptr = get_argument(ctx, server_stream_pos);
     void *key = NULL;
@@ -617,6 +620,7 @@ lookup:
 // func (t *http2Server) operateHeaders(ctx context.Context, frame *http2.MetaHeadersFrame, handle func(*Stream)) error
 SEC("uprobe/http2Server_operateHeader")
 int uprobe_http2Server_operateHeader(struct pt_regs *ctx) {
+    return 0;
     // bpf_printk("enter the uprobe_http2Server_operateHeader");
     __u32 tgid = (__u32)(bpf_get_current_pid_tgid() >> 32);
 	struct ebpf_proc_info *info =