Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Release Notes.
* Downgrade the protocol of connection when protocol break in the access log module.
* Bump up go version to `1.24` and eBPF library to `0.18.0`.
* Support detect ztunnel environment in the inbound request.
* Increase the transmit buffer size in the network profiling and access log module.

#### Bug Fixes
* Fix the base image cannot run in the arm64.
Expand Down
2 changes: 1 addition & 1 deletion bpf/include/queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct {
__uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
__uint(max_entries, 1);
__uint(key_size, sizeof(__u32));
__uint(value_size, 10240); // all events are less than 10KB
__uint(value_size, 30960); // all events are less than 30KB
} rover_data_heap SEC(".maps");

static __always_inline void *rover_reserve_buf(void *map, __u64 size) {
Expand Down
2 changes: 1 addition & 1 deletion bpf/include/socket_opts.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
// for protocol analyze need to read
#define MAX_PROTOCOL_SOCKET_READ_LENGTH 31
// for transmit to the user space
#define MAX_TRANSMIT_SOCKET_READ_LENGTH 2048
#define MAX_TRANSMIT_SOCKET_READ_LENGTH 20480

// unknown the connection type, not trigger the syscall connect,accept
#define AF_UNKNOWN 0xff
Expand Down
4 changes: 2 additions & 2 deletions pkg/accesslog/collector/protocols/http1.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ func (p *HTTP1Protocol) Analyze(connection *PartitionConnection, _ *AnalyzeHelpe
result = enums.ParseResultSkipPackage
}
if err != nil {
http1Log.Warnf("failed to handle HTTP/1.x protocol, connection ID: %d, random ID: %d, data id: %d, error: %v",
metrics.ConnectionID, metrics.RandomID, buf.Position().DataID(), err)
http1Log.Warnf("failed to handle HTTP/1.x protocol, connection ID: %d, random ID: %d, data id: %d, type: %d, error: %v",
metrics.ConnectionID, metrics.RandomID, buf.Position().DataID(), messageType, err)
}

http1Log.Debugf("readed message, messageType: %v, buf: %p, data id: %d, "+
Expand Down
6 changes: 3 additions & 3 deletions pkg/accesslog/events/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ type SocketDataUploadEvent struct {
DataID0 uint64
PrevDataID0 uint64
TotalSize0 uint64
Buffer [2048]byte
Buffer [20480]byte
}

func (s *SocketDataUploadEvent) ReleaseBuffer() *[2048]byte {
func (s *SocketDataUploadEvent) ReleaseBuffer() *[20480]byte {
return &s.Buffer
}

Expand All @@ -59,7 +59,7 @@ func (s *SocketDataUploadEvent) ReadFrom(r btf.Reader) {
s.DataID0 = r.ReadUint64()
s.PrevDataID0 = r.ReadUint64()
s.TotalSize0 = r.ReadUint64()
r.ReadUint8Array(s.Buffer[:], 2048)
r.ReadUint8Array(s.Buffer[:], 20480)
}

func (s *SocketDataUploadEvent) Protocol() enums.ConnectionProtocol {
Expand Down
1,363 changes: 1,257 additions & 106 deletions pkg/accesslog/events/events_test.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pkg/profiling/task/network/analyze/events/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ type SocketDataUploadEvent struct {
DataID0 uint64
PrevDataID0 uint64
TotalSize0 uint64
Buffer [2048]byte
Buffer [20480]byte
}

func (s *SocketDataUploadEvent) ReleaseBuffer() *[2048]byte {
func (s *SocketDataUploadEvent) ReleaseBuffer() *[20480]byte {
return &s.Buffer
}

Expand Down
8 changes: 4 additions & 4 deletions pkg/tools/buffer/buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ var (

PooledBuffer = sync.Pool{
New: func() any {
return &[2048]byte{}
return &[20480]byte{}
},
}
)

func BorrowNewBuffer() *[2048]byte {
return PooledBuffer.Get().(*[2048]byte)
func BorrowNewBuffer() *[20480]byte {
return PooledBuffer.Get().(*[20480]byte)
}

type SocketDataBuffer interface {
Expand Down Expand Up @@ -82,7 +82,7 @@ type SocketDataBuffer interface {
// EndTime the data end timestamp
EndTime() uint64

ReleaseBuffer() *[2048]byte
ReleaseBuffer() *[20480]byte
}

type SocketDataDetail interface {
Expand Down
Loading