@@ -147,10 +147,10 @@ fn try_tls(ctx: &TracePointContext) -> Result<u32, i64> {
147147 let buf: * const u8 = unsafe { ctx. read_at ( 24 ) ? } ;
148148 let count: u64 = unsafe { ctx. read_at ( 32 ) ? } ;
149149 let fd: u64 = unsafe { ctx. read_at ( 16 ) ? } ;
150- let pid = ( unsafe { bpf_get_current_pid_tgid ( ) } >> 32 ) as u32 ;
150+ let pid = ( bpf_get_current_pid_tgid ( ) >> 32 ) as u32 ;
151151 let key = sock_key ( pid, fd) ;
152152 // Already tracking this LLM socket → this write is request payload; accumulate + done.
153- if let Some ( stat) = unsafe { LLM_SOCKS . get_ptr_mut ( & key) } {
153+ if let Some ( stat) = LLM_SOCKS . get_ptr_mut ( & key) {
154154 unsafe {
155155 ( * stat) . req_bytes = ( * stat) . req_bytes . saturating_add ( count) ;
156156 }
@@ -224,15 +224,15 @@ pub fn ssl_write(ctx: ProbeContext) -> u32 {
224224pub fn ssl_read_enter ( ctx : ProbeContext ) -> u32 {
225225 let buf = ctx. arg :: < u64 > ( 1 ) . unwrap_or ( 0 ) ;
226226 if buf != 0 {
227- let tid = unsafe { bpf_get_current_pid_tgid ( ) } ;
227+ let tid = bpf_get_current_pid_tgid ( ) ;
228228 let _ = SSL_READ_BUF . insert ( & tid, & buf, 0 ) ;
229229 }
230230 0
231231}
232232
233233#[ uretprobe]
234234pub fn ssl_read_exit ( ctx : RetProbeContext ) -> u32 {
235- let tid = unsafe { bpf_get_current_pid_tgid ( ) } ;
235+ let tid = bpf_get_current_pid_tgid ( ) ;
236236 let ret = ctx. ret :: < i32 > ( ) . unwrap_or ( 0 ) as i64 ; // SSL_read return value = bytes decrypted
237237 let buf = unsafe { SSL_READ_BUF . get ( & tid) } . copied ( ) ;
238238 let _ = SSL_READ_BUF . remove ( & tid) ;
@@ -511,7 +511,7 @@ fn on_read_enter(ctx: &TracePointContext) -> u32 {
511511 let Ok ( fd) = ( unsafe { ctx. read_at :: < u64 > ( 16 ) } ) else {
512512 return 0 ;
513513 } ;
514- let tgid = unsafe { bpf_get_current_pid_tgid ( ) } ;
514+ let tgid = bpf_get_current_pid_tgid ( ) ;
515515 let key = sock_key ( ( tgid >> 32 ) as u32 , fd) ;
516516 // Stash only for tracked LLM sockets — keeps this node-wide hot path cheap.
517517 if unsafe { LLM_SOCKS . get ( & key) } . is_some ( ) {
@@ -521,7 +521,7 @@ fn on_read_enter(ctx: &TracePointContext) -> u32 {
521521}
522522
523523fn on_read_exit ( ctx : & TracePointContext ) -> u32 {
524- let tgid = unsafe { bpf_get_current_pid_tgid ( ) } ;
524+ let tgid = bpf_get_current_pid_tgid ( ) ;
525525 let Some ( & fd) = ( unsafe { READ_FD . get ( & tgid) } ) else {
526526 return 0 ;
527527 } ;
@@ -534,7 +534,7 @@ fn on_read_exit(ctx: &TracePointContext) -> u32 {
534534 return 0 ;
535535 }
536536 let key = sock_key ( ( tgid >> 32 ) as u32 , fd as u64 ) ;
537- if let Some ( stat) = unsafe { LLM_SOCKS . get_ptr_mut ( & key) } {
537+ if let Some ( stat) = LLM_SOCKS . get_ptr_mut ( & key) {
538538 unsafe {
539539 ( * stat) . resp_bytes = ( * stat) . resp_bytes . saturating_add ( ret as u64 ) ;
540540 if ( * stat) . first_resp_ns == 0 {
@@ -551,7 +551,7 @@ pub fn sock_close(ctx: TracePointContext) -> u32 {
551551 let Ok ( fd) = ( unsafe { ctx. read_at :: < u64 > ( 16 ) } ) else {
552552 return 0 ;
553553 } ;
554- let pid = ( unsafe { bpf_get_current_pid_tgid ( ) } >> 32 ) as u32 ;
554+ let pid = ( bpf_get_current_pid_tgid ( ) >> 32 ) as u32 ;
555555 let key = sock_key ( pid, fd) ;
556556 let Some ( & stat) = ( unsafe { LLM_SOCKS . get ( & key) } ) else {
557557 return 0 ; // not an LLM socket
0 commit comments