Define an error

This commit is contained in:
M. Mert Yildiran 2022-06-02 22:51:48 +03:00
parent 2492ae1c3b
commit 284c52365b
No known key found for this signature in database
GPG Key ID: D42ADB236521BF7A
5 changed files with 4 additions and 2 deletions

View File

@ -48,7 +48,7 @@ static __always_inline int golang_crypto_tls_write_uprobe(struct pt_regs *ctx) {
event = bpf_map_lookup_elem(&golang_heap, &zero);
if (!event) {
log_error(ctx, LOG_ERROR_ALLOCATING_CHUNK, pid, 0l, 0l);
log_error(ctx, LOG_ERROR_GOLANG_ALLOCATING_EVENT, pid, 0l, 0l);
return 0;
}
@ -94,7 +94,7 @@ static __always_inline int golang_crypto_tls_read_uprobe(struct pt_regs *ctx) {
event = bpf_map_lookup_elem(&golang_heap, &zero);
if (!event) {
log_error(ctx, LOG_ERROR_ALLOCATING_CHUNK, pid, 0l, 0l);
log_error(ctx, LOG_ERROR_GOLANG_ALLOCATING_EVENT, pid, 0l, 0l);
return 0;
}

View File

@ -35,6 +35,7 @@ Copyright (C) UP9 Inc.
#define LOG_ERROR_GOLANG_SOCKET_PUTTING_FILE_DESCRIPTOR (23)
#define LOG_ERROR_GOLANG_DIAL_READING_KEY_DIAL (24)
#define LOG_ERROR_GOLANG_DIAL_PUTTING_SOCKET (25)
#define LOG_ERROR_GOLANG_ALLOCATING_EVENT (26)
// Sometimes we have the same error, happening from different locations.
// in order to be able to distinct between them in the log, we add an

View File

@ -29,4 +29,5 @@ var bpfLogMessages = []string{
/*0023*/ "[%d] Golang socket unable to put file descriptor [err: %d]",
/*0024*/ "[%d] Golang dial unable to read key_dial [err: %d]",
/*0025*/ "[%d] Golang dial unable to put socket [err: %d]",
/*0026*/ "[%d] Unable to allocate Golang event in bpf heap",
}

Binary file not shown.

Binary file not shown.