mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
kernel: print connection count on per-process output
Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
5e369555d2
commit
6d294c97c5
1 changed files with 13 additions and 2 deletions
|
|
@ -9,6 +9,8 @@ use utralib::generated::*;
|
|||
#[cfg(baremetal)]
|
||||
pub static mut DEBUG_OUTPUT: Option<&'static mut dyn Write> = None;
|
||||
|
||||
pub use crate::arch::process::Process as ArchProcess;
|
||||
|
||||
#[macro_use]
|
||||
#[cfg(all(
|
||||
not(test),
|
||||
|
|
@ -211,12 +213,21 @@ fn process_irq_character(b: u8) {
|
|||
let current_pid = system_services.current_pid();
|
||||
for process in &system_services.processes {
|
||||
if !process.free() {
|
||||
process.activate().unwrap();
|
||||
let mut connection_count = 0;
|
||||
ArchProcess::with_inner(|process_inner| {
|
||||
for conn in &process_inner.connection_map {
|
||||
if conn.is_some() {
|
||||
connection_count += 1;
|
||||
}
|
||||
}
|
||||
});
|
||||
println!(
|
||||
"{:?} {}:",
|
||||
"{:?} conns:{}/32 {}",
|
||||
process,
|
||||
connection_count,
|
||||
system_services.process_name(process.pid).unwrap_or("")
|
||||
);
|
||||
process.activate().unwrap();
|
||||
}
|
||||
}
|
||||
system_services
|
||||
|
|
|
|||
Loading…
Reference in a new issue