Browse Source

aya-obj: update documentation and versioning info

- Set the version number of `aya-obj` to `0.1.0`.
- Update the description of the `aya-obj` crate.
- Add a section in README and rustdoc warning about the unstable API.
Shenghui Ye 2 years ago
parent
commit
9c451a3
5 changed files with 41 additions and 13 deletions
  1. 3 3
      aya-obj/Cargo.toml
  2. 17 3
      aya-obj/README.md
  3. 19 5
      aya-obj/src/lib.rs
  4. 1 1
      aya-obj/src/obj.rs
  5. 1 1
      aya/Cargo.toml

+ 3 - 3
aya-obj/Cargo.toml

@@ -1,8 +1,8 @@
 [package]
 [package]
 name = "aya-obj"
 name = "aya-obj"
-version = "0.11.0"
-description = "A library for loading and relocating eBPF object files"
-keywords = ["ebpf", "bpf", "linux", "kernel"]
+version = "0.1.0"
+description = "An eBPF object file parsing library with BTF and relocation support."
+keywords = ["ebpf", "bpf", "btf", "elf", "object"]
 license = "MIT OR Apache-2.0"
 license = "MIT OR Apache-2.0"
 authors = ["The Aya Contributors"]
 authors = ["The Aya Contributors"]
 repository = "https://github.com/aya-rs/aya"
 repository = "https://github.com/aya-rs/aya"

+ 17 - 3
aya-obj/README.md

@@ -1,4 +1,18 @@
-# aya-obj - an eBPF object file loading library
+# aya-obj
+
+## Status
+
+This crate includes code that started as internal API used by
+the [aya] crate. It has been split out so that it can be used by
+other projects that deal with eBPF object files. Unless you're writing
+low level eBPF plumbing tools, you should not need to use this crate
+but see the [aya] crate instead.
+
+The API as it is today has a few rough edges and is generally not as
+polished nor stable as the main [aya] crate API. As always,
+improvements welcome!
+
+[aya]: https://github.com/aya-rs/aya
 
 
 ## Overview
 ## Overview
 
 
@@ -6,8 +20,8 @@ eBPF programs written with [libbpf] or [aya-bpf] are usually compiled
 into an ELF object file, using various sections to store information
 into an ELF object file, using various sections to store information
 about the eBPF programs.
 about the eBPF programs.
 
 
-`aya-obj` is a library that loads, parses and processes such eBPF
-object files.
+`aya-obj` is a library for parsing such eBPF object files, with BTF and
+relocation support.
 
 
 [libbpf]: https://github.com/libbpf/libbpf
 [libbpf]: https://github.com/libbpf/libbpf
 [aya-bpf]: https://github.com/aya-rs/aya
 [aya-bpf]: https://github.com/aya-rs/aya

+ 19 - 5
aya-obj/src/lib.rs

@@ -1,18 +1,32 @@
-//! A library for loading and relocating eBPF object files.
+//! An eBPF object file parsing library with BTF and relocation support.
 //!
 //!
-//! ## Overview
+//! # Status
+//!
+//! This crate includes code that started as internal API used by
+//! the [aya] crate. It has been split out so that it can be used by
+//! other projects that deal with eBPF object files. Unless you're writing
+//! low level eBPF plumbing tools, you should not need to use this crate
+//! but see the [aya] crate instead.
+//!
+//! The API as it is today has a few rough edges and is generally not as
+//! polished nor stable as the main [aya] crate API. As always,
+//! improvements welcome!
+//!
+//! [aya]: https://github.com/aya-rs/aya
+//!
+//! # Overview
 //!
 //!
 //! eBPF programs written with [libbpf] or [aya-bpf] are usually compiled
 //! eBPF programs written with [libbpf] or [aya-bpf] are usually compiled
 //! into an ELF object file, using various sections to store information
 //! into an ELF object file, using various sections to store information
 //! about the eBPF programs.
 //! about the eBPF programs.
 //!
 //!
-//! `aya-obj` is a library that loads, parses and processes such eBPF
-//! object files.
+//! `aya-obj` is a library for parsing such eBPF object files, with BTF and
+//! relocation support.
 //!
 //!
 //! [libbpf]: https://github.com/libbpf/libbpf
 //! [libbpf]: https://github.com/libbpf/libbpf
 //! [aya-bpf]: https://github.com/aya-rs/aya
 //! [aya-bpf]: https://github.com/aya-rs/aya
 //!
 //!
-//! ## Example
+//! # Example
 //!
 //!
 //! This example loads a simple eBPF program and runs it with [rbpf].
 //! This example loads a simple eBPF program and runs it with [rbpf].
 //!
 //!

+ 1 - 1
aya-obj/src/obj.rs

@@ -140,7 +140,7 @@ pub struct Function {
 ///
 ///
 /// The program name will be used in [Object] as references to each program.
 /// The program name will be used in [Object] as references to each program.
 ///
 ///
-/// ## Unsupported Sections
+/// # Unsupported Sections
 ///
 ///
 /// Currently, the following section names are not supported yet:
 /// Currently, the following section names are not supported yet:
 /// - `flow_dissector`: `BPF_PROG_TYPE_FLOW_DISSECTOR`
 /// - `flow_dissector`: `BPF_PROG_TYPE_FLOW_DISSECTOR`

+ 1 - 1
aya/Cargo.toml

@@ -12,7 +12,7 @@ edition = "2021"
 
 
 [dependencies]
 [dependencies]
 libc = { version = "0.2.105" }
 libc = { version = "0.2.105" }
-aya-obj = { path = "../aya-obj", version = "0.11.0" }
+aya-obj = { path = "../aya-obj", version = "0.1.0" }
 thiserror = "1"
 thiserror = "1"
 object = { version = "0.30", default-features = false, features = ["std", "read_core", "elf"] }
 object = { version = "0.30", default-features = false, features = ["std", "read_core", "elf"] }
 bitflags = "1.2.1"
 bitflags = "1.2.1"