blob: 389590c1ad21741b6eb8f6dac3db8c84551800db [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
25echo "#ifndef NO_LIBELF_SUPPORT"
26sed -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
38echo "#endif /* NO_LIBELF_SUPPORT */"
Ingo Molnar07800602009-04-20 15:00:56 +020039echo "};"