Browse Source

bpf: perf_map: fix type error

Alessandro Decina 4 years ago
parent
commit
4febbc3fae
1 changed files with 3 additions and 1 deletions
  1. 3 1
      bpf/aya-bpf/src/maps/perf_map.rs

+ 3 - 1
bpf/aya-bpf/src/maps/perf_map.rs

@@ -41,7 +41,9 @@ impl<T> PerfMap<T> {
         data: &T,
         flags: u32,
     ) {
-        let index = index.map(|i| (i as u64) << 32).unwrap_or(BPF_F_CURRENT_CPU);
+        let index = index
+            .map(|i| (i as u64) << 32)
+            .unwrap_or(BPF_F_CURRENT_CPU.into());
         let flags = index | flags as u64;
         unsafe {
             bpf_perf_event_output(