summaryrefslogtreecommitdiff
path: root/profcollectd
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2023-05-02 15:12:32 -0700
committerYabin Cui <yabinc@google.com>2023-05-02 15:15:10 -0700
commitfc1f178a6710eeff1f752a66eb3b8b435418b3e0 (patch)
tree1beb44e26d627deac27c37487523c0b87d087a55 /profcollectd
parent7e61c625f1a1d906030602c82c1bdaab2370c7af (diff)
downloadextras-fc1f178a6710eeff1f752a66eb3b8b435418b3e0.tar.gz
profcollectd: Use --decode-etm when recording
Also use --binary to filter binaries, use --exclude-perf to exclude ETM data for profcollectd. Bug: 279094308 Test: run profcollectd manually Change-Id: I6d74ebab932ae576599f7435bab9824b7d3c1d57
Diffstat (limited to 'profcollectd')
-rw-r--r--profcollectd/libprofcollectd/logging_trace_provider.rs2
-rw-r--r--profcollectd/libprofcollectd/scheduler.rs8
-rw-r--r--profcollectd/libprofcollectd/simpleperf_etm_trace_provider.rs3
-rw-r--r--profcollectd/libprofcollectd/trace_provider.rs2
4 files changed, 11 insertions, 4 deletions
diff --git a/profcollectd/libprofcollectd/logging_trace_provider.rs b/profcollectd/libprofcollectd/logging_trace_provider.rs
index 0b9e36fc..d9fd35e9 100644
--- a/profcollectd/libprofcollectd/logging_trace_provider.rs
+++ b/profcollectd/libprofcollectd/logging_trace_provider.rs
@@ -36,7 +36,7 @@ impl TraceProvider for LoggingTraceProvider {
true
}
- fn trace(&self, trace_dir: &Path, tag: &str, sampling_period: &Duration) {
+ fn trace(&self, trace_dir: &Path, tag: &str, sampling_period: &Duration, binary_filter: &str) {
let trace_file = trace_provider::get_path(trace_dir, tag, LOGGING_TRACEFILE_EXTENSION);
log::info!(
diff --git a/profcollectd/libprofcollectd/scheduler.rs b/profcollectd/libprofcollectd/scheduler.rs
index c4d68805..5558f581 100644
--- a/profcollectd/libprofcollectd/scheduler.rs
+++ b/profcollectd/libprofcollectd/scheduler.rs
@@ -74,6 +74,7 @@ impl Scheduler {
&TRACE_OUTPUT_DIR,
"periodic",
&config.sampling_period,
+ &config.binary_filter,
);
}
}
@@ -96,7 +97,12 @@ impl Scheduler {
pub fn one_shot(&self, config: &Config, tag: &str) -> Result<()> {
let trace_provider = self.trace_provider.clone();
if check_space_limit(&TRACE_OUTPUT_DIR, config)? {
- trace_provider.lock().unwrap().trace(&TRACE_OUTPUT_DIR, tag, &config.sampling_period);
+ trace_provider.lock().unwrap().trace(
+ &TRACE_OUTPUT_DIR,
+ tag,
+ &config.sampling_period,
+ &config.binary_filter,
+ );
}
Ok(())
}
diff --git a/profcollectd/libprofcollectd/simpleperf_etm_trace_provider.rs b/profcollectd/libprofcollectd/simpleperf_etm_trace_provider.rs
index 6b326b4a..cb61802e 100644
--- a/profcollectd/libprofcollectd/simpleperf_etm_trace_provider.rs
+++ b/profcollectd/libprofcollectd/simpleperf_etm_trace_provider.rs
@@ -38,12 +38,13 @@ impl TraceProvider for SimpleperfEtmTraceProvider {
simpleperf_profcollect::has_device_support()
}
- fn trace(&self, trace_dir: &Path, tag: &str, sampling_period: &Duration) {
+ fn trace(&self, trace_dir: &Path, tag: &str, sampling_period: &Duration, binary_filter: &str) {
let trace_file = trace_provider::get_path(trace_dir, tag, ETM_TRACEFILE_EXTENSION);
simpleperf_profcollect::record(
&trace_file,
sampling_period,
+ binary_filter,
simpleperf_profcollect::RecordScope::BOTH,
);
}
diff --git a/profcollectd/libprofcollectd/trace_provider.rs b/profcollectd/libprofcollectd/trace_provider.rs
index 704eb9cb..133fa5cb 100644
--- a/profcollectd/libprofcollectd/trace_provider.rs
+++ b/profcollectd/libprofcollectd/trace_provider.rs
@@ -30,7 +30,7 @@ use crate::logging_trace_provider::LoggingTraceProvider;
pub trait TraceProvider {
fn get_name(&self) -> &'static str;
fn is_ready(&self) -> bool;
- fn trace(&self, trace_dir: &Path, tag: &str, sampling_period: &Duration);
+ fn trace(&self, trace_dir: &Path, tag: &str, sampling_period: &Duration, binary_filter: &str);
fn process(&self, trace_dir: &Path, profile_dir: &Path, binary_filter: &str) -> Result<()>;
fn set_log_file(&self, filename: &Path);
fn reset_log_file(&self);