瀏覽代碼

ebpf: use new PerCpuArray::get_ptr_mut API

Alessandro Decina 2 年之前
父節點
當前提交
6aea880890
共有 1 個文件被更改,包括 2 次插入1 次删除
  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,