Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:19

0001 /*
0002  *  stackuse Command Implementation
0003  *
0004  *  COPYRIGHT (c) 1989-2008.
0005  *  On-Line Applications Research Corporation (OAR).
0006  *
0007  *  The license and distribution terms for this file may be
0008  *  found in the file LICENSE in this distribution or at
0009  *  http://www.rtems.org/license/LICENSE.
0010  */
0011 
0012 #ifdef HAVE_CONFIG_H
0013 #include "config.h"
0014 #endif
0015 
0016 #include <stdio.h>
0017 
0018 #include <rtems.h>
0019 #include <rtems/printer.h>
0020 #include <rtems/stackchk.h>
0021 #include <rtems/shell.h>
0022 #include <rtems/score/threadimpl.h>
0023 #include "internal.h"
0024 
0025 static int rtems_shell_main_stackuse(
0026   int   argc RTEMS_UNUSED,
0027   char *argv[] RTEMS_UNUSED
0028 )
0029 {
0030   rtems_printer printer;
0031   rtems_print_printer_printf(&printer);
0032   rtems_stack_checker_report_usage_with_plugin( &printer );
0033   return 0;
0034 }
0035 
0036 rtems_shell_cmd_t rtems_shell_STACKUSE_Command = {
0037   "stackuse",                                 /* name */
0038   "print per thread stack usage",             /* usage */
0039   "rtems",                                    /* topic */
0040   rtems_shell_main_stackuse,                  /* command */
0041   NULL,                                       /* alias */
0042   NULL                                        /* next */
0043 };