Merged nuttx/apps into master
This commit is contained in:
commit
5fd07644c1
@ -154,18 +154,18 @@ cJSON *cJSON_GetObjectItem(cJSON *object, const char *string);
|
|||||||
* Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds.
|
* Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const char *cJSON_GetErrorPtr();
|
const char *cJSON_GetErrorPtr(void);
|
||||||
|
|
||||||
/* These calls create a cJSON item of the appropriate type. */
|
/* These calls create a cJSON item of the appropriate type. */
|
||||||
|
|
||||||
cJSON *cJSON_CreateNull();
|
cJSON *cJSON_CreateNull(void);
|
||||||
cJSON *cJSON_CreateTrue();
|
cJSON *cJSON_CreateTrue(void);
|
||||||
cJSON *cJSON_CreateFalse();
|
cJSON *cJSON_CreateFalse(void);
|
||||||
cJSON *cJSON_CreateBool(int b);
|
cJSON *cJSON_CreateBool(int b);
|
||||||
cJSON *cJSON_CreateNumber(double num);
|
cJSON *cJSON_CreateNumber(double num);
|
||||||
cJSON *cJSON_CreateString(const char *string);
|
cJSON *cJSON_CreateString(const char *string);
|
||||||
cJSON *cJSON_CreateArray();
|
cJSON *cJSON_CreateArray(void);
|
||||||
cJSON *cJSON_CreateObject();
|
cJSON *cJSON_CreateObject(void);
|
||||||
|
|
||||||
/* These utilities create an Array of count items. */
|
/* These utilities create an Array of count items. */
|
||||||
|
|
||||||
|
@ -132,8 +132,10 @@ static const char g_sigmask[] = "SigMask:";
|
|||||||
|
|
||||||
#if !defined(CONFIG_NSH_DISABLE_PSSTACKUSAGE)
|
#if !defined(CONFIG_NSH_DISABLE_PSSTACKUSAGE)
|
||||||
static const char g_stacksize[] = "StackSize:";
|
static const char g_stacksize[] = "StackSize:";
|
||||||
|
#ifdef CONFIG_STACK_COLORATION
|
||||||
static const char g_stackused[] = "StackUsed:";
|
static const char g_stackused[] = "StackUsed:";
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
@ -268,8 +270,10 @@ static int ps_callback(FAR struct nsh_vtbl_s *vtbl, FAR const char *dirpath,
|
|||||||
int i;
|
int i;
|
||||||
#if !defined(CONFIG_NSH_DISABLE_PSSTACKUSAGE)
|
#if !defined(CONFIG_NSH_DISABLE_PSSTACKUSAGE)
|
||||||
uint32_t stack_size;
|
uint32_t stack_size;
|
||||||
|
#ifdef CONFIG_STACK_COLORATION
|
||||||
uint32_t stack_used;
|
uint32_t stack_used;
|
||||||
uint32_t stack_filled;
|
uint32_t stack_filled;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Task/thread entries in the /proc directory will all be (1) directories
|
/* Task/thread entries in the /proc directory will all be (1) directories
|
||||||
@ -391,7 +395,9 @@ static int ps_callback(FAR struct nsh_vtbl_s *vtbl, FAR const char *dirpath,
|
|||||||
/* Get the StackSize and StackUsed */
|
/* Get the StackSize and StackUsed */
|
||||||
|
|
||||||
stack_size = 0;
|
stack_size = 0;
|
||||||
|
#ifdef CONFIG_STACK_COLORATION
|
||||||
stack_used = 0;
|
stack_used = 0;
|
||||||
|
#endif
|
||||||
filepath = NULL;
|
filepath = NULL;
|
||||||
|
|
||||||
ret = asprintf(&filepath, "%s/%s/stack", dirpath, entryp->d_name);
|
ret = asprintf(&filepath, "%s/%s/stack", dirpath, entryp->d_name);
|
||||||
@ -444,16 +450,20 @@ static int ps_callback(FAR struct nsh_vtbl_s *vtbl, FAR const char *dirpath,
|
|||||||
{
|
{
|
||||||
stack_size = (uint32_t)atoi(&line[12]);
|
stack_size = (uint32_t)atoi(&line[12]);
|
||||||
}
|
}
|
||||||
|
#ifdef CONFIG_STACK_COLORATION
|
||||||
else if (strncmp(line, g_stackused, strlen(g_stackused)) == 0)
|
else if (strncmp(line, g_stackused, strlen(g_stackused)) == 0)
|
||||||
{
|
{
|
||||||
stack_used = (uint32_t)atoi(&line[12]);
|
stack_used = (uint32_t)atoi(&line[12]);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
while (nextline != NULL);
|
while (nextline != NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nsh_output(vtbl, "%6.6u ", (unsigned int)stack_size);
|
nsh_output(vtbl, "%6.6u ", (unsigned int)stack_size);
|
||||||
|
|
||||||
|
#ifdef CONFIG_STACK_COLORATION
|
||||||
nsh_output(vtbl, "%6.6u ", (unsigned int)stack_used);
|
nsh_output(vtbl, "%6.6u ", (unsigned int)stack_used);
|
||||||
|
|
||||||
stack_filled = 0;
|
stack_filled = 0;
|
||||||
@ -470,6 +480,7 @@ static int ps_callback(FAR struct nsh_vtbl_s *vtbl, FAR const char *dirpath,
|
|||||||
stack_filled / 10, stack_filled % 10,
|
stack_filled / 10, stack_filled % 10,
|
||||||
(stack_filled >= 10 * 80 ? "!" : " "));
|
(stack_filled >= 10 * 80 ? "!" : " "));
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef NSH_HAVE_CPULOAD
|
#ifdef NSH_HAVE_CPULOAD
|
||||||
/* Get the CPU load */
|
/* Get the CPU load */
|
||||||
@ -572,11 +583,15 @@ int cmd_ps(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
|||||||
#ifndef CONFIG_DISABLE_SIGNALS
|
#ifndef CONFIG_DISABLE_SIGNALS
|
||||||
nsh_output(vtbl, "%-8s ", "SIGMASK");
|
nsh_output(vtbl, "%-8s ", "SIGMASK");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(CONFIG_NSH_DISABLE_PSSTACKUSAGE)
|
#if !defined(CONFIG_NSH_DISABLE_PSSTACKUSAGE)
|
||||||
nsh_output(vtbl, "%6s ", "STACK");
|
nsh_output(vtbl, "%6s ", "STACK");
|
||||||
|
#ifdef CONFIG_STACK_COLORATION
|
||||||
nsh_output(vtbl, "%6s ", "USED");
|
nsh_output(vtbl, "%6s ", "USED");
|
||||||
nsh_output(vtbl, "%7s ", "FILLED");
|
nsh_output(vtbl, "%7s ", "FILLED");
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef NSH_HAVE_CPULOAD
|
#ifdef NSH_HAVE_CPULOAD
|
||||||
nsh_output(vtbl, "%6s ", "CPU");
|
nsh_output(vtbl, "%6s ", "CPU");
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user