summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--profcollectd/binder/com/android/server/profcollect/IProfCollectd.aidl2
-rw-r--r--profcollectd/libprofcollectd/lib.rs2
-rw-r--r--profcollectd/libprofcollectd/scheduler.rs7
-rw-r--r--profcollectd/libprofcollectd/service.rs6
4 files changed, 8 insertions, 9 deletions
diff --git a/profcollectd/binder/com/android/server/profcollect/IProfCollectd.aidl b/profcollectd/binder/com/android/server/profcollect/IProfCollectd.aidl
index 58503abc..5dcf1119 100644
--- a/profcollectd/binder/com/android/server/profcollect/IProfCollectd.aidl
+++ b/profcollectd/binder/com/android/server/profcollect/IProfCollectd.aidl
@@ -21,7 +21,7 @@ interface IProfCollectd {
void schedule();
void terminate();
void trace_once(@utf8InCpp String tag);
- void process(boolean blocking);
+ void process();
@utf8InCpp String report();
void copy_report_to_bb(int bb_profile_id, @utf8InCpp String report);
void delete_report(@utf8InCpp String report);
diff --git a/profcollectd/libprofcollectd/lib.rs b/profcollectd/libprofcollectd/lib.rs
index d5eec68c..d8a8cc8d 100644
--- a/profcollectd/libprofcollectd/lib.rs
+++ b/profcollectd/libprofcollectd/lib.rs
@@ -82,7 +82,7 @@ pub fn trace_once(tag: &str) -> Result<()> {
/// Process traces.
pub fn process() -> Result<()> {
- get_profcollectd_service()?.process(true)?;
+ get_profcollectd_service()?.process()?;
Ok(())
}
diff --git a/profcollectd/libprofcollectd/scheduler.rs b/profcollectd/libprofcollectd/scheduler.rs
index cfd0381f..883a616d 100644
--- a/profcollectd/libprofcollectd/scheduler.rs
+++ b/profcollectd/libprofcollectd/scheduler.rs
@@ -87,7 +87,7 @@ impl Scheduler {
Ok(())
}
- pub fn process(&self, blocking: bool) -> Result<()> {
+ pub fn process(&self) -> Result<()> {
let trace_provider = self.trace_provider.clone();
let handle = thread::spawn(move || {
trace_provider
@@ -96,9 +96,8 @@ impl Scheduler {
.process(&TRACE_OUTPUT_DIR, &PROFILE_OUTPUT_DIR)
.expect("Failed to process profiles.");
});
- if blocking {
- handle.join().map_err(|_| anyhow!("Profile process thread panicked."))?;
- }
+
+ handle.join().map_err(|_| anyhow!("Profile process thread panicked."))?;
Ok(())
}
diff --git a/profcollectd/libprofcollectd/service.rs b/profcollectd/libprofcollectd/service.rs
index 021271f3..8f998947 100644
--- a/profcollectd/libprofcollectd/service.rs
+++ b/profcollectd/libprofcollectd/service.rs
@@ -73,15 +73,15 @@ impl IProfCollectd for ProfcollectdBinderService {
.context("Failed to initiate an one-off trace.")
.map_err(err_to_binder_status)
}
- fn process(&self, blocking: bool) -> BinderResult<()> {
+ fn process(&self) -> BinderResult<()> {
let lock = &mut *self.lock();
lock.scheduler
- .process(blocking)
+ .process()
.context("Failed to process profiles.")
.map_err(err_to_binder_status)
}
fn report(&self) -> BinderResult<String> {
- self.process(true)?;
+ self.process()?;
let lock = &mut *self.lock();
pack_report(&PROFILE_OUTPUT_DIR, &REPORT_OUTPUT_DIR, &lock.config)