diff --git a/Cargo.lock b/Cargo.lock index c949b14..3ce6968 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,7 +8,7 @@ version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ - "gimli 0.31.1", + "gimli", ] [[package]] @@ -118,24 +118,25 @@ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "aya" version = "0.13.1" -source = "git+https://github.com/aya-rs/aya?rev=9261554e3c6ca37e401ec23a287a1ddf9cb1f26d#9261554e3c6ca37e401ec23a287a1ddf9cb1f26d" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d18bc4e506fbb85ab7392ed993a7db4d1a452c71b75a246af4a80ab8c9d2dd50" dependencies = [ "assert_matches", "aya-obj", "bitflags", "bytes", - "hashbrown", "libc", "log", - "object 0.37.3", + "object", "once_cell", - "thiserror 2.0.12", + "thiserror 1.0.69", ] [[package]] name = "aya-build" version = "0.1.2" -source = "git+https://github.com/aya-rs/aya?rev=9261554e3c6ca37e401ec23a287a1ddf9cb1f26d#9261554e3c6ca37e401ec23a287a1ddf9cb1f26d" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "765c92c523541cbf5e3a94c7a6ff4068a4d9537f98a2eeb136461c0537ded8c1" dependencies = [ "anyhow", "cargo_metadata", @@ -147,15 +148,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "783dc1a82a3d71d83286165381dcc1b1d41643f4b110733d135547527c000a9a" dependencies = [ - "aya-ebpf-cty 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "aya-ebpf-bindings" -version = "0.1.1" -source = "git+https://github.com/aya-rs/aya?rev=9261554e3c6ca37e401ec23a287a1ddf9cb1f26d#9261554e3c6ca37e401ec23a287a1ddf9cb1f26d" -dependencies = [ - "aya-ebpf-cty 0.2.2 (git+https://github.com/aya-rs/aya?rev=9261554e3c6ca37e401ec23a287a1ddf9cb1f26d)", + "aya-ebpf-cty", ] [[package]] @@ -164,21 +157,18 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2cce099aaf3abb89f9a1f8594ffe07fa53738ebc2882fac624d10d9ba31a1b10" -[[package]] -name = "aya-ebpf-cty" -version = "0.2.2" -source = "git+https://github.com/aya-rs/aya?rev=9261554e3c6ca37e401ec23a287a1ddf9cb1f26d#9261554e3c6ca37e401ec23a287a1ddf9cb1f26d" - [[package]] name = "aya-obj" version = "0.2.1" -source = "git+https://github.com/aya-rs/aya?rev=9261554e3c6ca37e401ec23a287a1ddf9cb1f26d#9261554e3c6ca37e401ec23a287a1ddf9cb1f26d" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c51b96c5a8ed8705b40d655273bc4212cbbf38d4e3be2788f36306f154523ec7" dependencies = [ "bytes", + "core-error", "hashbrown", "log", - "object 0.37.3", - "thiserror 2.0.12", + "object", + "thiserror 1.0.69", ] [[package]] @@ -191,7 +181,7 @@ dependencies = [ "cfg-if", "libc", "miniz_oxide", - "object 0.36.7", + "object", "rustc-demangle", "windows-targets 0.52.6", ] @@ -234,38 +224,21 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.3.1" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "122ec45a44b270afd1402f351b782c676b173e3c3fb28d86ff7ebfb4d86a4ee4" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" dependencies = [ "serde", ] -[[package]] -name = "cargo-util-schemas" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dc1a6f7b5651af85774ae5a34b4e8be397d9cf4bc063b7e6dbd99a841837830" -dependencies = [ - "semver", - "serde", - "serde-untagged", - "serde-value", - "thiserror 2.0.12", - "toml", - "unicode-xid", - "url", -] - [[package]] name = "cargo_metadata" -version = "0.22.0" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3f56c207c76c07652489840ff98687dcf213de178ac0974660d6fefeaf5ec6" +checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" dependencies = [ "camino", "cargo-platform", - "cargo-util-schemas", "semver", "serde", "serde_json", @@ -377,6 +350,15 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "core-error" +version = "0.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efcdb2972eb64230b4c50646d8498ff73f5128d196a90c7236eec4cbe8619b8f" +dependencies = [ + "version_check", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -537,20 +519,9 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "dwarf-tool" -version = "0.1.0" +version = "0.1.1" dependencies = [ "anyhow", "clap", @@ -575,16 +546,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" -[[package]] -name = "erased-serde" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e004d887f51fcb9fef17317a2f3525c887d8aa3f4f50fed920816a688284a5b7" -dependencies = [ - "serde", - "typeid", -] - [[package]] name = "errno" version = "0.3.13" @@ -629,15 +590,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" -[[package]] -name = "form_urlencoded" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" -dependencies = [ - "percent-encoding", -] - [[package]] name = "futures" version = "0.3.31" @@ -762,7 +714,7 @@ dependencies = [ [[package]] name = "ghostscope" -version = "0.1.0" +version = "0.1.1" dependencies = [ "anyhow", "clap", @@ -793,9 +745,9 @@ dependencies = [ [[package]] name = "ghostscope-compiler" -version = "0.1.0" +version = "0.1.1" dependencies = [ - "aya-ebpf-bindings 0.1.1 (git+https://github.com/aya-rs/aya?rev=9261554e3c6ca37e401ec23a287a1ddf9cb1f26d)", + "aya-ebpf-bindings", "ghostscope-dwarf", "ghostscope-platform", "ghostscope-process", @@ -811,7 +763,7 @@ dependencies = [ [[package]] name = "ghostscope-dwarf" -version = "0.1.0" +version = "0.1.1" dependencies = [ "anyhow", "cpp_demangle", @@ -821,11 +773,11 @@ dependencies = [ "ghostscope-platform", "ghostscope-process", "ghostscope-protocol", - "gimli 0.32.2", + "gimli", "libc", "memmap2", "num_cpus", - "object 0.36.7", + "object", "rayon", "rustc-demangle", "thiserror 2.0.12", @@ -835,7 +787,7 @@ dependencies = [ [[package]] name = "ghostscope-loader" -version = "0.1.0" +version = "0.1.1" dependencies = [ "aya", "aya-obj", @@ -851,16 +803,16 @@ dependencies = [ [[package]] name = "ghostscope-platform" -version = "0.1.0" +version = "0.1.1" dependencies = [ - "aya-ebpf-bindings 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "aya-ebpf-bindings", "serde", "tracing", ] [[package]] name = "ghostscope-process" -version = "0.1.0" +version = "0.1.1" dependencies = [ "anyhow", "aya", @@ -869,18 +821,18 @@ dependencies = [ "bytes", "libc", "log", - "object 0.36.7", + "object", "tracing", ] [[package]] name = "ghostscope-protocol" -version = "0.1.0" +version = "0.1.1" dependencies = [ - "aya-ebpf-bindings 0.1.1 (git+https://github.com/aya-rs/aya?rev=9261554e3c6ca37e401ec23a287a1ddf9cb1f26d)", + "aya-ebpf-bindings", "chrono", "ghostscope-platform", - "gimli 0.32.2", + "gimli", "serde", "serde_json", "tracing", @@ -889,7 +841,7 @@ dependencies = [ [[package]] name = "ghostscope-ui" -version = "0.1.0" +version = "0.1.1" dependencies = [ "anyhow", "chrono", @@ -908,11 +860,6 @@ name = "gimli" version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - -[[package]] -name = "gimli" -version = "0.32.2" -source = "git+https://github.com/gimli-rs/gimli?rev=0c2a60c00792b4d3c31344d8b5d5c6e8d98b5dd5#0c2a60c00792b4d3c31344d8b5d5c6e8d98b5dd5" dependencies = [ "fallible-iterator", "indexmap", @@ -966,119 +913,12 @@ dependencies = [ "cc", ] -[[package]] -name = "icu_collections" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" -dependencies = [ - "displaydoc", - "potential_utf", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locale_core" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_normalizer" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" - -[[package]] -name = "icu_properties" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locale_core", - "icu_properties_data", - "icu_provider", - "potential_utf", - "zerotrie", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" - -[[package]] -name = "icu_provider" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" -dependencies = [ - "displaydoc", - "icu_locale_core", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerotrie", - "zerovec", -] - [[package]] name = "ident_case" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" -dependencies = [ - "idna_adapter", - "smallvec", - "utf8_iter", -] - -[[package]] -name = "idna_adapter" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" -dependencies = [ - "icu_normalizer", - "icu_properties", -] - [[package]] name = "indexmap" version = "2.11.0" @@ -1209,12 +1049,6 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" -[[package]] -name = "litemap" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" - [[package]] name = "llvm-sys" version = "181.2.0" @@ -1333,22 +1167,13 @@ name = "object" version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" -dependencies = [ - "flate2", - "memchr", - "ruzstd", -] - -[[package]] -name = "object" -version = "0.37.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" dependencies = [ "crc32fast", + "flate2", "hashbrown", "indexmap", "memchr", + "ruzstd", ] [[package]] @@ -1369,15 +1194,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" -[[package]] -name = "ordered-float" -version = "2.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" -dependencies = [ - "num-traits", -] - [[package]] name = "overload" version = "0.1.1" @@ -1413,12 +1229,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "percent-encoding" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" - [[package]] name = "pest" version = "2.8.0" @@ -1476,15 +1286,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "potential_utf" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84df19adbe5b5a0782edcab45899906947ab039ccf4573713735ee7de1e6b08a" -dependencies = [ - "zerovec", -] - [[package]] name = "proc-macro2" version = "1.0.95" @@ -1712,27 +1513,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-untagged" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34836a629bcbc6f1afdf0907a744870039b1e14c0561cb26094fa683b158eff3" -dependencies = [ - "erased-serde", - "serde", - "typeid", -] - -[[package]] -name = "serde-value" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" -dependencies = [ - "ordered-float", - "serde", -] - [[package]] name = "serde_derive" version = "1.0.219" @@ -1919,17 +1699,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "synstructure" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "tempfile" version = "3.23.0" @@ -1993,16 +1762,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "tinystr" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" -dependencies = [ - "displaydoc", - "zerovec", -] - [[package]] name = "tokio" version = "1.47.1" @@ -2146,12 +1905,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "typeid" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" - [[package]] name = "typenum" version = "1.18.0" @@ -2193,30 +1946,6 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - -[[package]] -name = "url" -version = "2.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", - "serde", -] - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - [[package]] name = "utf8parse" version = "0.2.2" @@ -2626,36 +2355,6 @@ version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" -[[package]] -name = "writeable" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" - -[[package]] -name = "yoke" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - [[package]] name = "zerocopy" version = "0.8.27" @@ -2675,57 +2374,3 @@ dependencies = [ "quote", "syn", ] - -[[package]] -name = "zerofrom" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "zerotrie" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", -] - -[[package]] -name = "zerovec" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7aa2bd55086f1ab526693ecbe444205da57e25f4489879da80635a46d90e73b" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/Cargo.toml b/Cargo.toml index 71c8a3f..969aaf5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,11 +13,18 @@ members = [ ] [workspace.package] -version = "0.1.0" +version = "0.1.1" edition = "2021" +rust-version = "1.88" authors = ["swananan "] -license = "GPL" +license = "GPL-3.0-only" +description = "GhostScope brings DWARF-aware eBPF tracing to user-space binaries with a printf-like experience." +readme = "README.md" +repository = "https://github.com/swananan/ghostscope" +homepage = "https://github.com/swananan/ghostscope" +documentation = "https://github.com/swananan/ghostscope#readme" keywords = ["ebpf", "gdb", "dwarf", "debugger"] +categories = ["development-tools::debugging", "development-tools::profiling"] [workspace.dependencies] log = "0.4.22" @@ -38,11 +45,11 @@ toml = "0.8" dirs = "5.0" object = "0.36" -gimli = { git = "https://github.com/gimli-rs/gimli", rev = "0c2a60c00792b4d3c31344d8b5d5c6e8d98b5dd5" } -aya = { git = "https://github.com/aya-rs/aya", rev = "9261554e3c6ca37e401ec23a287a1ddf9cb1f26d" } -aya-obj = { git = "https://github.com/aya-rs/aya", rev = "9261554e3c6ca37e401ec23a287a1ddf9cb1f26d" } -aya-ebpf-bindings = { git = "https://github.com/aya-rs/aya", rev = "9261554e3c6ca37e401ec23a287a1ddf9cb1f26d" } -aya-build = { git = "https://github.com/aya-rs/aya", rev = "9261554e3c6ca37e401ec23a287a1ddf9cb1f26d" } +gimli = "0.31.1" +aya = "0.13.1" +aya-obj = "0.2.1" +aya-ebpf-bindings = "0.1.1" +aya-build = "0.1.2" # Test dependencies tempfile = "3.8" diff --git a/README-zh.md b/README-zh.md index 7951ab3..6293887 100644 --- a/README-zh.md +++ b/README-zh.md @@ -1,19 +1,17 @@
- GhostScope Logo + GhostScope Logo

