Cleanup zombies in container - show scheme namespace in context list

This commit is contained in:
Jeremy Soller 2016-11-17 12:24:46 -07:00
parent bf292bc0d1
commit c5e0d77085
2 changed files with 16 additions and 4 deletions

View file

@ -5,7 +5,7 @@ use context;
use syscall::error::Result;
pub fn resource() -> Result<Vec<u8>> {
let mut string = format!("{:<6}{:<6}{:<6}{:<6}{:<6}{:<6}{:<8}{}\n",
let mut string = format!("{:<6}{:<6}{:<6}{:<6}{:<6}{:<6}{:<8}{:<6}{}\n",
"PID",
"PPID",
"UID",
@ -13,6 +13,7 @@ pub fn resource() -> Result<Vec<u8>> {
"STAT",
"CPU",
"MEM",
"SNS",
"NAME");
{
let contexts = context::contexts();
@ -82,7 +83,7 @@ pub fn resource() -> Result<Vec<u8>> {
let name_bytes = context.name.lock();
let name = str::from_utf8(&name_bytes).unwrap_or("");
string.push_str(&format!("{:<6}{:<6}{:<6}{:<6}{:<6}{:<6}{:<8}{}\n",
string.push_str(&format!("{:<6}{:<6}{:<6}{:<6}{:<6}{:<6}{:<8}{:<6}{}\n",
context.id.into(),
context.ppid.into(),
context.euid,
@ -90,6 +91,7 @@ pub fn resource() -> Result<Vec<u8>> {
stat_string,
cpu_string,
memory_string,
context.scheme_ns.into(),
name));
}
}