From 725fe76b910d9215cceecd0ef362da76dcbca5e1 Mon Sep 17 00:00:00 2001 From: "chao.an" Date: Mon, 9 May 2022 12:28:16 +0800 Subject: [PATCH] trace: format the usage output before: Usage: trace ... Subcommand: start [-c][] : Start task tracing stop : Stop task tracing dump [-a][-c][] : Output the trace result [-a] mode [{+|-}{o|w|s|a|i|d}...] : Set task trace options switch [+|-] : Configure switch trace filter syscall [{+|-}...] : Configure syscall trace filter irq [{+|-}...] : Configure IRQ trace filter print [+|-] : Configure dump tnsh> after: Usage: trace ... Subcommand: start [-c][] : Start task tracing stop : Stop task tracing cmd [-c] [...] : Get the trace while running dump [-a][-c][] : Output the trace result [-a] mode [{+|-}{o|w|s|a|i|d}...] : Set task trace options switch [+|-] : Configure switch trace filter syscall [{+|-}...] : Configure syscall trace filter irq [{+|-}...] : Configure IRQ trace filter print [+|-] : Configure dump trace filter Signed-off-by: chao.an --- 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 ...\n" "Subcommand:\n" - " start [-c][] :" + " start [-c][] :" " Start task tracing\n" - " stop :" + " stop :" " Stop task tracing\n" #ifdef CONFIG_SYSTEM_SYSTEM - " cmd [-c] [...] :" + " cmd [-c] [...] :" " Get the trace while running \n" #endif #ifdef CONFIG_DRIVER_NOTERAM - " dump [-a][-c][] :" + " dump [-a][-c][] :" " Output the trace result\n" - " [-a] \n" + " [-a] \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 [{+|-}...] :" + " syscall [{+|-}...] :" " Configure syscall trace filter\n" #endif #ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER - " irq [{+|-}...] :" + " irq [{+|-}...] :" " Configure IRQ trace filter\n" #endif #ifdef CONFIG_SCHED_INSTRUMENTATION_DUMP - " print [+|-] :" + " print [+|-] :" " Configure dump trace filter\n" #endif ); + + fflush(stderr); } /****************************************************************************