GhostScope

⚡ 下一代 eBPF 用户态运行时追踪器

- Printf 调试的进化 — 无需停止和修改应用即可实时追踪 + Printf 调试的进化 — 无需停止或修改应用即可实时追踪。

-

- Version - License: GPL + 版本 + 协议 Linux 4.4+ Rust 1.88.0

-

@@ -39,7 +37,7 @@ GhostScope 将编译后的二进制文件转变为可观测系统。在函数入
- GhostScope Demo + GhostScope Demo

实时追踪运行中的 nginx worker 进程

@@ -49,28 +47,28 @@ GhostScope 将编译后的二进制文件转变为可观测系统。在函数入
- Performance + Performance
零开销
仅需一次上下文切换 + eBPF 执行
- Real-time + Real-time
实时追踪
实时跟踪流
- DWARF + DWARF
DWARF 感知
完整调试信息支持
- Rust + Rust
Rust 构建
diff --git a/README.md b/README.md index 000f1f6..336fa9d 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,21 @@
- GhostScope Logo + GhostScope Logo

GhostScope

-

⚡ Next-Generation eBPF Userspace Runtime Tracer

+

⚡ Next-generation eBPF userspace runtime tracer

Printf debugging evolved — Real-time tracing without stopping your application.

-

- Version - License: GPL + Version + License Linux 4.4+ Rust 1.88.0

-

中文文档

-

@@ -44,7 +41,7 @@ The demo below shows GhostScope tracing an nginx worker process with debug infor
- GhostScope Demo + GhostScope Demo

Real-time tracing of a running nginx worker process

@@ -54,28 +51,28 @@ The demo below shows GhostScope tracing an nginx worker process with debug infor
- Performance + Performance
Zero Overhead
One context switch + eBPF execution
- Real-time + Real-time
Real-Time Tracing
Live trace streaming
- DWARF + DWARF
DWARF-Aware
Full debug info support
- Rust + Rust
Built with Rust
diff --git a/bins/dwarf-tool/Cargo.toml b/bins/dwarf-tool/Cargo.toml index c64ff6d..e7ddc2b 100644 --- a/bins/dwarf-tool/Cargo.toml +++ b/bins/dwarf-tool/Cargo.toml @@ -4,14 +4,22 @@ version.workspace = true edition.workspace = true authors.workspace = true license.workspace = true +rust-version.workspace = true +readme = "README.md" +repository.workspace = true +homepage.workspace = true +documentation.workspace = true +keywords.workspace = true +categories.workspace = true +description = "Standalone helper binary for inspecting DWARF data with GhostScope parsers." [[bin]] name = "dwarf-tool" path = "src/main.rs" [dependencies] -ghostscope-dwarf = { path = "../../ghostscope-dwarf" } -ghostscope-process = { path = "../../ghostscope-process" } +ghostscope-dwarf = { version = "0.1.1", path = "../../ghostscope-dwarf" } +ghostscope-process = { version = "0.1.1", path = "../../ghostscope-process" } # Command line parsing clap.workspace = true diff --git a/bins/dwarf-tool/README.md b/bins/dwarf-tool/README.md new file mode 100644 index 0000000..0ce0354 --- /dev/null +++ b/bins/dwarf-tool/README.md @@ -0,0 +1,5 @@ +# dwarf-tool + +`dwarf-tool` is a standalone binary that ships with GhostScope for inspecting DWARF information and validating the `ghostscope-dwarf` parser stack. It is useful when debugging symbol resolution without running the full tracing pipeline. + +Usage examples and context can be found in the main documentation: . diff --git a/ghostscope-compiler/Cargo.toml b/ghostscope-compiler/Cargo.toml index 3cc7827..824f041 100644 --- a/ghostscope-compiler/Cargo.toml +++ b/ghostscope-compiler/Cargo.toml @@ -1,7 +1,17 @@ [package] name = "ghostscope-compiler" -version = "0.1.0" -edition = "2021" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +authors.workspace = true +readme = "README.md" +repository.workspace = true +homepage.workspace = true +documentation.workspace = true +keywords.workspace = true +categories.workspace = true +description = "Compiles GhostScope trace definitions into DWARF-aware eBPF programs ready for injection." [dependencies] inkwell = { version = "0.6.0", features = ["llvm18-1", "target-bpf"] } @@ -12,7 +22,7 @@ tracing-log = { workspace = true } thiserror = { workspace = true } tracing-subscriber = { workspace = true } aya-ebpf-bindings = { workspace = true } -ghostscope-dwarf = { path = "../ghostscope-dwarf" } -ghostscope-protocol = { path = "../ghostscope-protocol" } -ghostscope-platform = { path = "../ghostscope-platform" } -ghostscope-process = { path = "../ghostscope-process" } +ghostscope-dwarf = { version = "0.1.1", path = "../ghostscope-dwarf" } +ghostscope-protocol = { version = "0.1.1", path = "../ghostscope-protocol" } +ghostscope-platform = { version = "0.1.1", path = "../ghostscope-platform" } +ghostscope-process = { version = "0.1.1", path = "../ghostscope-process" } diff --git a/ghostscope-compiler/README.md b/ghostscope-compiler/README.md new file mode 100644 index 0000000..7053467 --- /dev/null +++ b/ghostscope-compiler/README.md @@ -0,0 +1,9 @@ +# ghostscope-compiler + +`ghostscope-compiler` turns GhostScope trace definitions into DWARF-aware eBPF programs. It parses the DSL, performs DWARF resolution, and emits IR that targets LLVM's BPF backend. + +## Build Requirements +- LLVM 18.x with `llvm-config` available on `PATH` (or set `LLVM_CONFIG_PATH`) +- The `inkwell` crate's `llvm18-1` feature expects a shared build; consult your package manager or build from source with `-DLLVM_ENABLE_PROJECTS=clang;lld` + +If LLVM lives in a non-standard directory, export `LLVM_SYS_180_PREFIX` or `LLVM_CONFIG_PATH` before invoking Cargo. The top-level documentation explains the full workflow: . diff --git a/ghostscope-dwarf/Cargo.toml b/ghostscope-dwarf/Cargo.toml index f648678..a92bba4 100644 --- a/ghostscope-dwarf/Cargo.toml +++ b/ghostscope-dwarf/Cargo.toml @@ -5,6 +5,13 @@ edition.workspace = true authors.workspace = true license.workspace = true keywords.workspace = true +rust-version.workspace = true +readme = "README.md" +repository.workspace = true +homepage.workspace = true +documentation.workspace = true +categories.workspace = true +description = "DWARF parser and symbolizer used by GhostScope to resolve variables and types at runtime." [dependencies] gimli.workspace = true @@ -13,9 +20,9 @@ memmap2 = "0.9" anyhow.workspace = true tracing.workspace = true thiserror.workspace = true -ghostscope-platform = { path = "../ghostscope-platform" } -ghostscope-protocol = { path = "../ghostscope-protocol" } -ghostscope-process = { path = "../ghostscope-process" } +ghostscope-platform = { version = "0.1.1", path = "../ghostscope-platform" } +ghostscope-protocol = { version = "0.1.1", path = "../ghostscope-protocol" } +ghostscope-process = { version = "0.1.1", path = "../ghostscope-process" } rustc-demangle = "0.1" cpp_demangle = "0.4" rayon = "1.10" diff --git a/ghostscope-dwarf/README.md b/ghostscope-dwarf/README.md new file mode 100644 index 0000000..61a82f3 --- /dev/null +++ b/ghostscope-dwarf/README.md @@ -0,0 +1,5 @@ +# ghostscope-dwarf + +`ghostscope-dwarf` parses DWARF data from ELF binaries so GhostScope can resolve variables, types, and addresses at runtime. It wraps `gimli`, `object`, `memmap2`, and symbol demanglers, and exposes async-friendly helpers for the rest of the workspace. + +Consumers typically do not use this crate directly; it is re-exported via higher-level components. See the main GhostScope docs for usage examples: . diff --git a/ghostscope-loader/Cargo.toml b/ghostscope-loader/Cargo.toml index 7bcd3c2..3824253 100644 --- a/ghostscope-loader/Cargo.toml +++ b/ghostscope-loader/Cargo.toml @@ -1,12 +1,22 @@ [package] name = "ghostscope-loader" -version = "0.1.0" -edition = "2021" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +authors.workspace = true +readme = "README.md" +repository.workspace = true +homepage.workspace = true +documentation.workspace = true +keywords.workspace = true +categories.workspace = true +description = "Loads compiled GhostScope programs, manages sessions, and orchestrates eBPF lifecycle." [dependencies] -ghostscope-compiler = { path = "../ghostscope-compiler" } -ghostscope-protocol = { path = "../ghostscope-protocol" } -ghostscope-process = { path = "../ghostscope-process" } +ghostscope-compiler = { version = "0.1.1", path = "../ghostscope-compiler" } +ghostscope-protocol = { version = "0.1.1", path = "../ghostscope-protocol" } +ghostscope-process = { version = "0.1.1", path = "../ghostscope-process" } aya = { workspace = true } aya-obj = { workspace = true } tracing = { workspace = true } diff --git a/ghostscope-loader/README.md b/ghostscope-loader/README.md new file mode 100644 index 0000000..f7a884b --- /dev/null +++ b/ghostscope-loader/README.md @@ -0,0 +1,9 @@ +# ghostscope-loader + +`ghostscope-loader` manages eBPF program lifecycles for GhostScope sessions. It loads bytecode emitted by `ghostscope-compiler`, attaches uprobes, and coordinates per-session resources. + +## Build Notes +- Requires libbpf-compatible kernel headers and the `aya` user-space stack +- Optional `tokio` features (`io-util`, `mio`, `net`) are enabled to support async device IO + +See the root project guide for usage examples: . diff --git a/ghostscope-loader/src/lib.rs b/ghostscope-loader/src/lib.rs index c6e00bc..0c11958 100644 --- a/ghostscope-loader/src/lib.rs +++ b/ghostscope-loader/src/lib.rs @@ -17,10 +17,7 @@ use aya::{ maps::{perf::PerfEventArray, MapData, RingBuf}, - programs::{ - uprobe::{UProbeAttachLocation, UProbeLinkId}, - ProgramError, UProbe, - }, + programs::{uprobe::UProbeLinkId, ProgramError, UProbe}, Ebpf, EbpfLoader, VerifierLogLevel, }; use ghostscope_protocol::{ParsedTraceEvent, StreamingTraceParser, TraceContext}; @@ -30,6 +27,7 @@ use std::convert::TryInto; use std::future::poll_fn; use std::os::unix::io::AsRawFd; use std::os::unix::io::RawFd; +use std::path::Path; use std::task::Poll; use tokio::io::unix::AsyncFd; use tokio::io::Interest; @@ -74,6 +72,27 @@ struct PerfEventCpuBuffer { readiness: AsyncFd, } +/// Compatibility shim that mimics Aya's newer attach location helper so we can keep +/// a single call-site regardless of which `UProbe::attach` signature we compile against. +enum UProbeAttachLocation<'a> { + AbsoluteOffset(u64), + Function(&'a str), +} + +impl<'a> UProbeAttachLocation<'a> { + fn attach>( + self, + program: &mut UProbe, + target: T, + pid: Option, + ) -> std::result::Result { + match self { + Self::AbsoluteOffset(offset) => program.attach(None, offset, target, pid), + Self::Function(fn_name) => program.attach(Some(fn_name), 0, target, pid), + } + } +} + pub fn hello() -> String { format!("Loader: {}", ghostscope_compiler::hello()) } @@ -349,20 +368,13 @@ impl GhostScopeLoader { } } - // Attach the uprobe using aya API - // If we have an offset, use it; otherwise fall back to function name - let attach_result = if let Some(offset) = offset { - // Use absolute offset-based attachment - program.attach( - UProbeAttachLocation::AbsoluteOffset(offset), - target_binary, - None, - None, - ) - } else { - // Use function name-based attachment - program.attach(function_name, target_binary, None, None) + // Attach the uprobe using Aya API via a compatibility helper + // so argument ordering stays explicit regardless of Aya version. + let attach_location = match offset { + Some(offset) => UProbeAttachLocation::AbsoluteOffset(offset), + None => UProbeAttachLocation::Function(function_name), }; + let attach_result = attach_location.attach(program, target_binary, pid); match attach_result { Ok(link) => { @@ -584,21 +596,11 @@ impl GhostScopeLoader { })?; // Attach the uprobe directly (don't load - it's already loaded) - let attach_result = if let Some(offset) = params.offset { - program.attach( - UProbeAttachLocation::AbsoluteOffset(offset), - ¶ms.target_binary, - None, - None, - ) - } else { - program.attach( - params.function_name.as_str(), - ¶ms.target_binary, - None, - None, - ) + let attach_location = match params.offset { + Some(offset) => UProbeAttachLocation::AbsoluteOffset(offset), + None => UProbeAttachLocation::Function(params.function_name.as_str()), }; + let attach_result = attach_location.attach(program, ¶ms.target_binary, params.pid); match attach_result { Ok(link) => { diff --git a/ghostscope-platform/Cargo.toml b/ghostscope-platform/Cargo.toml index 900402f..3eae969 100644 --- a/ghostscope-platform/Cargo.toml +++ b/ghostscope-platform/Cargo.toml @@ -1,11 +1,21 @@ [package] name = "ghostscope-platform" -version = "0.1.0" -edition = "2021" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +authors.workspace = true +readme = "README.md" +repository.workspace = true +homepage.workspace = true +documentation.workspace = true +keywords.workspace = true +categories.workspace = true +description = "Platform abstraction layer that normalizes kernel, architecture, and BTF quirks for GhostScope." [dependencies] -tracing = "0.1" -aya-ebpf-bindings = "0.1" -serde = { version = "1.0", features = ["derive"] } +tracing = { workspace = true } +aya-ebpf-bindings = { workspace = true } +serde = { workspace = true } -[dev-dependencies] \ No newline at end of file +[dev-dependencies] diff --git a/ghostscope-platform/README.md b/ghostscope-platform/README.md new file mode 100644 index 0000000..5d0fa39 --- /dev/null +++ b/ghostscope-platform/README.md @@ -0,0 +1,5 @@ +# ghostscope-platform + +`ghostscope-platform` abstracts kernel, architecture, and BTF quirks so the rest of GhostScope can reason about processes in a portable way. It normalizes kernel symbols, exposes helper traits, and provides struct definitions shared with the protocol crate. + +Refer to the workspace documentation for background and integration details: . diff --git a/ghostscope-process/Cargo.toml b/ghostscope-process/Cargo.toml index f31377f..adfb5f5 100644 --- a/ghostscope-process/Cargo.toml +++ b/ghostscope-process/Cargo.toml @@ -1,7 +1,17 @@ [package] name = "ghostscope-process" -version = "0.1.0" -edition = "2021" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +authors.workspace = true +readme = "README.md" +repository.workspace = true +homepage.workspace = true +documentation.workspace = true +keywords.workspace = true +categories.workspace = true +description = "Low-level process controller that coordinates probes, loaders, and eBPF programs on target binaries." [dependencies] anyhow = { workspace = true } diff --git a/ghostscope-process/README.md b/ghostscope-process/README.md new file mode 100644 index 0000000..6f9a404 --- /dev/null +++ b/ghostscope-process/README.md @@ -0,0 +1,17 @@ +# ghostscope-process + +`ghostscope-process` drives low-level process orchestration for GhostScope. It selects attachment points, prepares loader state, and exposes helpers consumed by both user-space and eBPF code. + +## eBPF Artifacts +Prebuilt CO-RE objects live under `ebpf/obj/`. The `build.rs` script copies them into the Cargo output directory. If you need to regenerate the objects: + +```bash +$ ./ghostscope-process/ebpf/build_sysmon_bpf.sh +``` + +The script expects: +- Rust nightly toolchain (default `nightly-2024-07-01`) with the `bpfel-unknown-none` and `bpfeb-unknown-none` targets +- `rust-src` component installed for that toolchain +- `clang`, `llc`, and `bpftool` available on `PATH` + +Additional details are documented in the workspace README: . diff --git a/ghostscope-protocol/Cargo.toml b/ghostscope-protocol/Cargo.toml index 1a60cd2..d9e938c 100644 --- a/ghostscope-protocol/Cargo.toml +++ b/ghostscope-protocol/Cargo.toml @@ -1,7 +1,17 @@ [package] name = "ghostscope-protocol" -version = "0.1.0" -edition = "2021" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +authors.workspace = true +readme = "README.md" +repository.workspace = true +homepage.workspace = true +documentation.workspace = true +keywords.workspace = true +categories.workspace = true +description = "Shared protocol definitions and serialization glue for GhostScope components." [dependencies] serde = { workspace = true } @@ -10,5 +20,5 @@ tracing = { workspace = true } chrono = { workspace = true } aya-ebpf-bindings = { workspace = true } gimli = { workspace = true } -ghostscope-platform = { path = "../ghostscope-platform" } +ghostscope-platform = { version = "0.1.1", path = "../ghostscope-platform" } zerocopy = { version = "0.8", features = ["derive"] } diff --git a/ghostscope-protocol/README.md b/ghostscope-protocol/README.md new file mode 100644 index 0000000..9d86f3c --- /dev/null +++ b/ghostscope-protocol/README.md @@ -0,0 +1,5 @@ +# ghostscope-protocol + +`ghostscope-protocol` defines the shared data structures, serialization, and message formats that connect GhostScope components. It relies on `serde`, `zerocopy`, and DWARF metadata pulled in through `ghostscope-dwarf`/`ghostscope-platform`. + +This crate has no binaries; it is a pure Rust library meant to be consumed by other workspace members. Documentation and examples live in the main repo: . diff --git a/ghostscope-ui/Cargo.toml b/ghostscope-ui/Cargo.toml index 15e436c..d386e18 100644 --- a/ghostscope-ui/Cargo.toml +++ b/ghostscope-ui/Cargo.toml @@ -1,10 +1,20 @@ [package] name = "ghostscope-ui" -version = "0.1.0" -edition = "2021" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +authors.workspace = true +readme = "README.md" +repository.workspace = true +homepage.workspace = true +documentation.workspace = true +keywords.workspace = true +categories.workspace = true +description = "Terminal user interface that streams GhostScope traces with async input handling." [dependencies] -ghostscope-protocol = { path = "../ghostscope-protocol" } +ghostscope-protocol = { version = "0.1.1", path = "../ghostscope-protocol" } ratatui = "0.28" crossterm = { workspace = true } futures-util = { workspace = true } diff --git a/ghostscope-ui/README.md b/ghostscope-ui/README.md new file mode 100644 index 0000000..2d85a7a --- /dev/null +++ b/ghostscope-ui/README.md @@ -0,0 +1,5 @@ +# ghostscope-ui + +`ghostscope-ui` is the async TUI for GhostScope. It renders live trace output, handles keyboard interaction, and summaries of variables/structures streamed over the GhostScope protocol. + +It builds on `ratatui`, `tokio`, and `crossterm`. For screenshots and walkthroughs, visit . diff --git a/ghostscope/Cargo.toml b/ghostscope/Cargo.toml index 62daafb..05be2a5 100644 --- a/ghostscope/Cargo.toml +++ b/ghostscope/Cargo.toml @@ -1,15 +1,25 @@ [package] name = "ghostscope" -version = "0.1.0" -edition = "2021" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +authors.workspace = true +readme = "README.md" +repository.workspace = true +homepage.workspace = true +documentation.workspace = true +keywords.workspace = true +categories.workspace = true +description = "Command-line entrypoint that drives GhostScope compiler, loader, and UI end-to-end." [dependencies] -ghostscope-compiler = { path = "../ghostscope-compiler" } -ghostscope-loader = { path = "../ghostscope-loader" } -ghostscope-ui = { path = "../ghostscope-ui" } -ghostscope-dwarf = { path = "../ghostscope-dwarf" } -ghostscope-protocol = { path = "../ghostscope-protocol" } -ghostscope-process = { path = "../ghostscope-process" } +ghostscope-compiler = { version = "0.1.1", path = "../ghostscope-compiler" } +ghostscope-loader = { version = "0.1.1", path = "../ghostscope-loader" } +ghostscope-ui = { version = "0.1.1", path = "../ghostscope-ui" } +ghostscope-dwarf = { version = "0.1.1", path = "../ghostscope-dwarf" } +ghostscope-protocol = { version = "0.1.1", path = "../ghostscope-protocol" } +ghostscope-process = { version = "0.1.1", path = "../ghostscope-process" } dirs = "5.0" libc = "0.2" clap = { version = "4.0", features = ["derive"] } diff --git a/ghostscope/README.md b/ghostscope/README.md new file mode 100644 index 0000000..29f62d4 --- /dev/null +++ b/ghostscope/README.md @@ -0,0 +1,10 @@ +# ghostscope + +`ghostscope` is the CLI entrypoint for the GhostScope workspace. It wires together the compiler, loader, and TUI so you can inject DWARF-aware eBPF tracepoints with a single command. + +## Highlights +- Parses `.gs` trace scripts and drives `ghostscope-compiler` +- Coordinates `ghostscope-loader` to inject generated eBPF programs into target processes +- Streams structured trace output through `ghostscope-ui` + +For screenshots, tutorials, and in-depth docs visit the [main GhostScope repository](https://github.com/swananan/ghostscope#readme).