Revert "modem: Add kernel metrics log to bugreport"

This reverts commit 92ce682a8e.

Reason for revert: <Reason for revert: Dorid monitor: Likely culprit for b/388963512  - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.>

Change-Id: I5db1d095aa0960c7445f390b68d7dbe293ecc4b3
This commit is contained in:
Naresh Kumar Podishetty (xWF) 2025-01-09 22:12:35 -08:00 committed by Android (Google) Code Review
parent 92ce682a8e
commit 677274ccf1
4 changed files with 2 additions and 46 deletions

View file

@ -5,7 +5,6 @@ package {
rust_binary { rust_binary {
name: "dump_modem", name: "dump_modem",
srcs: ["dump_modem.rs"], srcs: ["dump_modem.rs"],
rustlibs: ["librustutils"],
vendor: true, vendor: true,
relative_install_path: "dump", relative_install_path: "dump",
} }

View file

@ -3,7 +3,6 @@
//! The dump_modem binary is used to capture kernel/userspace logs in bugreport //! The dump_modem binary is used to capture kernel/userspace logs in bugreport
use std::fs; use std::fs;
use std::str::FromStr;
const MODEM_STAT: &str = "/data/vendor/modem_stat/debug.txt"; const MODEM_STAT: &str = "/data/vendor/modem_stat/debug.txt";
const SSRDUMP_DIR: &str = "/data/vendor/ssrdump"; const SSRDUMP_DIR: &str = "/data/vendor/ssrdump";
@ -11,7 +10,6 @@ const RFSD_ERR_LOG_DIR: &str = "/data/vendor/log/rfsd";
const WAKEUP_EVENTS: &str = "/sys/devices/platform/cpif/wakeup_events"; const WAKEUP_EVENTS: &str = "/sys/devices/platform/cpif/wakeup_events";
const CPIF_LOGBUFFER: &str = "/dev/logbuffer_cpif"; const CPIF_LOGBUFFER: &str = "/dev/logbuffer_cpif";
const PCIE_EVENT_STATS: &str = "/sys/devices/platform/cpif/modem/pcie_event_stats"; const PCIE_EVENT_STATS: &str = "/sys/devices/platform/cpif/modem/pcie_event_stats";
const KERNEL_METRICS_DIR: &str = "/sys/kernel/pixel_metrics/modem";
fn handle_io_error(file: &str, err: std::io::Error) { fn handle_io_error(file: &str, err: std::io::Error) {
match err.kind() { match err.kind() {
@ -59,13 +57,6 @@ fn print_matching_files_in_dir(dir: &str, filename: &str) {
} }
} }
fn get_property(key: &str, default_value: i32) -> i32 {
let value = rustutils::system_properties::read(key)
.unwrap_or(None)
.unwrap_or(default_value.to_string());
i32::from_str(&value).unwrap_or(default_value)
}
// Capture modem stat log if it exists // Capture modem stat log if it exists
fn modem_stat() { fn modem_stat() {
println!("------ Modem Stat ------"); println!("------ Modem Stat ------");
@ -108,27 +99,6 @@ fn pcie_event_stats() {
println!(); println!();
} }
// Capture kernel metrics stats if the sysfs attribute exists
fn print_kernel_metrics() {
println!("------ Kernel Metrics ------");
let file_list = vec![
"modem_boot_duration",
"modem_wakeup_ap",
"pcie_link_state",
"pcie_link_duration",
"pcie_link_stats",
"pcie_link_updown",
];
for file in file_list {
println!("------ {} ------", file);
let file_path = format!("{}/{}", KERNEL_METRICS_DIR, file);
print_file_and_handle_error(&file_path);
println!();
}
}
fn main() { fn main() {
modem_stat(); modem_stat();
modem_ssr_history(); modem_ssr_history();
@ -136,9 +106,4 @@ fn main() {
wakeup_events(); wakeup_events();
cpif_logbuffer(); cpif_logbuffer();
pcie_event_stats(); pcie_event_stats();
let prop_value = get_property("persist.vendor.modem.qms.kernel_metrics_collection", 0);
if prop_value == 1 {
print_kernel_metrics();
}
} }

View file

@ -1,4 +1,3 @@
# Sepolicy for dump_modem
pixel_bugreport(dump_modem) pixel_bugreport(dump_modem)
allow dump_modem modem_stat_data_file:dir search; allow dump_modem modem_stat_data_file:dir search;
@ -11,4 +10,3 @@ allow dump_modem vendor_rfsd_log_file:file r_file_perms;
allow dump_modem vendor_toolbox_exec:file execute_no_trans; allow dump_modem vendor_toolbox_exec:file execute_no_trans;
allow dump_modem sysfs_dump_modem:file r_file_perms; allow dump_modem sysfs_dump_modem:file r_file_perms;
allow dump_modem logbuffer_device:chr_file r_file_perms; allow dump_modem logbuffer_device:chr_file r_file_perms;
get_prop(dump_modem, vendor_modem_prop)

View file

@ -1,8 +1,2 @@
genfscon sysfs /devices/platform/cpif/wakeup_events u:object_r:sysfs_dump_modem:s0 genfscon sysfs /devices/platform/cpif/wakeup_events u:object_r:sysfs_dump_modem:s0
genfscon sysfs /devices/platform/cpif/modem/pcie_event_stats u:object_r:sysfs_dump_modem:s0 genfscon sysfs /devices/platform/cpif/modem/pcie_event_stats u:object_r:sysfs_dump_modem:s0
genfscon sysfs /kernel/pixel_metrics/modem/modem_boot_duration u:object_r:sysfs_dump_modem:s0
genfscon sysfs /kernel/pixel_metrics/modem/modem_wakeup_ap u:object_r:sysfs_dump_modem:s0
genfscon sysfs /kernel/pixel_metrics/modem/pcie_link_state u:object_r:sysfs_dump_modem:s0
genfscon sysfs /kernel/pixel_metrics/modem/pcie_link_duration u:object_r:sysfs_dump_modem:s0
genfscon sysfs /kernel/pixel_metrics/modem/pcie_link_stats u:object_r:sysfs_dump_modem:s0
genfscon sysfs /kernel/pixel_metrics/modem/pcie_link_updown u:object_r:sysfs_dump_modem:s0