Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compile instruction to compile profile-bee? #5

Open
vincentmli opened this issue Jan 31, 2023 · 5 comments
Open

Add compile instruction to compile profile-bee? #5

vincentmli opened this issue Jan 31, 2023 · 5 comments

Comments

@vincentmli
Copy link

Hi,

Could you add instruction to compile profile-bee, sorry totally newbie to rust here :)

@tippexs
Copy link

tippexs commented Feb 13, 2023

Hi @vincentmli all you need to do is mentioned here.
https://github.com/zz85/profile-bee#development

In case you are not familiar with cargo and friends you should read something about in the rust book. Let me drop a link.
https://doc.rust-lang.org/cargo/

@vincentmli
Copy link
Author

@tippexs thanks for the reply, I had this error

Compiling profile-bee v0.1.0 (/usr/src/profile-bee/profile-bee)
warning: unused import: ObjItem
--> profile-bee/src/process.rs:5:22
|
5 | use crate::symbols::{ObjItem, StackFrameInfo};
| ^^^^^^^
|
= note: #[warn(unused_imports)] on by default

Compiling xtask v0.1.0 (/usr/src/profile-bee/xtask)
warning: profile-bee (lib) generated 1 warning
error: couldn't read profile-bee/bin/../../target/bpfel-unknown-none/debug/profile-bee: No such file or directory (os error 2)
--> profile-bee/bin/profile-bee.rs:109:16
|
109 | let data = include_bytes_aligned!("../../target/bpfel-unknown-none/debug/profile-bee");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in the macro include_bytes which comes from the expansion of the macro include_bytes_aligned (in Nightly builds, run with -Z macro-backtrace for more info)

warning: unused import: MapRefMut
--> profile-bee/bin/profile-bee.rs:2:26
|
2 | use aya::maps::{HashMap, MapRefMut, Queue, StackTraceMap};
| ^^^^^^^^^
|
= note: #[warn(unused_imports)] on by default

warning: unused import: Bpf
--> profile-bee/bin/profile-bee.rs:9:53
|
9 | use aya::{include_bytes_aligned, util::online_cpus, Bpf};
| ^^^

warning: unused import: log::info
--> profile-bee/bin/profile-bee.rs:14:5
|
14 | use log::info;
| ^^^^^^^^^

warning: unused import: signal
--> profile-bee/bin/profile-bee.rs:18:13
|
18 | use tokio::{signal, task};
| ^^^^^^

error[E0277]: the size for values of type [u8] cannot be known at compilation time
--> profile-bee/bin/profile-bee.rs:109:16
|
109 | let data = include_bytes_aligned!("../../target/bpfel-unknown-none/debug/profile-bee");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: within Aligned<[u8]>, the trait Sized is not implemented for [u8]
note: required because it appears within the type Aligned<[u8]>
--> profile-bee/bin/profile-bee.rs:109:16
|
109 | let data = include_bytes_aligned!("../../target/bpfel-unknown-none/debug/profile-bee");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: structs must have a statically known size to be initialized
= note: this error originates in the macro include_bytes_aligned (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try rustc --explain E0277.
warning: profile-bee (bin "profile-bee") generated 4 warnings
error: could not compile profile-bee due to 2 previous errors; 4 warnings emitted
warning: build failed, waiting for other jobs to finish...

@vincentmli
Copy link
Author

root@vli-2004:/usr/src/profile-bee# cargo xtask build-ebpf
Finished dev [unoptimized + debuginfo] target(s) in 0.06s
Running target/debug/xtask build-ebpf
error: "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/Cargo.lock" does not exist, unable to build with the standard library, try:
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu <===THIS corrected the error
thread 'main' panicked at 'assertion failed: status.success()', xtask/src/build_ebpf.rs:62:5
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
root@vli-2004:/usr/src/profile-bee# rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
info: downloading component 'rust-src'
info: installing component 'rust-src'
root@vli-2004:/usr/src/profile-bee# cargo xtask build-ebpf

@RoySunnySean007
Copy link

RoySunnySean007 commented Nov 29, 2023

I like the profile-bee very much, but failed to compile it...:(
I also encountered the similar error, could u please kindly suggest, @tippexs ?

Cargo build
cargobuilderror.txt

cargo xtask build-ebpf
cargo_xtask_build_ebpfError.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@vincentmli @tippexs @RoySunnySean007 and others