mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-26 19:03:27 +00:00
Correct OSDK profiling tool's behavior
This commit is contained in:
committed by
Junyang Zhang
parent
63d0a05e14
commit
c85986caed
@ -107,21 +107,21 @@ fn do_collect_stack_traces(args: &ProfileArgs) {
|
|||||||
let style = ProgressStyle::default_bar().progress_chars("#>-");
|
let style = ProgressStyle::default_bar().progress_chars("#>-");
|
||||||
for _ in (0..*samples).progress_with_style(style) {
|
for _ in (0..*samples).progress_with_style(style) {
|
||||||
loop {
|
loop {
|
||||||
|
gdb_stdout_buf.clear();
|
||||||
let _ = gdb_stdout_reader.read_line(&mut gdb_stdout_buf);
|
let _ = gdb_stdout_reader.read_line(&mut gdb_stdout_buf);
|
||||||
gdb_output.push_str(&gdb_stdout_buf);
|
gdb_output.push_str(&gdb_stdout_buf);
|
||||||
if gdb_stdout_buf.contains(profile_round_delimiter!()) {
|
if gdb_stdout_buf.contains(profile_round_delimiter!()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
gdb_stdout_buf.clear();
|
|
||||||
}
|
}
|
||||||
let _ = Command::new("kill")
|
|
||||||
.args(["-INT", &format!("{}", gdb_process.id())])
|
|
||||||
.spawn();
|
|
||||||
for line in gdb_output.lines() {
|
for line in gdb_output.lines() {
|
||||||
profile_buffer.append_raw_line(line);
|
profile_buffer.append_raw_line(line);
|
||||||
}
|
}
|
||||||
gdb_output.clear();
|
gdb_output.clear();
|
||||||
thread::sleep(time::Duration::from_secs_f64(*interval));
|
thread::sleep(time::Duration::from_secs_f64(*interval));
|
||||||
|
let _ = Command::new("kill")
|
||||||
|
.args(["-INT", &format!("{}", gdb_process.id())])
|
||||||
|
.output();
|
||||||
}
|
}
|
||||||
|
|
||||||
let out_args = &args.out_args;
|
let out_args = &args.out_args;
|
||||||
|
Reference in New Issue
Block a user