manager: Expose new CaptureDebugTraceOutput method

This commit is contained in:
Vicki Pfau 2025-01-14 20:53:12 -08:00
parent a2af4d1bc5
commit 7b7afffc46
8 changed files with 126 additions and 11 deletions

View file

@ -29,8 +29,8 @@ use crate::power::{
};
use crate::process::{run_script, script_output};
use crate::wifi::{
set_wifi_backend, set_wifi_debug_mode, set_wifi_power_management_state, WifiBackend,
WifiDebugMode, WifiPowerManagement,
extract_wifi_trace, set_wifi_backend, set_wifi_debug_mode, set_wifi_power_management_state,
WifiBackend, WifiDebugMode, WifiPowerManagement,
};
use crate::{path, API_VERSION};
@ -369,6 +369,16 @@ impl SteamOSManager {
.map_err(to_zbus_fdo_error)
}
async fn capture_debug_trace_output(&self) -> fdo::Result<String> {
Ok(extract_wifi_trace()
.await
.inspect_err(|message| error!("Error capturing trace output: {message}"))
.map_err(to_zbus_fdo_error)?
.into_os_string()
.to_string_lossy()
.into())
}
#[zbus(property)]
async fn inhibit_ds(&self) -> fdo::Result<bool> {
let (tx, rx) = oneshot::channel();