mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-20 09:03:28 +00:00
kernel: debug: add command to print processes
This changes the `p` command to only print processes, and renames the existing behavior to `P` which prints processes and threads. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
9ced90190e
commit
2a1aa24040
1 changed files with 23 additions and 1 deletions
|
|
@ -374,6 +374,27 @@ pub fn irq(_irq_number: usize, _arg: *mut usize) {
|
||||||
}
|
}
|
||||||
b'p' => {
|
b'p' => {
|
||||||
println!("Printing processes");
|
println!("Printing processes");
|
||||||
|
crate::services::SystemServices::with(|system_services| {
|
||||||
|
let current_pid = system_services.current_pid();
|
||||||
|
for process in &system_services.processes {
|
||||||
|
if !process.free() {
|
||||||
|
println!(
|
||||||
|
"{:?} {}:",
|
||||||
|
process,
|
||||||
|
system_services.process_name(process.pid).unwrap_or("")
|
||||||
|
);
|
||||||
|
process.activate().unwrap();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
system_services
|
||||||
|
.get_process(current_pid)
|
||||||
|
.unwrap()
|
||||||
|
.activate()
|
||||||
|
.unwrap();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
b'P' => {
|
||||||
|
println!("Printing processes and threads");
|
||||||
crate::services::SystemServices::with(|system_services| {
|
crate::services::SystemServices::with(|system_services| {
|
||||||
let current_pid = system_services.current_pid();
|
let current_pid = system_services.current_pid();
|
||||||
for process in &system_services.processes {
|
for process in &system_services.processes {
|
||||||
|
|
@ -461,7 +482,8 @@ pub fn irq(_irq_number: usize, _arg: *mut usize) {
|
||||||
#[cfg(feature = "gdbserver")]
|
#[cfg(feature = "gdbserver")]
|
||||||
println!(" g | enter the gdb server");
|
println!(" g | enter the gdb server");
|
||||||
println!(" m | print MMU page tables of all processes");
|
println!(" m | print MMU page tables of all processes");
|
||||||
println!(" p | print all processes and threads");
|
println!(" p | print all processes");
|
||||||
|
println!(" P | print all processes and threads");
|
||||||
println!(" r | report RAM usage of all processes");
|
println!(" r | report RAM usage of all processes");
|
||||||
println!(" s | Suspend PID 3");
|
println!(" s | Suspend PID 3");
|
||||||
println!(" c | Continue PID 3");
|
println!(" c | Continue PID 3");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue