From 4013ed0098d0d856dd24b921ab985a03c6fca4cf Mon Sep 17 00:00:00 2001 From: bunnie Date: Sun, 29 Jan 2023 04:17:42 +0800 Subject: [PATCH] add api call to increase PDDB debug level at runtime --- services/pddb/src/api.rs | 1 + services/pddb/src/lib.rs | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/services/pddb/src/api.rs b/services/pddb/src/api.rs index faa05ae61..5b9aaa9b8 100644 --- a/services/pddb/src/api.rs +++ b/services/pddb/src/api.rs @@ -558,6 +558,7 @@ pub enum DebugRequest { Dump = 0, Remount = 1, Prune = 2, + SetDebug = 3, } #[cfg(test)] diff --git a/services/pddb/src/lib.rs b/services/pddb/src/lib.rs index c403f558e..46c618ea1 100644 --- a/services/pddb/src/lib.rs +++ b/services/pddb/src/lib.rs @@ -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; 32]) {