Ingo Molnar | 0780060 | 2009-04-20 15:00:56 +0200 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | echo "/* Automatically generated by $0 */ |
| 4 | struct cmdname_help |
| 5 | { |
| 6 | char name[16]; |
| 7 | char help[80]; |
| 8 | }; |
| 9 | |
| 10 | static struct cmdname_help common_cmds[] = {" |
| 11 | |
Ingo Molnar | 1d8c8b2 | 2009-04-20 15:52:29 +0200 | [diff] [blame] | 12 | sed -n -e 's/^perf-\([^ ]*\)[ ].* common.*/\1/p' command-list.txt | |
Ingo Molnar | 0780060 | 2009-04-20 15:00:56 +0200 | [diff] [blame] | 13 | sort | |
| 14 | while read cmd |
| 15 | do |
| 16 | sed -n ' |
Ingo Molnar | 1d8c8b2 | 2009-04-20 15:52:29 +0200 | [diff] [blame] | 17 | /^NAME/,/perf-'"$cmd"'/H |
Ingo Molnar | 0780060 | 2009-04-20 15:00:56 +0200 | [diff] [blame] | 18 | ${ |
| 19 | x |
Ingo Molnar | 1d8c8b2 | 2009-04-20 15:52:29 +0200 | [diff] [blame] | 20 | s/.*perf-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/ |
Ingo Molnar | 0780060 | 2009-04-20 15:00:56 +0200 | [diff] [blame] | 21 | p |
Ingo Molnar | 1d8c8b2 | 2009-04-20 15:52:29 +0200 | [diff] [blame] | 22 | }' "Documentation/perf-$cmd.txt" |
Ingo Molnar | 0780060 | 2009-04-20 15:00:56 +0200 | [diff] [blame] | 23 | done |
Namhyung Kim | 393be2e | 2012-08-06 13:41:21 +0900 | [diff] [blame] | 24 | |
Namhyung Kim | 29a0fc9 | 2012-09-28 18:31:59 +0900 | [diff] [blame] | 25 | echo "#ifdef LIBELF_SUPPORT" |
Namhyung Kim | 393be2e | 2012-08-06 13:41:21 +0900 | [diff] [blame] | 26 | sed -n -e 's/^perf-\([^ ]*\)[ ].* full.*/\1/p' command-list.txt | |
| 27 | sort | |
| 28 | while read cmd |
| 29 | do |
| 30 | sed -n ' |
| 31 | /^NAME/,/perf-'"$cmd"'/H |
| 32 | ${ |
| 33 | x |
| 34 | s/.*perf-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/ |
| 35 | p |
| 36 | }' "Documentation/perf-$cmd.txt" |
| 37 | done |
Namhyung Kim | 29a0fc9 | 2012-09-28 18:31:59 +0900 | [diff] [blame] | 38 | echo "#endif /* LIBELF_SUPPORT */" |
Ingo Molnar | 0780060 | 2009-04-20 15:00:56 +0200 | [diff] [blame] | 39 | echo "};" |