Changed debug prints

This commit is contained in:
Nimrod Gilboa Markevich 2022-07-12 13:10:35 +00:00
parent 8443090eed
commit 7b3863c678
3 changed files with 8 additions and 3 deletions

View File

@ -18,12 +18,9 @@ static __always_inline int add_address_to_chunk(struct pt_regs *ctx, struct tls_
struct fd_info *fdinfo = bpf_map_lookup_elem(&file_descriptor_to_ipv4, &key);
log_error(ctx, LOG_DEBUG, 0, 0, 0);
if (fdinfo == NULL) {
log_error(ctx, LOG_DEBUG, 1, 0, 0);
return 0;
}
log_error(ctx, LOG_DEBUG, 2, 0, 0);
int err;

View File

@ -217,6 +217,8 @@ static __always_inline void go_crypto_tls_uprobe(struct pt_regs *ctx, struct bpf
log_error(ctx, LOG_ERROR_PUTTING_SSL_CONTEXT, pid_tgid, err, 0l);
}
log_error(ctx, LOG_DEBUG, 1, 1, pid_tgid);
return;
}

View File

@ -70,10 +70,16 @@ static __always_inline void tcp_kprobe(struct pt_regs *ctx, struct bpf_map_def *
SEC("kprobe/tcp_sendmsg")
void BPF_KPROBE(tcp_sendmsg) {
__u64 id = bpf_get_current_pid_tgid();
log_error(ctx, LOG_DEBUG, 2, 1, id);
tcp_kprobe(ctx, &openssl_write_context, true);
}
SEC("kprobe/tcp_recvmsg")
void BPF_KPROBE(tcp_recvmsg) {
__u64 id = bpf_get_current_pid_tgid();
log_error(ctx, LOG_DEBUG, 2, 2, id);
tcp_kprobe(ctx, &openssl_read_context, false);
}