Commit ae0f4eb
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 <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Hanjun Guo <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Rui Xiang <[email protected]>
Link: http://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>1 parent c2eeac9 commit ae0f4eb
File tree
9 files changed
+23
-18
lines changed- tools/perf
9 files changed
+23
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
3025 | 3026 | | |
3026 | 3027 | | |
3027 | 3028 | | |
3028 | | - | |
| 3029 | + | |
3029 | 3030 | | |
3030 | | - | |
| 3031 | + | |
3031 | 3032 | | |
3032 | 3033 | | |
3033 | 3034 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1946 | 1946 | | |
1947 | 1947 | | |
1948 | 1948 | | |
1949 | | - | |
| 1949 | + | |
1950 | 1950 | | |
1951 | 1951 | | |
1952 | 1952 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
1500 | 1501 | | |
1501 | 1502 | | |
1502 | 1503 | | |
1503 | | - | |
| 1504 | + | |
1504 | 1505 | | |
1505 | 1506 | | |
1506 | | - | |
| 1507 | + | |
1507 | 1508 | | |
1508 | 1509 | | |
1509 | 1510 | | |
| |||
1631 | 1632 | | |
1632 | 1633 | | |
1633 | 1634 | | |
1634 | | - | |
| 1635 | + | |
1635 | 1636 | | |
1636 | | - | |
| 1637 | + | |
1637 | 1638 | | |
1638 | 1639 | | |
1639 | 1640 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
1166 | 1167 | | |
1167 | 1168 | | |
1168 | 1169 | | |
1169 | | - | |
| 1170 | + | |
1170 | 1171 | | |
1171 | | - | |
| 1172 | + | |
1172 | 1173 | | |
1173 | 1174 | | |
1174 | 1175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
496 | 497 | | |
497 | 498 | | |
498 | 499 | | |
499 | | - | |
| 500 | + | |
500 | 501 | | |
501 | | - | |
| 502 | + | |
502 | 503 | | |
503 | 504 | | |
504 | 505 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3561 | 3561 | | |
3562 | 3562 | | |
3563 | 3563 | | |
3564 | | - | |
| 3564 | + | |
3565 | 3565 | | |
3566 | 3566 | | |
3567 | 3567 | | |
| |||
3581 | 3581 | | |
3582 | 3582 | | |
3583 | 3583 | | |
3584 | | - | |
| 3584 | + | |
3585 | 3585 | | |
3586 | 3586 | | |
3587 | 3587 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3922 | 3922 | | |
3923 | 3923 | | |
3924 | 3924 | | |
3925 | | - | |
| 3925 | + | |
3926 | 3926 | | |
3927 | 3927 | | |
3928 | 3928 | | |
3929 | 3929 | | |
3930 | 3930 | | |
3931 | | - | |
| 3931 | + | |
3932 | 3932 | | |
3933 | 3933 | | |
3934 | 3934 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2271 | 2271 | | |
2272 | 2272 | | |
2273 | 2273 | | |
2274 | | - | |
| 2274 | + | |
2275 | 2275 | | |
2276 | 2276 | | |
2277 | 2277 | | |
2278 | | - | |
| 2278 | + | |
2279 | 2279 | | |
2280 | 2280 | | |
2281 | 2281 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
1983 | 1984 | | |
1984 | 1985 | | |
1985 | 1986 | | |
1986 | | - | |
| 1987 | + | |
1987 | 1988 | | |
1988 | 1989 | | |
1989 | 1990 | | |
| |||
0 commit comments