Procházet zdrojové kódy

miri: Disable Stacked Borrows and skip some tests

The perf_buffer code fails due to stacked borrows, skip this for now.
munmap isn't supported by miri.

Signed-off-by: Dave Tucker <[email protected]>
Dave Tucker před 3 roky
rodič
revize
dc4b928ec5
2 změnil soubory, kde provedl 11 přidání a 0 odebrání
  1. 2 0
      .github/workflows/lint.yml
  2. 9 0
      aya/src/maps/perf/perf_buffer.rs

+ 2 - 0
.github/workflows/lint.yml

@@ -44,6 +44,8 @@ jobs:
           popd
 
       - name: Run miri
+        env:
+          MIRIFLAGS: -Zmiri-disable-stacked-borrows
         run: |
           cargo miri test
           pushd bpf

+ 9 - 0
aya/src/maps/perf/perf_buffer.rs

@@ -347,6 +347,7 @@ mod tests {
     }
 
     #[test]
+    #[cfg_attr(miri, ignore)]
     fn test_no_out_bufs() {
         let mut mmapped_buf = MMappedBuf {
             data: [0; PAGE_SIZE * 2],
@@ -361,6 +362,7 @@ mod tests {
     }
 
     #[test]
+    #[cfg_attr(miri, ignore)]
     fn test_no_events() {
         let mut mmapped_buf = MMappedBuf {
             data: [0; PAGE_SIZE * 2],
@@ -376,6 +378,7 @@ mod tests {
     }
 
     #[test]
+    #[cfg_attr(miri, ignore)]
     fn test_read_first_lost() {
         let mut mmapped_buf = MMappedBuf {
             data: [0; PAGE_SIZE * 2],
@@ -440,6 +443,7 @@ mod tests {
     }
 
     #[test]
+    #[cfg_attr(miri, ignore)]
     fn test_read_first_sample() {
         let mut mmapped_buf = MMappedBuf {
             data: [0; PAGE_SIZE * 2],
@@ -457,6 +461,7 @@ mod tests {
     }
 
     #[test]
+    #[cfg_attr(miri, ignore)]
     fn test_read_many_with_many_reads() {
         let mut mmapped_buf = MMappedBuf {
             data: [0; PAGE_SIZE * 2],
@@ -479,6 +484,7 @@ mod tests {
     }
 
     #[test]
+    #[cfg_attr(miri, ignore)]
     fn test_read_many_with_one_read() {
         let mut mmapped_buf = MMappedBuf {
             data: [0; PAGE_SIZE * 2],
@@ -500,6 +506,7 @@ mod tests {
     }
 
     #[test]
+    #[cfg_attr(miri, ignore)]
     fn test_read_last_sample() {
         let mut mmapped_buf = MMappedBuf {
             data: [0; PAGE_SIZE * 2],
@@ -519,6 +526,7 @@ mod tests {
     }
 
     #[test]
+    #[cfg_attr(miri, ignore)]
     fn test_read_wrapping_sample_size() {
         let mut mmapped_buf = MMappedBuf {
             data: [0; PAGE_SIZE * 2],
@@ -547,6 +555,7 @@ mod tests {
     }
 
     #[test]
+    #[cfg_attr(miri, ignore)]
     fn test_read_wrapping_value() {
         let mut mmapped_buf = MMappedBuf {
             data: [0; PAGE_SIZE * 2],