Commit 6241a057 authored by Pavel Emelyanov's avatar Pavel Emelyanov

show: Beautify -D mode show

Print delimiters and image names for easier reading of the output.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent a0ce7967
...@@ -458,6 +458,9 @@ static int cr_show_all(struct cr_options *opts) ...@@ -458,6 +458,9 @@ static int cr_show_all(struct cr_options *opts)
if (!cr_fdset) if (!cr_fdset)
goto out; goto out;
pr_msg("Task %d:\n", item->pid.virt);
pr_msg("----------------------------------------\n");
show_core(fdset_fd(cr_fdset, CR_FD_CORE), opts); show_core(fdset_fd(cr_fdset, CR_FD_CORE), opts);
if (item->nr_threads > 1) { if (item->nr_threads > 1) {
...@@ -472,21 +475,24 @@ static int cr_show_all(struct cr_options *opts) ...@@ -472,21 +475,24 @@ static int cr_show_all(struct cr_options *opts)
if (fd_th < 0) if (fd_th < 0)
goto out; goto out;
pr_msg("\n"); pr_msg("Thread %d.%d:\n", item->pid.virt, item->threads[i].virt);
pr_msg("Thread: %d\n", item->threads[i].virt);
pr_msg("----------------------------------------\n"); pr_msg("----------------------------------------\n");
show_core(fd_th, opts); show_core(fd_th, opts);
close_safe(&fd_th); close_safe(&fd_th);
pr_msg("----------------------------------------\n");
} }
} }
pr_msg("Resources for %d:\n", item->pid.virt);
pr_msg("----------------------------------------\n");
for (i = _CR_FD_TASK_FROM + 1; i < _CR_FD_TASK_TO; i++) for (i = _CR_FD_TASK_FROM + 1; i < _CR_FD_TASK_TO; i++)
if (i != CR_FD_CORE && fdset_template[i].show) if (i != CR_FD_CORE && fdset_template[i].show) {
pr_msg("* ");
pr_msg(fdset_template[i].fmt, item->pid.virt);
pr_msg(":\n");
fdset_template[i].show(fdset_fd(cr_fdset, i), opts); fdset_template[i].show(fdset_fd(cr_fdset, i), opts);
}
pr_msg("---[ end of task %d ]---\n", item->pid.virt);
close_cr_fdset(&cr_fdset); close_cr_fdset(&cr_fdset);
} }
......
...@@ -288,6 +288,8 @@ int try_show_namespaces(int ns_pid, struct cr_options *o) ...@@ -288,6 +288,8 @@ int try_show_namespaces(int ns_pid, struct cr_options *o)
struct cr_fdset *fdset; struct cr_fdset *fdset;
int i; int i;
pr_msg("Namespaces for %d:\n", ns_pid);
pr_msg("----------------------------------------\n");
fdset = cr_ns_fdset_open(ns_pid, O_SHOW); fdset = cr_ns_fdset_open(ns_pid, O_SHOW);
if (!fdset) if (!fdset)
return -1; return -1;
...@@ -304,7 +306,7 @@ int try_show_namespaces(int ns_pid, struct cr_options *o) ...@@ -304,7 +306,7 @@ int try_show_namespaces(int ns_pid, struct cr_options *o)
fdset_template[i].show(fdset_fd(fdset, i), o); fdset_template[i].show(fdset_fd(fdset, i), o);
} }
pr_msg("---[ end of %d namespaces ]---\n", ns_pid);
close_cr_fdset(&fdset); close_cr_fdset(&fdset);
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment