summaryrefslogtreecommitdiff
path: root/profcollectd
diff options
context:
space:
mode:
authorYi Kong <yikong@google.com>2021-12-05 13:17:39 +0800
committerYi Kong <yikong@google.com>2021-12-05 13:21:18 +0800
commitfd24c6ed403531f970cce36a6abb44d580aba669 (patch)
treed67b0f818db0d2f05bbff0ae691a2c683e0981d4 /profcollectd
parent62df5cf33408fa6543c9457acca8fe30ce89a8ff (diff)
downloadextras-fd24c6ed403531f970cce36a6abb44d580aba669.tar.gz
profcollectd: process reports on the main thread
It was a leftover from the old implementation. There is no point to create a thread and immediately joins it. Test: presubmit Change-Id: Id0f095f4ed231cf822a449b53cb2b05f0649a7fa
Diffstat (limited to 'profcollectd')
-rw-r--r--profcollectd/libprofcollectd/scheduler.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/profcollectd/libprofcollectd/scheduler.rs b/profcollectd/libprofcollectd/scheduler.rs
index b0b322e1..29a14ff4 100644
--- a/profcollectd/libprofcollectd/scheduler.rs
+++ b/profcollectd/libprofcollectd/scheduler.rs
@@ -97,15 +97,11 @@ impl Scheduler {
pub fn process(&self) -> Result<()> {
let trace_provider = self.trace_provider.clone();
- let handle = thread::spawn(move || {
- trace_provider
- .lock()
- .unwrap()
- .process(&TRACE_OUTPUT_DIR, &PROFILE_OUTPUT_DIR, BINARY_FILTER)
- .expect("Failed to process profiles.");
- });
-
- handle.join().map_err(|_| anyhow!("Profile process thread panicked."))?;
+ trace_provider
+ .lock()
+ .unwrap()
+ .process(&TRACE_OUTPUT_DIR, &PROFILE_OUTPUT_DIR, BINARY_FILTER)
+ .context("Failed to process profiles.")?;
Ok(())
}