Skip to content

Commit 2dfe265

Browse files
committed
fix examples
1 parent c007f2c commit 2dfe265

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

examples/biosnoop.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use bcc::core::BPF;
22
use bcc::perf::init_perf_map;
3+
use bcc::BccError;
34
use clap::{App, Arg};
4-
use failure::Error;
55

66
use core::sync::atomic::{AtomicBool, Ordering};
77
use std::ptr;
@@ -24,7 +24,7 @@ struct data_t {
2424
name: [u8; 16],
2525
}
2626

27-
fn do_main(runnable: Arc<AtomicBool>) -> Result<(), Error> {
27+
fn do_main(runnable: Arc<AtomicBool>) -> Result<(), BccError> {
2828
let matches = App::new("biosnoop")
2929
.about("Trace block I/O")
3030
.arg(

examples/opensnoop.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ extern crate libc;
55

66
use bcc::core::BPF;
77
use bcc::perf::init_perf_map;
8+
use bcc::BccError;
89
use clap::{App, Arg};
9-
use failure::Error;
1010

1111
use core::sync::atomic::{AtomicBool, Ordering};
1212
use std::ptr;
@@ -34,7 +34,7 @@ struct data_t {
3434
fname: [u8; 255], // NAME_MAX
3535
}
3636

37-
fn do_main(runnable: Arc<AtomicBool>) -> Result<(), Error> {
37+
fn do_main(runnable: Arc<AtomicBool>) -> Result<(), BccError> {
3838
let matches = App::new("opensnoop")
3939
.about("Prints out filename + PID every time a file is opened")
4040
.arg(

examples/runqlat.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use bcc::core::BPF;
2+
use bcc::BccError;
23
use clap::{App, Arg};
3-
use failure::Error;
44

55
use core::sync::atomic::{AtomicBool, Ordering};
66
use std::sync::Arc;
@@ -50,7 +50,7 @@ fn attach_events(bpf: &mut BPF) {
5050
}
5151
}
5252

53-
fn do_main(runnable: Arc<AtomicBool>) -> Result<(), Error> {
53+
fn do_main(runnable: Arc<AtomicBool>) -> Result<(), BccError> {
5454
let matches = App::new("runqlat")
5555
.about("Reports distribution of scheduler latency")
5656
.arg(

examples/strlen.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ extern crate failure;
44
extern crate libc;
55

66
use bcc::core::BPF;
7+
use bcc::BccError;
78
use byteorder::{NativeEndian, ReadBytesExt};
8-
use failure::Error;
99

1010
use core::sync::atomic::{AtomicBool, Ordering};
1111
use std::io::Cursor;
1212
use std::sync::Arc;
1313

14-
fn do_main(runnable: Arc<AtomicBool>) -> Result<(), Error> {
14+
fn do_main(runnable: Arc<AtomicBool>) -> Result<(), BccError> {
1515
let code = "
1616
#include <uapi/linux/ptrace.h>
1717

examples/tcpretrans.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
use bcc::BccError;
12
use bcc::core::BPF;
23
extern crate chrono;
34
use chrono::Utc;
45
use clap::{App, Arg};
5-
use failure::Error;
66

77
use core::sync::atomic::{AtomicBool, Ordering};
88
use std::net::Ipv4Addr;
@@ -38,7 +38,7 @@ struct ipv6_data_t {
3838
type_: u64,
3939
}
4040

41-
fn do_main(runnable: Arc<AtomicBool>) -> Result<(), Error> {
41+
fn do_main(runnable: Arc<AtomicBool>) -> Result<(), BccError> {
4242
let matches = App::new("biosnoop")
4343
.arg(
4444
Arg::with_name("duration")

0 commit comments

Comments
 (0)