mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-07 16:13:07 +00:00
2008-01-07 Joel Sherrill <joel.sherrill@oarcorp.com>
* libmisc/Makefile.am: Add new files. * libmisc/shell/internal.h: Prototype for rtems_shell_print_heap_info() * libmisc/shell/main_mallocinfo.c: Use rtems_shell_print_heap_info(). * libmisc/shell/shellconfig.h: Add wkspace command. * libmisc/shell/main_wkspaceinfo.c, libmisc/shell/print_heapinfo.c: New files.
This commit is contained in:
@@ -1,3 +1,12 @@
|
|||||||
|
2008-01-07 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
|
* libmisc/Makefile.am: Add new files.
|
||||||
|
* libmisc/shell/internal.h: Prototype for rtems_shell_print_heap_info()
|
||||||
|
* libmisc/shell/main_mallocinfo.c: Use rtems_shell_print_heap_info().
|
||||||
|
* libmisc/shell/shellconfig.h: Add wkspace command.
|
||||||
|
* libmisc/shell/main_wkspaceinfo.c,
|
||||||
|
libmisc/shell/print_heapinfo.c: New files.
|
||||||
|
|
||||||
2008-01-07 Joel Sherrill <joel.sherrill@oarcorp.com>
|
2008-01-07 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
* score/inline/rtems/score/isr.inl: Fix spacing.
|
* score/inline/rtems/score/isr.inl: Fix spacing.
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ libmw_fb_a_SOURCES = mw-fb/mw_fb.c mw-fb/mw_uid.c mw-fb/mw_fb.h \
|
|||||||
mw-fb/mw_uid.h
|
mw-fb/mw_uid.h
|
||||||
|
|
||||||
## shell
|
## shell
|
||||||
|
|
||||||
if LIBSHELL
|
if LIBSHELL
|
||||||
noinst_LIBRARIES += libshell.a
|
noinst_LIBRARIES += libshell.a
|
||||||
if LIBNETWORKING
|
if LIBNETWORKING
|
||||||
@@ -86,7 +85,7 @@ libshell_a_SOURCES = shell/cat_file.c shell/cmds.c shell/internal.h \
|
|||||||
shell/shell.h shell/shell_makeargs.c shell/str2int.c shell/write_file.c \
|
shell/shell.h shell/shell_makeargs.c shell/str2int.c shell/write_file.c \
|
||||||
shell/utils-cp.c shell/err.c shell/errx.c shell/verr.c shell/verrx.c \
|
shell/utils-cp.c shell/err.c shell/errx.c shell/verr.c shell/verrx.c \
|
||||||
shell/vwarn.c shell/vwarnx.c shell/warn.c shell/warnx.c \
|
shell/vwarn.c shell/vwarnx.c shell/warn.c shell/warnx.c \
|
||||||
shell/fts.c
|
shell/fts.c shell/print_heapinfo.c shell/main_wkspaceinfo.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
EXTRA_DIST += shell/README
|
EXTRA_DIST += shell/README
|
||||||
|
|||||||
@@ -33,9 +33,16 @@ rtems_shell_topic_t * rtems_shell_lookup_topic(char * topic);
|
|||||||
void rtems_shell_register_monitor_commands(void);
|
void rtems_shell_register_monitor_commands(void);
|
||||||
void rtems_shell_initialize_command_set(void);
|
void rtems_shell_initialize_command_set(void);
|
||||||
|
|
||||||
int rtems_shell_libc_mounter (const char* driver,
|
int rtems_shell_libc_mounter(
|
||||||
const char* path,
|
const char* driver,
|
||||||
rtems_shell_filesystems_t* fs,
|
const char* path,
|
||||||
rtems_filesystem_options_t options);
|
rtems_shell_filesystems_t* fs,
|
||||||
|
rtems_filesystem_options_t options
|
||||||
|
);
|
||||||
|
|
||||||
|
void rtems_shell_print_heap_info(
|
||||||
|
const char *c,
|
||||||
|
Heap_Information *h
|
||||||
|
);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ int rtems_shell_main_malloc_info(
|
|||||||
region_information_block info;
|
region_information_block info;
|
||||||
|
|
||||||
malloc_info( &info );
|
malloc_info( &info );
|
||||||
printit( "free", &info.Free );
|
rtems_shell_print_heap_info( "free", &info.Free );
|
||||||
printit( "used", &info.Used );
|
rtems_shell_print_heap_info( "used", &info.Used );
|
||||||
return 0;
|
return 0;
|
||||||
} else if ( !strcmp( argv[1], "stats" ) ) {
|
} else if ( !strcmp( argv[1], "stats" ) ) {
|
||||||
malloc_report_statistics_with_plugin(
|
malloc_report_statistics_with_plugin(
|
||||||
|
|||||||
52
cpukit/libmisc/shell/main_wkspaceinfo.c
Normal file
52
cpukit/libmisc/shell/main_wkspaceinfo.c
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
* MALLOC_INFO Shell Command Implmentation
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-2007.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.rtems.com/license/LICENSE.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
|
#include <rtems.h>
|
||||||
|
#include <rtems/malloc.h>
|
||||||
|
#include <rtems/shell.h>
|
||||||
|
#include "internal.h"
|
||||||
|
|
||||||
|
int rtems_shell_main_wkspace_info(
|
||||||
|
int argc,
|
||||||
|
char *argv[]
|
||||||
|
)
|
||||||
|
{
|
||||||
|
Heap_Information_block info;
|
||||||
|
extern void classinfo_tester();
|
||||||
|
|
||||||
|
/* XXX lock allocator and do not violate visibility */
|
||||||
|
_Heap_Get_information( &_Workspace_Area, &info );
|
||||||
|
rtems_shell_print_heap_info( "free", &info.Free );
|
||||||
|
rtems_shell_print_heap_info( "used", &info.Used );
|
||||||
|
|
||||||
|
classinfo_tester();
|
||||||
|
decode_id( _Thread_Executing->Object.id );
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
rtems_shell_cmd_t rtems_shell_WKSPACE_INFO_Command = {
|
||||||
|
"wkspace", /* name */
|
||||||
|
"", /* usage */
|
||||||
|
"rtems", /* topic */
|
||||||
|
rtems_shell_main_wkspace_info, /* command */
|
||||||
|
NULL, /* alias */
|
||||||
|
NULL /* next */
|
||||||
|
};
|
||||||
|
|
||||||
37
cpukit/libmisc/shell/print_heapinfo.c
Normal file
37
cpukit/libmisc/shell/print_heapinfo.c
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* Print Heap Information Structure
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-2007.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.rtems.com/license/LICENSE.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
|
#include <rtems.h>
|
||||||
|
#include <rtems/shell.h>
|
||||||
|
#include "internal.h"
|
||||||
|
|
||||||
|
void rtems_shell_print_heap_info(
|
||||||
|
const char *c,
|
||||||
|
Heap_Information *h
|
||||||
|
)
|
||||||
|
{
|
||||||
|
printf(
|
||||||
|
"Number of %s blocks: %" PRId32 "\n"
|
||||||
|
"Largest %s block: %" PRId32 "\n"
|
||||||
|
"Total bytes %s: %" PRId32 "\n",
|
||||||
|
c, h->number,
|
||||||
|
c, h->largest,
|
||||||
|
c, h->total
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -53,7 +53,9 @@ extern rtems_shell_cmd_t rtems_shell_BLKSYNC_Command;
|
|||||||
extern rtems_shell_cmd_t rtems_shell_CPUUSE_Command;
|
extern rtems_shell_cmd_t rtems_shell_CPUUSE_Command;
|
||||||
extern rtems_shell_cmd_t rtems_shell_STACKUSE_Command;
|
extern rtems_shell_cmd_t rtems_shell_STACKUSE_Command;
|
||||||
extern rtems_shell_cmd_t rtems_shell_PERIODUSE_Command;
|
extern rtems_shell_cmd_t rtems_shell_PERIODUSE_Command;
|
||||||
|
extern rtems_shell_cmd_t rtems_shell_WKSPACE_INFO_Command;
|
||||||
extern rtems_shell_cmd_t rtems_shell_MALLOC_INFO_Command;
|
extern rtems_shell_cmd_t rtems_shell_MALLOC_INFO_Command;
|
||||||
|
extern rtems_shell_cmd_t rtems_shell_JOEL_Command;
|
||||||
|
|
||||||
extern rtems_shell_cmd_t *rtems_shell_Initial_commands[];
|
extern rtems_shell_cmd_t *rtems_shell_Initial_commands[];
|
||||||
|
|
||||||
@@ -287,6 +289,12 @@ extern rtems_shell_filesystems_t *rtems_shell_Mount_filesystems[];
|
|||||||
defined(CONFIGURE_SHELL_COMMAND_PERIODUSE)
|
defined(CONFIGURE_SHELL_COMMAND_PERIODUSE)
|
||||||
&rtems_shell_PERIODUSE_Command,
|
&rtems_shell_PERIODUSE_Command,
|
||||||
#endif
|
#endif
|
||||||
|
#if (defined(CONFIGURE_SHELL_COMMANDS_ALL) && \
|
||||||
|
!defined(CONFIGURE_SHELL_COMMAND_WKSPACE_INFO)) || \
|
||||||
|
defined(CONFIGURE_SHELL_COMMAND_WKSPACE_INFO)
|
||||||
|
&rtems_shell_WKSPACE_INFO_Command,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Malloc family commands
|
* Malloc family commands
|
||||||
@@ -297,6 +305,7 @@ extern rtems_shell_filesystems_t *rtems_shell_Mount_filesystems[];
|
|||||||
&rtems_shell_MALLOC_INFO_Command,
|
&rtems_shell_MALLOC_INFO_Command,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
&rtems_shell_JOEL_Command,
|
||||||
/*
|
/*
|
||||||
* User defined shell commands
|
* User defined shell commands
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user