blob: 3ac38031d53400337815560562a52093aaeee9e2 [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
Namhyung Kim29a0fc92012-09-28 18:31:59 +090025echo "#ifdef 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
Namhyung Kim29a0fc92012-09-28 18:31:59 +090038echo "#endif /* LIBELF_SUPPORT */"
Ingo Molnar07800602009-04-20 15:00:56 +020039echo "};"