This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 725fe76b910d9215cceecd0ef362da76dcbca5e1
Author: chao.an <[email protected]>
AuthorDate: Mon May 9 12:28:16 2022 +0800

    trace: format the usage output
    
    before:
    Usage: trace <subcommand>...
    Subcommand:
      start [-c][<duration>]          : Start task tracing
      stop                            : Stop task tracing
      dump [-a][-c][<filename>]           : Output the trace result
     [-a] <Android SysTrace>
      mode [{+|-}{o|w|s|a|i|d}...]        : Set task trace options
      switch [+|-] : Configure switch trace filter
      syscall [{+|-}<syscallname>...] : Configure syscall trace filter
      irq [{+|-}<irqnum>...]          : Configure IRQ trace filter
      print [+|-] : Configure dump tnsh>
    
    after:
    Usage: trace <subcommand>...
    Subcommand:
     start   [-c][<duration>]            : Start task tracing
     stop                                : Stop task tracing
     cmd     [-c] <command> [<args>...]  : Get the trace while running <command>
     dump    [-a][-c][<filename>]        : Output the trace result
                                           [-a] <Android SysTrace>
     mode    [{+|-}{o|w|s|a|i|d}...]     : Set task trace options
     switch  [+|-]                       : Configure switch trace filter
     syscall [{+|-}<syscallname>...]     : Configure syscall trace filter
     irq     [{+|-}<irqnum>...]          : Configure IRQ trace filter
     print   [+|-]                       : Configure dump trace filter
    
    Signed-off-by: chao.an <[email protected]>
---
 system/trace/trace.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/system/trace/trace.c b/system/trace/trace.c
index c5c7f0fc0..bb382fede 100644
--- a/system/trace/trace.c
+++ b/system/trace/trace.c
@@ -787,38 +787,40 @@ static void show_usage(void)
   fprintf(stderr,
           "\nUsage: trace <subcommand>...\n"
           "Subcommand:\n"
-          "  start [-c][<duration>]          :"
+          " start   [-c][<duration>]            :"
                                 " Start task tracing\n"
-          "  stop                            :"
+          " stop                                :"
                                 " Stop task tracing\n"
 #ifdef CONFIG_SYSTEM_SYSTEM
-          "  cmd [-c] <command> [<args>...]  :"
+          " cmd     [-c] <command> [<args>...]  :"
                                 " Get the trace while running <command>\n"
 #endif
 #ifdef CONFIG_DRIVER_NOTERAM
-          "  dump [-a][-c][<filename>]           :"
+          " dump    [-a][-c][<filename>]        :"
                                 " Output the trace result\n"
-                                " [-a] <Android SysTrace>\n"
+          "                                       [-a] <Android SysTrace>\n"
 #endif
-          "  mode [{+|-}{o|w|s|a|i|d}...]        :"
+          " mode    [{+|-}{o|w|s|a|i|d}...]     :"
                                 " Set task trace options\n"
 #ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
-          "  switch [+|-] :"
+          " switch  [+|-]                       :"
                                 " Configure switch trace filter\n"
 #endif
 #ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL
-          "  syscall [{+|-}<syscallname>...] :"
+          " syscall [{+|-}<syscallname>...]     :"
                                 " Configure syscall trace filter\n"
 #endif
 #ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER
-          "  irq [{+|-}<irqnum>...]          :"
+          " irq     [{+|-}<irqnum>...]          :"
                                 " Configure IRQ trace filter\n"
 #endif
 #ifdef CONFIG_SCHED_INSTRUMENTATION_DUMP
-          "  print [+|-] :"
+          " print   [+|-]                       :"
                                 " Configure dump trace filter\n"
 #endif
          );
+
+  fflush(stderr);
 }
 
 /****************************************************************************

Reply via email to