Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions ebpftracer/ebpf.go

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions ebpftracer/ebpf/l7/l7.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,7 @@ int trace_exit_read(void *ctx, __u64 id, __u32 pid, __u16 is_tls, long int ret)
e->method = METHOD_UNKNOWN;
e->statement_id = 0;
e->payload_size = 0;
e->response_size = ret;
COPY_PAYLOAD(e->response, ret, payload);
e->response_size = 0;
if (is_rabbitmq_consume(payload, ret)) {
e->protocol = PROTOCOL_RABBITMQ;
e->method = METHOD_CONSUME;
Expand Down Expand Up @@ -451,6 +450,8 @@ int trace_exit_read(void *ctx, __u64 id, __u32 pid, __u16 is_tls, long int ret)
e->payload_size = req->payload_size;
COPY_PAYLOAD(e->payload, req->payload_size, req->payload);
if (e->protocol == PROTOCOL_HTTP) {
e->response_size = ret;
COPY_PAYLOAD(e->response, ret, payload);
response = is_http_response(payload, &e->status);
} else if (e->protocol == PROTOCOL_POSTGRES) {
response = is_postgres_response(payload, ret, &e->status);
Expand Down Expand Up @@ -602,4 +603,4 @@ int sys_exit_recvfrom(struct trace_event_raw_sys_exit__stub* ctx) {
__u64 pid_tgid = bpf_get_current_pid_tgid();
__u32 pid = pid_tgid >> 32;
return trace_exit_read(ctx, pid_tgid, pid, 0, ctx->ret);
}
}