diff --git a/source/ucli/ucli-lib.cc b/source/ucli/ucli-lib.cc index e922d62..34427b0 100644 --- a/source/ucli/ucli-lib.cc +++ b/source/ucli/ucli-lib.cc @@ -156,7 +156,7 @@ void diag_printf_raw_stack(int pid, int ns_pid, const char *comm, entry_cb_arg_t unwind_arg; static u64 regs_buf[3]; - printf(" USER STACK SP:%lx, BP:%lx, IP:%lx\n", raw_stack->sp, + printf(" USER STACK: SP:%lx, BP:%lx, IP:%lx\n", raw_stack->sp, raw_stack->bp, raw_stack->ip); stack_sample.user_stack.offset = 0; stack_sample.user_stack.size = raw_stack->stack_size; @@ -252,10 +252,10 @@ std::string state_str(int __state){ } void printk_task_brief(task_detail *detail) { - printf(" TASK INFO: [%s / %s], PID: %d / %d\n", detail->cgroup_buf, detail->comm, detail->tgid, + printf(" TASK INFO: %s [%s / %s], PID: %d / %d\n", sys_task_str(detail->sys_task) ,detail->cgroup_buf, detail->comm, detail->tgid, detail->pid); - printf(" TASK STATE: type: %s, state: %s, state %d\n", sys_task_str(detail->sys_task), state_str(detail->state).c_str(), - detail->state); + // printf(" TASK STATE: type: %s, state: %s, state %d\n", sys_task_str(detail->sys_task), state_str(detail->state).c_str(), + // detail->state); } void diag_printf_kern_stack(kern_stack_detail *kern_stack) { diff --git a/source/ucli/ucli.cc b/source/ucli/ucli.cc index 1de5076..e33ad1c 100644 --- a/source/ucli/ucli.cc +++ b/source/ucli/ucli.cc @@ -115,9 +115,9 @@ static int task_info_extract(void *buf, unsigned int len, void *) { tsk_info = (variable_monitor_task *)buf; seq++; - printf("##CGROUP:[%s] %d [%03d] [%s]\n", + printf("##CGROUP:[%s] %d [%03d] [%s] state: %d\n", tsk_info->task.cgroup_buf, tsk_info->task.pid, seq, - tsk_info->task.state == 0 ? "R" : "D"); + state_str(tsk_info->task.state).c_str(),tsk_info->task.state); printk_task_brief(&tsk_info->task); // diag_printf_raw_stack(tsk_info->task.tgid, tsk_info->task.container_tgid, diff --git a/source/ucli/ucli.h b/source/ucli/ucli.h index d2d0bdb..8730b07 100644 --- a/source/ucli/ucli.h +++ b/source/ucli/ucli.h @@ -5,6 +5,8 @@ #include #include // size_t +#include +#include // ioctl #define IOCTL_WATCH_VARIABLE 0 @@ -135,4 +137,6 @@ void diag_printf_raw_stack(int pid, int ns_pid, const char *comm, void diag_printf_kern_stack(kern_stack_detail *kern_stack); void diag_printf_proc_chains(proc_chains_detail *proc_chains); +std::string state_str(int __state); + #endif /* UAPI_H */ \ No newline at end of file