blob: 0ac2037c970c9c5f1b62b554809fb9a4f4dd6e00 [file] [log] [blame]
Ingo Molnar07800602009-04-20 15:00:56 +02001#!/bin/sh
2
3echo "/* Automatically generated by $0 */
4struct cmdname_help
5{
6 char name[16];
7 char help[80];
8};
9
10static struct cmdname_help common_cmds[] = {"
11
Ingo Molnar1d8c8b22009-04-20 15:52:29 +020012sed -n -e 's/^perf-\([^ ]*\)[ ].* common.*/\1/p' command-list.txt |
Ingo Molnar07800602009-04-20 15:00:56 +020013sort |
14while read cmd
15do
16 sed -n '
Ingo Molnar1d8c8b22009-04-20 15:52:29 +020017 /^NAME/,/perf-'"$cmd"'/H
Ingo Molnar07800602009-04-20 15:00:56 +020018 ${
19 x
Ingo Molnar1d8c8b22009-04-20 15:52:29 +020020 s/.*perf-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/
Ingo Molnar07800602009-04-20 15:00:56 +020021 p
Ingo Molnar1d8c8b22009-04-20 15:52:29 +020022 }' "Documentation/perf-$cmd.txt"
Ingo Molnar07800602009-04-20 15:00:56 +020023done
Namhyung Kim393be2e2012-08-06 13:41:21 +090024
Ingo Molnar89fe8082013-09-30 12:07:11 +020025echo "#ifdef HAVE_LIBELF_SUPPORT"
Namhyung Kim393be2e2012-08-06 13:41:21 +090026sed -n -e 's/^perf-\([^ ]*\)[ ].* full.*/\1/p' command-list.txt |
27sort |
28while read cmd
29do
30 sed -n '
31 /^NAME/,/perf-'"$cmd"'/H
32 ${
33 x
34 s/.*perf-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/
35 p
36 }' "Documentation/perf-$cmd.txt"
37done
Ingo Molnar89fe8082013-09-30 12:07:11 +020038echo "#endif /* HAVE_LIBELF_SUPPORT */"
Jiri Olsacbd08b72016-01-07 10:14:04 +010039
40echo "#ifdef HAVE_LIBAUDIT_SUPPORT"
41sed -n -e 's/^perf-\([^ ]*\)[ ].* audit*/\1/p' command-list.txt |
42sort |
43while read cmd
44do
45 sed -n '
46 /^NAME/,/perf-'"$cmd"'/H
47 ${
48 x
49 s/.*perf-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/
50 p
51 }' "Documentation/perf-$cmd.txt"
52done
53echo "#endif /* HAVE_LIBELF_SUPPORT */"
Ingo Molnar07800602009-04-20 15:00:56 +020054echo "};"