mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-08-11 13:23:03 +00:00
tmp: Debug prints
This commit is contained in:
parent
281e7b1538
commit
8443090eed
@ -18,9 +18,12 @@ 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);
|
struct fd_info *fdinfo = bpf_map_lookup_elem(&file_descriptor_to_ipv4, &key);
|
||||||
|
|
||||||
|
log_error(ctx, LOG_DEBUG, 0, 0, 0);
|
||||||
if (fdinfo == NULL) {
|
if (fdinfo == NULL) {
|
||||||
|
log_error(ctx, LOG_DEBUG, 1, 0, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
log_error(ctx, LOG_DEBUG, 2, 0, 0);
|
||||||
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ Copyright (C) UP9 Inc.
|
|||||||
#define LOG_ERROR_READING_SOCKET_SADDR (19)
|
#define LOG_ERROR_READING_SOCKET_SADDR (19)
|
||||||
#define LOG_ERROR_READING_SOCKET_DPORT (20)
|
#define LOG_ERROR_READING_SOCKET_DPORT (20)
|
||||||
#define LOG_ERROR_READING_SOCKET_SPORT (21)
|
#define LOG_ERROR_READING_SOCKET_SPORT (21)
|
||||||
|
#define LOG_DEBUG (22)
|
||||||
|
|
||||||
// Sometimes we have the same error, happening from different locations.
|
// 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
|
// in order to be able to distinct between them in the log, we add an
|
||||||
|
@ -25,4 +25,5 @@ var bpfLogMessages = []string{
|
|||||||
/*0019*/ "[%d] Unable to read socket saddr [err: %d]",
|
/*0019*/ "[%d] Unable to read socket saddr [err: %d]",
|
||||||
/*0019*/ "[%d] Unable to read socket dport [err: %d]",
|
/*0019*/ "[%d] Unable to read socket dport [err: %d]",
|
||||||
/*0021*/ "[%d] Unable to read socket sport [err: %d]",
|
/*0021*/ "[%d] Unable to read socket sport [err: %d]",
|
||||||
|
/*0022*/ "DEBUGBPF %d %d %d",
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
|
"github.com/up9inc/mizu/logger"
|
||||||
"github.com/up9inc/mizu/tap/api"
|
"github.com/up9inc/mizu/tap/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -86,6 +87,14 @@ func (c *tlsTapperTlsChunk) getAddressPair() (addressPair, bool) {
|
|||||||
full = false
|
full = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mode := 0
|
||||||
|
if full {
|
||||||
|
mode = 1
|
||||||
|
} else {
|
||||||
|
mode = 0
|
||||||
|
}
|
||||||
|
logger.Log.Infof("getAddressPair %d %s:%d > %s:%d", mode, srcIp, srcPort, dstIp, dstPort)
|
||||||
|
|
||||||
return addressPair{
|
return addressPair{
|
||||||
srcIp: srcIp,
|
srcIp: srcIp,
|
||||||
srcPort: srcPort,
|
srcPort: srcPort,
|
||||||
|
Loading…
Reference in New Issue
Block a user