summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com>2024-06-04 17:22:30 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2024-06-04 17:22:30 +0000
commit231016e5470e958da33434d9384d17c9904e9bbe (patch)
tree3d46c4a94667fe2669f93a6ac86fe9f3a8ffd958
parentff41aa2d299f5db9489688bb7bd093d2a8f8e3aa (diff)
parent6b61ad064b62b290f604bdaca6a9aabdddbb8f8a (diff)
downloadextras-231016e5470e958da33434d9384d17c9904e9bbe.tar.gz
Merge "Increase maximum trace files storage limit" into main am: 6b61ad064b
Original change: https://android-review.googlesource.com/c/platform/system/extras/+/3112560 Change-Id: Ia9e402771a11b6c6b8c44152db1996e041ab8c6c Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--profcollectd/libprofcollectd/config.rs7
-rw-r--r--profcollectd/libprofcollectd/scheduler.rs2
2 files changed, 3 insertions, 6 deletions
diff --git a/profcollectd/libprofcollectd/config.rs b/profcollectd/libprofcollectd/config.rs
index 8c8d06b9..7dbd708c 100644
--- a/profcollectd/libprofcollectd/config.rs
+++ b/profcollectd/libprofcollectd/config.rs
@@ -61,7 +61,7 @@ pub struct Config {
/// An optional filter to limit which binaries to or not to profile.
pub binary_filter: String,
/// Maximum size of the trace directory.
- pub max_trace_limit: u64,
+ pub max_trace_limit_mb: u64,
/// The kernel release version
pub kernel_release: String,
}
@@ -77,10 +77,7 @@ impl Config {
600,
)?),
binary_filter: get_device_config("binary_filter", DEFAULT_BINARY_FILTER.to_string())?,
- max_trace_limit: get_device_config(
- "max_trace_limit",
- /* 512MB */ 512 * 1024 * 1024,
- )?,
+ max_trace_limit_mb: get_device_config("max_trace_limit_mb", 768)?,
kernel_release: get_kernel_release(),
})
}
diff --git a/profcollectd/libprofcollectd/scheduler.rs b/profcollectd/libprofcollectd/scheduler.rs
index 8695f57c..9e4914fb 100644
--- a/profcollectd/libprofcollectd/scheduler.rs
+++ b/profcollectd/libprofcollectd/scheduler.rs
@@ -189,7 +189,7 @@ fn check_space_limit(path: &Path, config: &Config) -> Result<bool> {
})
};
- if dir_size(path)? > config.max_trace_limit {
+ if dir_size(path)? > config.max_trace_limit_mb * 1024 * 1024 {
log::error!("trace storage exhausted.");
return Ok(false);
}