Skip to content

Commit

Permalink
AVX-47819: Add support for recording ethtool stats (facebookincubator#12
Browse files Browse the repository at this point in the history
)

Support for ethtool stats.
  • Loading branch information
mmynk committed Apr 26, 2024
1 parent 5b3c5a3 commit 3ba97b6
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
58 changes: 58 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions below/ethtool/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/// This build script generates Rust bindings for the ethtool API.
fn main() {
let api_dir = "src/api";

let bindings = bindgen::Builder::default()
.header(format!("{}/ethtool.h", api_dir))
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.generate()
.expect("Unable to generate bindings");

let out_path = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap());
bindings
.write_to_file(out_path.join("ethtool_bindings.rs"))
.expect("Couldn't write bindings!");
}
1 change: 1 addition & 0 deletions below/ethtool/src/api/ethtool.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include <linux/ethtool.h>

0 comments on commit 3ba97b6

Please sign in to comment.