Revert "NSHL: Format strings for nsh_output should all have IOBJ qualifier"
This reverts commit 186a101d2c62d604376a1ff2822734a631e12618.
This commit is contained in:
parent
fd083ee981
commit
a5fbb4cd24
@ -103,10 +103,6 @@ struct nsh_taskstatus_s
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Data
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/* Status strings */
|
/* Status strings */
|
||||||
|
|
||||||
#if 0 /* Not used */
|
#if 0 /* Not used */
|
||||||
@ -128,25 +124,6 @@ static const char g_scheduler[] = "Scheduler:";
|
|||||||
static const char g_sigmask[] = "SigMask:";
|
static const char g_sigmask[] = "SigMask:";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Format strings */
|
|
||||||
|
|
||||||
#ifndef CONFIG_NSH_DISABLE_PS
|
|
||||||
static const IOBJ char g_fmtid[] = "%5s ";
|
|
||||||
static const IOBJ char g_fmtname[] = "%5s ";
|
|
||||||
#ifndef CONFIG_DISABLE_SIGNALS
|
|
||||||
static const IOBJ char g_fmtsigmask[] = "%-8s ";
|
|
||||||
#endif
|
|
||||||
#ifdef NSH_HAVE_CPULOAD
|
|
||||||
static const IOBJ char g_fmtload[] = "%6s ";
|
|
||||||
#endif
|
|
||||||
static const IOBJ char g_fmtcmdline[] = "%s\n";
|
|
||||||
static const IOBJ char g_fmtcommon[] = "%3s %-8s %-7s %3s %-8s %-9s ";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef CONFIG_NSH_DISABLE_EXEC
|
|
||||||
static const IOBJ char g_fmtexec[] = "Calling %p\n";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -360,28 +337,28 @@ static int ps_callback(FAR struct nsh_vtbl_s *vtbl, FAR const char *dirpath,
|
|||||||
|
|
||||||
/* Finally, print the status information */
|
/* Finally, print the status information */
|
||||||
|
|
||||||
nsh_output(vtbl, g_fmtname, entryp->d_name);
|
nsh_output(vtbl, "%5s ", entryp->d_name);
|
||||||
|
|
||||||
#ifdef CONFIG_SCHED_HAVE_PARENT
|
#ifdef CONFIG_SCHED_HAVE_PARENT
|
||||||
#ifdef HAVE_GROUPID
|
#ifdef HAVE_GROUPID
|
||||||
nsh_output(vtbl, g_fmtid, status.td_groupid);
|
nsh_output(vtbl, "%5s ", status.td_groupid);
|
||||||
#else
|
#else
|
||||||
nsh_output(vtbl, g_fmtid, status.td_ppid);
|
nsh_output(vtbl, "%5s ", status.td_ppid);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
nsh_output(vtbl, g_fmtcommon,
|
nsh_output(vtbl, "%3s %-8s %-7s %3s %-8s %-9s ",
|
||||||
status.td_priority, status.td_policy, status.td_type,
|
status.td_priority, status.td_policy, status.td_type,
|
||||||
status.td_flags, status.td_state, status.td_event);
|
status.td_flags, status.td_state, status.td_event);
|
||||||
|
|
||||||
#ifndef CONFIG_DISABLE_SIGNALS
|
#ifndef CONFIG_DISABLE_SIGNALS
|
||||||
nsh_output(vtbl, g_fmtsigmask, status.td_sigmask);
|
nsh_output(vtbl, "%-8s ", status.td_sigmask);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef NSH_HAVE_CPULOAD
|
#ifdef NSH_HAVE_CPULOAD
|
||||||
/* Get the CPU load */
|
/* Get the CPU load */
|
||||||
|
|
||||||
filepath = NULL;
|
filepath = NULL;
|
||||||
ret = asprintf(&filepath, "%s/%s/loadavg", dirpath, entryp->d_name);
|
ret = asprintf(&filepath, "%s/%s/loadavg", dirpath, entryp->d_name);
|
||||||
if (ret < 0 || filepath == NULL)
|
if (ret < 0 || filepath == NULL)
|
||||||
{
|
{
|
||||||
@ -399,7 +376,7 @@ static int ps_callback(FAR struct nsh_vtbl_s *vtbl, FAR const char *dirpath,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nsh_output(vtbl, g_fmtload, nsh_trimspaces(vtbl->iobuffer));
|
nsh_output(vtbl, "%6s ", nsh_trimspaces(vtbl->iobuffer));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Read the task/tread command line */
|
/* Read the task/tread command line */
|
||||||
@ -421,7 +398,7 @@ static int ps_callback(FAR struct nsh_vtbl_s *vtbl, FAR const char *dirpath,
|
|||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsh_output(vtbl, g_fmtcmdline, nsh_trimspaces(vtbl->iobuffer));
|
nsh_output(vtbl, "%s\n", nsh_trimspaces(vtbl->iobuffer));
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -447,7 +424,7 @@ int cmd_exec(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
|
|||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsh_output(vtbl, g_fmtexec, (exec_t)addr);
|
nsh_output(vtbl, "Calling %p\n", (exec_t)addr);
|
||||||
return ((exec_t)addr)();
|
return ((exec_t)addr)();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -459,26 +436,26 @@ int cmd_exec(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
|
|||||||
#ifndef CONFIG_NSH_DISABLE_PS
|
#ifndef CONFIG_NSH_DISABLE_PS
|
||||||
int cmd_ps(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
int cmd_ps(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||||
{
|
{
|
||||||
nsh_output(vtbl, g_fmtid, "PID");
|
nsh_output(vtbl, "%5s ", "PID");
|
||||||
|
|
||||||
#ifdef CONFIG_SCHED_HAVE_PARENT
|
#ifdef CONFIG_SCHED_HAVE_PARENT
|
||||||
#ifdef HAVE_GROUPID
|
#ifdef HAVE_GROUPID
|
||||||
nsh_output(vtbl, g_fmtid, "GROUP");
|
nsh_output(vtbl, "%5s ", "GROUP");
|
||||||
#else
|
#else
|
||||||
nsh_output(vtbl, g_fmtid, "PPID");
|
nsh_output(vtbl, "%5s ", "PPID");
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
nsh_output(vtbl, g_fmtcommon,
|
nsh_output(vtbl, "%3s %-8s %-7s %3s %-8s %-9s ",
|
||||||
"PRI", "POLICY", "TYPE", "NPX", "STATE", "EVENT");
|
"PRI", "POLICY", "TYPE", "NPX", "STATE", "EVENT");
|
||||||
|
|
||||||
#ifndef CONFIG_DISABLE_SIGNALS
|
#ifndef CONFIG_DISABLE_SIGNALS
|
||||||
nsh_output(vtbl, g_fmtsigmask, "SIGMASK");
|
nsh_output(vtbl, "%-8s ", "SIGMASK");
|
||||||
#endif
|
#endif
|
||||||
#ifdef NSH_HAVE_CPULOAD
|
#ifdef NSH_HAVE_CPULOAD
|
||||||
nsh_output(vtbl, g_fmtload, "CPU");
|
nsh_output(vtbl, "%6s ", "CPU");
|
||||||
#endif
|
#endif
|
||||||
nsh_output(vtbl, g_fmtcmdline, "COMMAND");
|
nsh_output(vtbl, "%s\n", "COMMAND");
|
||||||
|
|
||||||
return nsh_foreach_direntry(vtbl, "ps", CONFIG_NSH_PROC_MOUNTPOINT,
|
return nsh_foreach_direntry(vtbl, "ps", CONFIG_NSH_PROC_MOUNTPOINT,
|
||||||
ps_callback, NULL);
|
ps_callback, NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user