summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYi Kong <yikong@google.com>2021-05-24 00:43:46 +0800
committerYi Kong <yikong@google.com>2021-05-25 08:23:34 +0800
commitc4d103c8757dcf7b9024855795854d9eb9c73650 (patch)
tree13b4f5353549a8b15061faa21aa03e181d9c37f1
parent48f22bd7299e962354631319072f9fca9a5c51da (diff)
downloadextras-c4d103c8757dcf7b9024855795854d9eb9c73650.tar.gz
profcollectd: Compress profile reports
Test: build Bug: 187671217 Change-Id: Ie73f0c545d3e150fd43649e8bc9d4de167b9a0a5 Merged-In: Ie73f0c545d3e150fd43649e8bc9d4de167b9a0a5 (cherry picked from commit 048ed1d16b067fb5e42718e292aa548fac61c034)
-rw-r--r--profcollectd/libprofcollectd/report.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/profcollectd/libprofcollectd/report.rs b/profcollectd/libprofcollectd/report.rs
index 2c524729..f3b8fe12 100644
--- a/profcollectd/libprofcollectd/report.rs
+++ b/profcollectd/libprofcollectd/report.rs
@@ -27,6 +27,7 @@ use std::time::SystemTime;
use uuid::v1::{Context, Timestamp};
use uuid::Uuid;
use zip::write::FileOptions;
+use zip::CompressionMethod::Deflated;
use zip::ZipWriter;
use crate::config::Config;
@@ -47,7 +48,7 @@ pub fn pack_report(profile: &Path, report: &Path, config: &Config) -> Result<Str
// Set report file ACL bits to 644, so that this can be shared to uploaders.
// Who has permission to actually read the file is protected by SELinux policy.
let report = fs::OpenOptions::new().create_new(true).write(true).mode(0o644).open(&report)?;
- let options = FileOptions::default();
+ let options = FileOptions::default().compression_method(Deflated);
let mut zip = ZipWriter::new(report);
fs::read_dir(profile)?