Quellcode durchsuchen

aya-gen: Rename to aya-tool

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Dave Tucker vor 2 Jahren
Ursprung
Commit
aaa20cc1fd

+ 2 - 2
Cargo.toml

@@ -1,12 +1,12 @@
 [workspace]
 members = [
-    "aya", "aya-gen", "aya-log", "aya-log-common", "aya-log-parser", "test/integration-test", "test/integration-test-macros", "xtask",
+    "aya", "aya-tool", "aya-log", "aya-log-common", "aya-log-parser", "test/integration-test", "test/integration-test-macros", "xtask",
     # macros
     "aya-bpf-macros", "aya-log-ebpf-macros",
     # ebpf crates
     "bpf/aya-bpf", "bpf/aya-bpf-bindings", "bpf/aya-log-ebpf", "test/integration-ebpf"
 ]
-default-members = ["aya", "aya-gen", "aya-log", "aya-bpf-macros", "aya-log-ebpf-macros"]
+default-members = ["aya", "aya-tool", "aya-log", "aya-bpf-macros", "aya-log-ebpf-macros"]
 
 [profile.dev]
 panic = "abort"

+ 1 - 1
aya-gen/Cargo.toml → aya-tool/Cargo.toml

@@ -1,5 +1,5 @@
 [package]
-name = "aya-gen"
+name = "aya-tool"
 version = "0.1.0"
 authors = ["Alessandro Decina <alessandro.d@gmail.com>"]
 edition = "2021"

+ 2 - 1
aya-gen/src/bin/aya-gen.rs → aya-tool/src/bin/aya-tool.rs

@@ -1,4 +1,4 @@
-use aya_gen::generate::{generate, InputFile};
+use aya_tool::generate::{generate, InputFile};
 
 use std::{path::PathBuf, process::exit};
 
@@ -12,6 +12,7 @@ pub struct Options {
 
 #[derive(Parser)]
 enum Command {
+    /// Generate Rust bindings to Kernel types using bpftool
     #[clap(name = "generate", action)]
     Generate {
         #[clap(long, default_value = "/sys/kernel/btf/vmlinux", action)]

+ 0 - 0
aya-gen/src/bindgen.rs → aya-tool/src/bindgen.rs


+ 0 - 0
aya-gen/src/generate.rs → aya-tool/src/generate.rs


+ 0 - 0
aya-gen/src/lib.rs → aya-tool/src/lib.rs


+ 0 - 0
aya-gen/src/rustfmt.rs → aya-tool/src/rustfmt.rs


+ 1 - 1
xtask/Cargo.toml

@@ -5,7 +5,7 @@ authors = ["Alessandro Decina <alessandro.d@gmail.com>"]
 edition = "2021"
 
 [dependencies]
-aya-gen = { path = "../aya-gen" }
+aya-tool = { path = "../aya-tool" }
 clap = { version = "3", features = ["derive"] }
 anyhow = "1"
 syn = "1"

+ 1 - 1
xtask/src/codegen/aya.rs

@@ -1,7 +1,7 @@
 use anyhow::anyhow;
 use std::path::PathBuf;
 
-use aya_gen::{bindgen, write_to_file};
+use aya_tool::{bindgen, write_to_file};
 
 use crate::codegen::{Architecture, Options};
 

+ 2 - 2
xtask/src/codegen/aya_bpf_bindings.rs

@@ -3,7 +3,7 @@ use proc_macro2::TokenStream;
 use quote::ToTokens;
 use std::path::PathBuf;
 
-use aya_gen::{bindgen, write_to_file_fmt};
+use aya_tool::{bindgen, write_to_file_fmt};
 use syn::{parse_str, Item};
 
 use crate::codegen::{
@@ -17,7 +17,7 @@ pub fn codegen(opts: &Options) -> Result<(), anyhow::Error> {
     let builder = || {
         let mut bindgen = bindgen::bpf_builder()
             .header(&*dir.join("include/bindings.h").to_string_lossy())
-            // aya-gen uses aya_bpf::cty. We can't use that here since aya-bpf
+            // aya-tool uses aya_bpf::cty. We can't use that here since aya-bpf
             // depends on aya-bpf-bindings so it would create a circular dep.
             .ctypes_prefix("::aya_bpf_cty")
             .clang_args(&[