-
Notifications
You must be signed in to change notification settings - Fork 104
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
[Bug]Report is empty? #176
Comments
I guess it's simply because this program runs too fast, and no sample has been caught... fn main() {
let guard = pprof::ProfilerGuardBuilder::default()
.frequency(1000)
.blocklist(&["libc", "libgcc", "pthread", "vdso"])
.build()
.unwrap();
let mut sum = 0;
for i in 1..1_000_000_000 {
for j in 1..i {
for k in 1..10 {
sum += i*j*k;
}
}
}
println!("{:?}", sum);
if let Ok(report) = guard.report().build() {
println!("report: {:?}", &report);
let file = std::fs::File::create("flamegraph.svg").unwrap();
report.flamegraph(file).unwrap();
}
} Will give you one backtrace through |
Thx, I have solved this problem. impl Timer {
pub fn new(frequency: c_int) -> Timer {
let interval = 1e6 as i64 / i64::from(frequency);
let it_interval = Timeval {
tv_sec: interval / 1e6 as i64,
tv_usec: interval % 1e6 as i64,
};
......
} It looks like that frequency should less than 1e6. |
Not sure if this is the case but it could be related to issue #177 |
I found following test code can't collect any data during execution, and the flamegraph is blank.
cargo run
's output:My test environment:
The text was updated successfully, but these errors were encountered: