perf tools: Enhance the matching of sub-commands abbreviations
We support short command 'rec*' for 'record' and 'rep*' for 'report' in lots of sub-commands, but the matching is not quite strict currnetly. It may be puzzling sometime, like we mis-type a 'recport' to report but it will perform 'record' in fact without any message. To fix this, add a check to ensure that the short cmd is valid prefix of the real command. Committer testing: [root@quaco ~]# perf c2c re sleep 1 Usage: perf c2c {record|report} -v, --verbose be more verbose (show counter open errors, etc) # perf c2c rec sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.038 MB perf.data (16 samples) ] # perf c2c recport sleep 1 Usage: perf c2c {record|report} -v, --verbose be more verbose (show counter open errors, etc) # perf c2c record sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.038 MB perf.data (1...
Showing
- tools/perf/builtin-c2c.c 3 additions, 2 deletionstools/perf/builtin-c2c.c
- tools/perf/builtin-kmem.c 1 addition, 1 deletiontools/perf/builtin-kmem.c
- tools/perf/builtin-kvm.c 5 additions, 4 deletionstools/perf/builtin-kvm.c
- tools/perf/builtin-lock.c 3 additions, 2 deletionstools/perf/builtin-lock.c
- tools/perf/builtin-mem.c 3 additions, 2 deletionstools/perf/builtin-mem.c
- tools/perf/builtin-sched.c 2 additions, 2 deletionstools/perf/builtin-sched.c
- tools/perf/builtin-script.c 2 additions, 2 deletionstools/perf/builtin-script.c
- tools/perf/builtin-stat.c 2 additions, 2 deletionstools/perf/builtin-stat.c
- tools/perf/builtin-timechart.c 2 additions, 1 deletiontools/perf/builtin-timechart.c
Please register or sign in to comment