linux-stable/tools
Wei Li ae0f4eb34f 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 (15 samples) ]
  # perf c2c records sleep 1

   Usage: perf c2c {record|report}

      -v, --verbose         be more verbose (show counter open errors, etc)

  #

Signed-off-by: Wei Li <liwei391@huawei.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Hanjun Guo <guohanjun@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Rui Xiang <rui.xiang@huawei.com>
Link: http://lore.kernel.org/lkml/20220325092032.2956161-1-liwei391@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2022-03-26 10:55:57 -03:00
..
accounting delayacct: track delays from memory compact 2022-01-20 08:52:55 +02:00
arch tools arm64: Import cputype.h 2022-03-26 10:53:45 -03:00
bootconfig
bpf Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf 2022-02-03 13:42:38 -08:00
build Merge remote-tracking branch 'torvalds/master' into perf/core 2022-01-13 10:20:59 -03:00
cgroup tools/cgroup/slabinfo: update to work with struct slab 2022-02-21 11:34:49 +01:00
counter
debugging
edid
firewire
firmware
gpio
hv
iio
include Merge remote-tracking branch 'torvalds/master' into perf/core 2022-03-14 19:15:16 -03:00
io_uring
kvm/kvm_stat
laptop
leds
lib libperf tests: Fix typo in perf_evlist__open() failure error messages 2022-03-26 10:55:57 -03:00
memory-model tools/memory-model: Explain syntactic and semantic dependencies 2022-02-01 17:32:30 -08:00
objtool tools/objtool: Check for use of the ENQCMD instruction in the kernel 2022-02-15 11:31:43 +01:00
pci
pcmcia
perf perf tools: Enhance the matching of sub-commands abbreviations 2022-03-26 10:55:57 -03:00
power Thermal control updates for 5.18-rc1 2022-03-21 14:35:11 -07:00
rcu
scripts tools: Ignore errors from `which' when searching a GCC toolchain 2022-02-01 23:04:12 +01:00
spi
testing execve updates for v5.18-rc1 2022-03-21 19:16:02 -07:00
thermal/tmon
time
tracing rtla/osnoise: Fix error message when failing to enable trace instance 2022-02-25 21:05:30 -05:00
usb
virtio tools/virtio: handle fallout from folio work 2022-03-06 06:06:50 -05:00
vm
wmi
Makefile