blob: 36a885d2cd22d12ed004177f375bcaf4aac86a28 [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 */"
Ingo Molnar07800602009-04-20 15:00:56 +020039echo "};"