Browse Source

Don't recompute the record length

Alessandro Decina 3 years ago
parent
commit
9b229d0
1 changed files with 1 additions and 1 deletions
  1. 1 1
      aya-log/aya-log-ebpf/src/macros.rs

+ 1 - 1
aya-log/aya-log-ebpf/src/macros.rs

@@ -185,7 +185,7 @@ macro_rules! log {
                 if let Ok(message_len) = $crate::write_record_message!(&mut buf.buf[header_len..], $($arg)+) {
                     let record_len = header_len + message_len;
                     if record_len <= $crate::LOG_BUF_CAPACITY {
-                        let _ = unsafe { $crate::AYA_LOGS.output($ctx, &buf.buf[..header_len + message_len], 0) };
+                        let _ = unsafe { $crate::AYA_LOGS.output($ctx, &buf.buf[..record_len], 0) };
                     }
                 };
             }