blob: c3cef36d417683581ed7405ac842854057f8ff7b [file] [log] [blame]
Ingo Molnar07800602009-04-20 15:00:56 +02001#!/bin/sh
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01002# SPDX-License-Identifier: GPL-2.0
Ingo Molnar07800602009-04-20 15:00:56 +02003
4echo "/* Automatically generated by $0 */
5struct cmdname_help
6{
7 char name[16];
8 char help[80];
9};
10
11static struct cmdname_help common_cmds[] = {"
12
Ingo Molnar1d8c8b22009-04-20 15:52:29 +020013sed -n -e 's/^perf-\([^ ]*\)[ ].* common.*/\1/p' command-list.txt |
Ingo Molnar07800602009-04-20 15:00:56 +020014sort |
15while read cmd
16do
17 sed -n '
Ingo Molnar1d8c8b22009-04-20 15:52:29 +020018 /^NAME/,/perf-'"$cmd"'/H
Ingo Molnar07800602009-04-20 15:00:56 +020019 ${
20 x
Ingo Molnar1d8c8b22009-04-20 15:52:29 +020021 s/.*perf-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/
Ingo Molnar07800602009-04-20 15:00:56 +020022 p
Ingo Molnar1d8c8b22009-04-20 15:52:29 +020023 }' "Documentation/perf-$cmd.txt"
Ingo Molnar07800602009-04-20 15:00:56 +020024done
Namhyung Kim393be2e2012-08-06 13:41:21 +090025
Ingo Molnar89fe8082013-09-30 12:07:11 +020026echo "#ifdef HAVE_LIBELF_SUPPORT"
Namhyung Kim393be2e2012-08-06 13:41:21 +090027sed -n -e 's/^perf-\([^ ]*\)[ ].* full.*/\1/p' command-list.txt |
28sort |
29while read cmd
30do
31 sed -n '
32 /^NAME/,/perf-'"$cmd"'/H
33 ${
34 x
35 s/.*perf-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/
36 p
37 }' "Documentation/perf-$cmd.txt"
38done
Ingo Molnar89fe8082013-09-30 12:07:11 +020039echo "#endif /* HAVE_LIBELF_SUPPORT */"
Jiri Olsacbd08b72016-01-07 10:14:04 +010040
Jin Yao22e9af42018-04-09 18:26:48 +080041echo "#if defined(HAVE_LIBAUDIT_SUPPORT) || defined(HAVE_SYSCALL_TABLE_SUPPORT)"
Jiri Olsacbd08b72016-01-07 10:14:04 +010042sed -n -e 's/^perf-\([^ ]*\)[ ].* audit*/\1/p' command-list.txt |
43sort |
44while read cmd
45do
46 sed -n '
47 /^NAME/,/perf-'"$cmd"'/H
48 ${
49 x
50 s/.*perf-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/
51 p
52 }' "Documentation/perf-$cmd.txt"
53done
54echo "#endif /* HAVE_LIBELF_SUPPORT */"
Ingo Molnar07800602009-04-20 15:00:56 +020055echo "};"