You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/05/09 04:32:03 UTC
[GitHub] [incubator-nuttx-apps] anchao opened a new pull request, #1163: system/trace: correct arg index if command is alreay set
anchao opened a new pull request, #1163:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1163
## Summary
1. 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
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
```
2. system/trace: correct arg index if command is alreay set
An error occurs when the same command is executed twice
```
$ trace switch +
$ trace switch +
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>
```
3. system/sched_note: fix build break
Signed-off-by: chao.an <an...@xiaomi.com>
## Impact
N/A
## Testing
ci-check
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] pkarashchenko commented on a diff in pull request #1163: system/trace: correct arg index if command is alreay set
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #1163:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1163#discussion_r869981439
##########
system/trace/trace.c:
##########
@@ -502,12 +502,15 @@ static int trace_cmd_switch(int index, int argc, FAR char **argv,
if (argv[index][0] == '-' || argv[index][0] == '+')
{
enable = (argv[index][0] == '+');
+
+ index++;
+
Review Comment:
Optional
```suggestion
enable = (argv[index++][0] == '+');
```
##########
system/trace/trace.c:
##########
@@ -755,12 +756,15 @@ static int trace_cmd_print(int index, int argc, FAR char **argv,
if (argv[index][0] == '-' || argv[index][0] == '+')
{
enable = (argv[index][0] == '+');
+
+ index++;
+
Review Comment:
Optional
```suggestion
enable = (argv[index++][0] == '+');
```
##########
system/trace/trace.c:
##########
@@ -793,38 +793,40 @@ static void show_usage(void)
fprintf(stderr,
"\nUsage: trace <subcommand>...\n"
"Subcommand:\n"
- " start [-c][<duration>] :"
+ "\tstart [-c][<duration>]\t\t:"
Review Comment:
Yeah. Spaces seems to be more portable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] xiaoxiang781216 merged pull request #1163: system/trace: correct arg index if command is alreay set
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #1163:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1163
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] anchao commented on a diff in pull request #1163: system/trace: correct arg index if command is alreay set
Posted by GitBox <gi...@apache.org>.
anchao commented on code in PR #1163:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1163#discussion_r870941705
##########
system/trace/trace.c:
##########
@@ -793,38 +793,40 @@ static void show_usage(void)
fprintf(stderr,
"\nUsage: trace <subcommand>...\n"
"Subcommand:\n"
- " start [-c][<duration>] :"
+ "\tstart [-c][<duration>]\t\t:"
Review Comment:
Done
##########
system/trace/trace.c:
##########
@@ -502,12 +502,15 @@ static int trace_cmd_switch(int index, int argc, FAR char **argv,
if (argv[index][0] == '-' || argv[index][0] == '+')
{
enable = (argv[index][0] == '+');
+
+ index++;
+
Review Comment:
Done
##########
system/trace/trace.c:
##########
@@ -755,12 +756,15 @@ static int trace_cmd_print(int index, int argc, FAR char **argv,
if (argv[index][0] == '-' || argv[index][0] == '+')
{
enable = (argv[index][0] == '+');
+
+ index++;
+
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on a diff in pull request #1163: system/trace: correct arg index if command is alreay set
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #1163:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1163#discussion_r867961851
##########
system/trace/trace.c:
##########
@@ -793,38 +793,40 @@ static void show_usage(void)
fprintf(stderr,
"\nUsage: trace <subcommand>...\n"
"Subcommand:\n"
- " start [-c][<duration>] :"
+ "\tstart [-c][<duration>]\t\t:"
Review Comment:
space is more portable than \t since \t may map to 4 or 8 space
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org