Profile without ELF data
This commit is contained in:
+5
-7
@@ -134,13 +134,13 @@ async fn handle_event(event: ProfileEvent, session: &mut ProfilerSession) -> Res
|
||||
match event {
|
||||
ProfileEvent::Start { file_path } => session.start_profiling(file_path).await,
|
||||
ProfileEvent::Update { cycles, event } => {
|
||||
session.track_elapsed_cycles(cycles)?;
|
||||
session.track_elapsed_cycles(cycles);
|
||||
if let Some(event) = event {
|
||||
session.track_event(event)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn handle_action(
|
||||
@@ -199,8 +199,8 @@ impl ProfilerSession {
|
||||
}
|
||||
}
|
||||
|
||||
async fn start_profiling(&mut self, file_path: PathBuf) -> Result<()> {
|
||||
let program = ProgramState::new(file_path).await?;
|
||||
async fn start_profiling(&mut self, file_path: PathBuf) {
|
||||
let program = ProgramState::new(file_path).await;
|
||||
let recording = if self.recording.is_some() {
|
||||
Some(Recording::new(&program))
|
||||
} else {
|
||||
@@ -208,14 +208,12 @@ impl ProfilerSession {
|
||||
};
|
||||
self.program = Some(program);
|
||||
self.recording = recording;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn track_elapsed_cycles(&mut self, cycles: u32) -> Result<()> {
|
||||
fn track_elapsed_cycles(&mut self, cycles: u32) {
|
||||
if let (Some(state), Some(recording)) = (&self.program, &mut self.recording) {
|
||||
recording.track_elapsed_cycles(state, cycles);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn track_event(&mut self, event: SimEvent) -> Result<()> {
|
||||
|
||||
Reference in New Issue
Block a user