]> git.ipfire.org Git - thirdparty/kernel/linux.git/blame - tools/perf/util/generate-cmdlist.sh
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[thirdparty/kernel/linux.git] / tools / perf / util / generate-cmdlist.sh
CommitLineData
07800601 1#!/bin/sh
b2441318 2# SPDX-License-Identifier: GPL-2.0
07800601
IM
3
4echo "/* Automatically generated by $0 */
5struct cmdname_help
6{
7 char name[16];
8 char help[80];
9};
10
11static struct cmdname_help common_cmds[] = {"
12
1d8c8b20 13sed -n -e 's/^perf-\([^ ]*\)[ ].* common.*/\1/p' command-list.txt |
07800601
IM
14sort |
15while read cmd
16do
17 sed -n '
1d8c8b20 18 /^NAME/,/perf-'"$cmd"'/H
07800601
IM
19 ${
20 x
1d8c8b20 21 s/.*perf-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/
07800601 22 p
1d8c8b20 23 }' "Documentation/perf-$cmd.txt"
07800601 24done
393be2e3 25
89fe808a 26echo "#ifdef HAVE_LIBELF_SUPPORT"
393be2e3
NK
27sed -n -e 's/^perf-\([^ ]*\)[ ].* full.*/\1/p' command-list.txt |
28sort |
29while read cmd
30do
31 sed -n '
32 /^NAME/,/perf-'"$cmd"'/H
33 ${
34 x
35 s/.*perf-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/
36 p
37 }' "Documentation/perf-$cmd.txt"
38done
89fe808a 39echo "#endif /* HAVE_LIBELF_SUPPORT */"
cbd08b73
JO
40
41echo "#ifdef HAVE_LIBAUDIT_SUPPORT"
42sed -n -e 's/^perf-\([^ ]*\)[ ].* audit*/\1/p' command-list.txt |
43sort |
44while read cmd
45do
46 sed -n '
47 /^NAME/,/perf-'"$cmd"'/H
48 ${
49 x
50 s/.*perf-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/
51 p
52 }' "Documentation/perf-$cmd.txt"
53done
54echo "#endif /* HAVE_LIBELF_SUPPORT */"
07800601 55echo "};"