Ingo Molnar | 0780060 | 2009-04-20 15:00:56 +0200 | [diff] [blame] | 1 | #!/bin/sh |
Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 2 | # SPDX-License-Identifier: GPL-2.0 |
Ingo Molnar | 0780060 | 2009-04-20 15:00:56 +0200 | [diff] [blame] | 3 | |
| 4 | echo "/* Automatically generated by $0 */ |
| 5 | struct cmdname_help |
| 6 | { |
| 7 | char name[16]; |
| 8 | char help[80]; |
| 9 | }; |
| 10 | |
| 11 | static struct cmdname_help common_cmds[] = {" |
| 12 | |
Ingo Molnar | 1d8c8b2 | 2009-04-20 15:52:29 +0200 | [diff] [blame] | 13 | sed -n -e 's/^perf-\([^ ]*\)[ ].* common.*/\1/p' command-list.txt | |
Ingo Molnar | 0780060 | 2009-04-20 15:00:56 +0200 | [diff] [blame] | 14 | sort | |
| 15 | while read cmd |
| 16 | do |
| 17 | sed -n ' |
Ingo Molnar | 1d8c8b2 | 2009-04-20 15:52:29 +0200 | [diff] [blame] | 18 | /^NAME/,/perf-'"$cmd"'/H |
Ingo Molnar | 0780060 | 2009-04-20 15:00:56 +0200 | [diff] [blame] | 19 | ${ |
| 20 | x |
Ingo Molnar | 1d8c8b2 | 2009-04-20 15:52:29 +0200 | [diff] [blame] | 21 | s/.*perf-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/ |
Ingo Molnar | 0780060 | 2009-04-20 15:00:56 +0200 | [diff] [blame] | 22 | p |
Ingo Molnar | 1d8c8b2 | 2009-04-20 15:52:29 +0200 | [diff] [blame] | 23 | }' "Documentation/perf-$cmd.txt" |
Ingo Molnar | 0780060 | 2009-04-20 15:00:56 +0200 | [diff] [blame] | 24 | done |
Namhyung Kim | 393be2e | 2012-08-06 13:41:21 +0900 | [diff] [blame] | 25 | |
Ingo Molnar | 89fe808 | 2013-09-30 12:07:11 +0200 | [diff] [blame] | 26 | echo "#ifdef HAVE_LIBELF_SUPPORT" |
Namhyung Kim | 393be2e | 2012-08-06 13:41:21 +0900 | [diff] [blame] | 27 | sed -n -e 's/^perf-\([^ ]*\)[ ].* full.*/\1/p' command-list.txt | |
| 28 | sort | |
| 29 | while read cmd |
| 30 | do |
| 31 | sed -n ' |
| 32 | /^NAME/,/perf-'"$cmd"'/H |
| 33 | ${ |
| 34 | x |
| 35 | s/.*perf-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/ |
| 36 | p |
| 37 | }' "Documentation/perf-$cmd.txt" |
| 38 | done |
Ingo Molnar | 89fe808 | 2013-09-30 12:07:11 +0200 | [diff] [blame] | 39 | echo "#endif /* HAVE_LIBELF_SUPPORT */" |
Jiri Olsa | cbd08b7 | 2016-01-07 10:14:04 +0100 | [diff] [blame] | 40 | |
Jin Yao | 22e9af4 | 2018-04-09 18:26:48 +0800 | [diff] [blame] | 41 | echo "#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE_SUPPORT)" |
Jiri Olsa | cbd08b7 | 2016-01-07 10:14:04 +0100 | [diff] [blame] | 42 | sed -n -e 's/^perf-\([^ ]*\)[ ].* audit*/\1/p' command-list.txt | |
| 43 | sort | |
| 44 | while read cmd |
| 45 | do |
| 46 | sed -n ' |
| 47 | /^NAME/,/perf-'"$cmd"'/H |
| 48 | ${ |
| 49 | x |
| 50 | s/.*perf-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/ |
| 51 | p |
| 52 | }' "Documentation/perf-$cmd.txt" |
| 53 | done |
| 54 | echo "#endif /* HAVE_LIBELF_SUPPORT */" |
Ingo Molnar | 0780060 | 2009-04-20 15:00:56 +0200 | [diff] [blame] | 55 | echo "};" |