Skip to content

Commit

Permalink
fix: agent - eBPF Fix Event Type Value
Browse files Browse the repository at this point in the history
If `0 < ev_meta->event_type < EVENT_TYPE_MIN`, it is classified as 'socket data buffer'.
If `ev_meta->event_type >= EVENT_TYPE_MIN`, it is classified as register events.

Previously, the value of `EVENT_TYPE_MIN` was set to 32. However, some UPROBE events exceeded or equaled 32, causing data loss in socket data. This patch increases `EVENT_TYPE_MIN` to 512 to fix this issue.
  • Loading branch information
yinjiping committed Dec 23, 2024
1 parent 5fc6d1e commit 560907b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions agent/src/ebpf/kernel/include/socket_trace_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,16 +292,16 @@ struct ebpf_proc_info {

enum {
/*
* 0 ~ 16 for L7 socket event (struct socket_data_buffer),
* 0 ~ 256 for L7 socket event (struct socket_data_buffer),
* indicates the number of socket data in socket_data_buffer.
*/

/*
* For event registrion
*/
EVENT_TYPE_MIN = 1 << 5,
EVENT_TYPE_PROC_EXEC = 1 << 5,
EVENT_TYPE_PROC_EXIT = 1 << 6
EVENT_TYPE_MIN = 1 << 9,
EVENT_TYPE_PROC_EXEC = 1 << 9,
EVENT_TYPE_PROC_EXIT = 1 << 10
// Add new event type here.
};

Expand Down
4 changes: 2 additions & 2 deletions agent/src/ebpf/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ pub const MSG_COMMON: u8 = 7;

//Register event types
#[allow(dead_code)]
pub const EVENT_TYPE_PROC_EXEC: u32 = 1 << 5;
pub const EVENT_TYPE_PROC_EXEC: u32 = 1 << 9;
#[allow(dead_code)]
pub const EVENT_TYPE_PROC_EXIT: u32 = 1 << 6;
pub const EVENT_TYPE_PROC_EXIT: u32 = 1 << 10;

// Profiler types
#[allow(dead_code)]
Expand Down

0 comments on commit 560907b

Please sign in to comment.