Skip to content

Commit 9d6be57

Browse files
ai-agent: expose proc event start time
1 parent 70110ab commit 9d6be57

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

agent/src/common/proc_event/linux.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,10 @@ impl ProcEvent {
451451
Ok(BoxedProcEvents(Box::new(proc_event)))
452452
}
453453

454+
pub fn start_time(&self) -> u64 {
455+
self.start_time
456+
}
457+
454458
pub fn proc_lifecycle_info(&self) -> Option<ProcLifecycleInfo> {
455459
match &self.event_data {
456460
EventData::ProcLifecycleEvent(data) => Some(ProcLifecycleInfo {

agent/src/ebpf_dispatcher.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ use crate::common::l7_protocol_log::{
6161
get_all_protocol, L7ProtocolBitmap, L7ProtocolParserInterface,
6262
};
6363
use crate::common::meta_packet::{MetaPacket, SegmentFlags};
64-
use crate::common::proc_event::{BoxedProcEvents, EventType, ProcEvent, PROC_LIFECYCLE_FORK};
64+
use crate::common::proc_event::{BoxedProcEvents, EventType, ProcEvent};
65+
#[cfg(feature = "enterprise")]
66+
use crate::common::proc_event::PROC_LIFECYCLE_FORK;
6567
use crate::common::{FlowAclListener, FlowAclListenerId};
6668
use crate::config::handler::{CollectorAccess, EbpfAccess, EbpfConfig, LogParserAccess};
6769
use crate::config::FlowAccess;
@@ -125,7 +127,7 @@ fn register_ai_agent_child(event: &BoxedProcEvents) {
125127
return;
126128
}
127129
if let Some(registry) = enterprise_utils::ai_agent::global_registry() {
128-
let now = Duration::from_nanos(event.0.start_time);
130+
let now = Duration::from_nanos(event.0.start_time());
129131
registry.register_child(info.parent_pid, info.pid, now);
130132
}
131133
}

0 commit comments

Comments
 (0)