aya-gen: Rename to aya-tool

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
pull/374/head
Dave Tucker 2 years ago
parent 4826bf7f74
commit aaa20cc1fd

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

@ -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)]

@ -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,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};

@ -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(&[

Loading…
Cancel
Save