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 | |
Ingo Molnar | 89fe808 | 2013-09-30 12:07:11 +0200 | [diff] [blame] | 25 | echo "#ifdef HAVE_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 |
Ingo Molnar | 89fe808 | 2013-09-30 12:07:11 +0200 | [diff] [blame] | 38 | echo "#endif /* HAVE_LIBELF_SUPPORT */" |
Jiri Olsa | cbd08b7 | 2016-01-07 10:14:04 +0100 | [diff] [blame] | 39 | |
| 40 | echo "#ifdef HAVE_LIBAUDIT_SUPPORT" |
| 41 | sed -n -e 's/^perf-\([^ ]*\)[ ].* audit*/\1/p' command-list.txt | |
| 42 | sort | |
| 43 | while read cmd |
| 44 | do |
| 45 | sed -n ' |
| 46 | /^NAME/,/perf-'"$cmd"'/H |
| 47 | ${ |
| 48 | x |
| 49 | s/.*perf-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/ |
| 50 | p |
| 51 | }' "Documentation/perf-$cmd.txt" |
| 52 | done |
| 53 | echo "#endif /* HAVE_LIBELF_SUPPORT */" |
Ingo Molnar | 0780060 | 2009-04-20 15:00:56 +0200 | [diff] [blame] | 54 | echo "};" |