add api call to increase PDDB debug level at runtime

This commit is contained in:
bunnie 2023-01-29 04:17:42 +08:00 committed by Sean Cross
parent bfca804586
commit 4013ed0098
2 changed files with 13 additions and 0 deletions

View file

@ -558,6 +558,7 @@ pub enum DebugRequest {
Dump = 0,
Remount = 1,
Prune = 2,
SetDebug = 3,
}
#[cfg(test)]

View file

@ -1130,6 +1130,18 @@ impl Pddb {
buf.lend(self.conn, Opcode::DangerousDebug.to_u32().unwrap())
.or(Err(Error::new(ErrorKind::Other, "Xous internal error"))).map(|_| ())
}
/// Turns on debug spew
#[cfg(not(target_os = "xous"))]
pub fn dbg_set_debug(&self) -> Result<()> {
let ipc = PddbDangerousDebug {
request: DebugRequest::SetDebug,
dump_name: xous_ipc::String::new(),
};
let buf = Buffer::into_buf(ipc)
.or(Err(Error::new(ErrorKind::Other, "Xous internal error")))?;
buf.lend(self.conn, Opcode::DangerousDebug.to_u32().unwrap())
.or(Err(Error::new(ErrorKind::Other, "Xous internal error"))).map(|_| ())
}
#[cfg(all(feature="pddbtest", feature="autobasis"))]
pub fn basis_testing(&self, config: &[Option<bool>; 32]) {