Browse Source

ebpf: use new PerCpuArray::get_ptr_mut API

Alessandro Decina 2 years ago
parent
commit
6aea880890
1 changed files with 2 additions and 1 deletions
  1. 2 1
      aya-log/ebpf/aya-log-ebpf-macros/src/expand.rs

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

@@ -128,7 +128,8 @@ pub(crate) fn log(args: LogArgs, level: Option<TokenStream>) -> Result<TokenStre
 
     Ok(quote! {
         {
-            if let Some(buf) = unsafe { ::aya_log_ebpf::AYA_LOG_BUF.get_mut(0) } {
+            if let Some(buf_ptr) = unsafe { ::aya_log_ebpf::AYA_LOG_BUF.get_ptr_mut(0) } {
+                let buf = unsafe { &mut *buf_ptr };
                 if let Ok(header_len) = ::aya_log_ebpf::write_record_header(
                     &mut buf.buf,
                     #target,