File indexing completed on 2025-05-11 08:24:19
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifdef HAVE_CONFIG_H
0013 #include "config.h"
0014 #endif
0015
0016 #include <stdio.h>
0017 #include <string.h>
0018
0019 #include <rtems.h>
0020 #include <rtems/printer.h>
0021 #include <rtems/shell.h>
0022 #include "internal.h"
0023
0024 static int rtems_shell_main_perioduse(
0025 int argc,
0026 char *argv[]
0027 )
0028 {
0029
0030
0031
0032 if ( argc == 1 ) {
0033 rtems_printer printer;
0034 rtems_print_printer_printf(&printer);
0035 rtems_rate_monotonic_report_statistics_with_plugin(
0036 &printer
0037 );
0038 return 0;
0039 }
0040
0041
0042
0043
0044 if ( argc == 2 && !strcmp( argv[1], "-r" ) ) {
0045 printf( "Resetting Period Usage information\n" );
0046 rtems_rate_monotonic_reset_all_statistics();
0047 return 0;
0048 }
0049
0050
0051
0052
0053 fprintf( stderr, "%s: [-r]\n", argv[0] );
0054 return -1;
0055 }
0056
0057 rtems_shell_cmd_t rtems_shell_PERIODUSE_Command = {
0058 "perioduse",
0059 "[-r] print or reset per period usage",
0060 "rtems",
0061 rtems_shell_main_perioduse,
0062 NULL,
0063 NULL
0064 };