Skip to content

Commit fa60353

Browse files
committed
fix: 更新后编译失败
1 parent 7d84631 commit fa60353

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

Diff for: examples/simple-analyzer/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
use std::{
2020
collections::VecDeque,
2121
sync::{
22-
atomic::{AtomicBool, Ordering},
2322
Arc,
23+
atomic::{AtomicBool, Ordering},
2424
},
2525
time::Duration,
2626
};

Diff for: frame-analyzer-ebpf/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#![no_main]
2121

2222
use aya_ebpf::{
23-
helpers::gen::bpf_ktime_get_ns,
23+
helpers::bpf_ktime_get_ns,
2424
macros::{map, uprobe},
2525
maps::RingBuf,
2626
programs::ProbeContext,

Diff for: frame-analyzer/src/analyze_target.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,5 @@ impl AnalyzeTarget {
7878
}
7979

8080
const unsafe fn trans(buf: &[u8]) -> FrameSignal {
81-
ptr::read_unaligned(buf.as_ptr().cast::<FrameSignal>())
81+
unsafe { ptr::read_unaligned(buf.as_ptr().cast::<FrameSignal>()) }
8282
}

Diff for: frame-analyzer/src/ebpf.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* You should have received a copy of the GNU General Public License
1717
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1818
*/
19-
use aya::{include_bytes_aligned, Bpf};
19+
use aya::{Ebpf, include_bytes_aligned};
2020
use ctor::ctor;
2121

2222
use crate::error::Result;
@@ -32,15 +32,15 @@ fn ebpf_workround() {
3232
unsafe { libc::setrlimit(libc::RLIMIT_MEMLOCK, &rlim) };
3333
}
3434

35-
pub fn load_bpf() -> Result<Bpf> {
35+
pub fn load_bpf() -> Result<Ebpf> {
3636
// This will include eBPF object file as raw bytes at compile-time and load it at runtime.
3737
#[cfg(debug_assertions)]
38-
let bpf = Bpf::load(include_bytes_aligned!(concat!(
38+
let bpf = Ebpf::load(include_bytes_aligned!(concat!(
3939
env!("OUT_DIR"),
4040
"/ebpf_target/bpfel-unknown-none/debug/frame-analyzer-ebpf"
4141
)))?;
4242
#[cfg(not(debug_assertions))]
43-
let bpf = Bpf::load(include_bytes_aligned!(concat!(
43+
let bpf = Ebpf::load(include_bytes_aligned!(concat!(
4444
env!("OUT_DIR"),
4545
"/ebpf_target/bpfel-unknown-none/release/frame-analyzer-ebpf"
4646
)))?;

Diff for: frame-analyzer/src/error.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
*/
1919
use std::io;
2020

21-
use aya::{maps::MapError, programs::ProgramError, BpfError};
21+
use aya::{EbpfError, maps::MapError, programs::ProgramError};
2222
use thiserror::Error;
2323

2424
pub type Result<T> = std::result::Result<T, AnalyzerError>;
2525

2626
#[derive(Error, Debug)]
2727
pub enum AnalyzerError {
2828
#[error(transparent)]
29-
BpfError(#[from] BpfError),
29+
EbpfError(#[from] EbpfError),
3030
#[error(transparent)]
3131
BpfProgramError(#[from] ProgramError),
3232
#[error(transparent)]

Diff for: frame-analyzer/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ use std::{
8686
time::Duration,
8787
};
8888

89-
use mio::{event::Event, unix::SourceFd, Events, Interest, Poll, Token};
89+
use mio::{Events, Interest, Poll, Token, event::Event, unix::SourceFd};
9090

9191
use analyze_target::AnalyzeTarget;
9292
pub use error::AnalyzerError;

Diff for: frame-analyzer/src/uprobe.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1818
*/
1919
use aya::{
20+
Ebpf,
2021
maps::{MapData, RingBuf},
2122
programs::UProbe,
22-
Bpf,
2323
};
2424

2525
use crate::{ebpf::load_bpf, error::Result};
2626

2727
pub struct UprobeHandler {
28-
bpf: Bpf,
28+
bpf: Ebpf,
2929
}
3030

3131
impl Drop for UprobeHandler {

0 commit comments

Comments
 (0)