Merge pull request #374 from dave-tucker/aya-tool

aya-gen: Rename to aya-tool
pull/285/head
Dave Tucker 2 years ago committed by GitHub
commit 906c25ff23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,12 +1,12 @@
[workspace] [workspace]
members = [ 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 # macros
"aya-bpf-macros", "aya-log-ebpf-macros", "aya-bpf-macros", "aya-log-ebpf-macros",
# ebpf crates # ebpf crates
"bpf/aya-bpf", "bpf/aya-bpf-bindings", "bpf/aya-log-ebpf", "test/integration-ebpf" "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] [profile.dev]
panic = "abort" panic = "abort"

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

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

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

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

@ -3,7 +3,7 @@ use proc_macro2::TokenStream;
use quote::ToTokens; use quote::ToTokens;
use std::path::PathBuf; 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 syn::{parse_str, Item};
use crate::codegen::{ use crate::codegen::{
@ -17,7 +17,7 @@ pub fn codegen(opts: &Options) -> Result<(), anyhow::Error> {
let builder = || { let builder = || {
let mut bindgen = bindgen::bpf_builder() let mut bindgen = bindgen::bpf_builder()
.header(&*dir.join("include/bindings.h").to_string_lossy()) .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. // depends on aya-bpf-bindings so it would create a circular dep.
.ctypes_prefix("::aya_bpf_cty") .ctypes_prefix("::aya_bpf_cty")
.clang_args(&[ .clang_args(&[

Loading…
Cancel
Save