2009-04-20 13:00:56 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
echo "/* Automatically generated by $0 */
|
|
|
|
struct cmdname_help
|
|
|
|
{
|
|
|
|
char name[16];
|
|
|
|
char help[80];
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct cmdname_help common_cmds[] = {"
|
|
|
|
|
2009-04-20 13:52:29 +00:00
|
|
|
sed -n -e 's/^perf-\([^ ]*\)[ ].* common.*/\1/p' command-list.txt |
|
2009-04-20 13:00:56 +00:00
|
|
|
sort |
|
|
|
|
while read cmd
|
|
|
|
do
|
|
|
|
sed -n '
|
2009-04-20 13:52:29 +00:00
|
|
|
/^NAME/,/perf-'"$cmd"'/H
|
2009-04-20 13:00:56 +00:00
|
|
|
${
|
|
|
|
x
|
2009-04-20 13:52:29 +00:00
|
|
|
s/.*perf-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/
|
2009-04-20 13:00:56 +00:00
|
|
|
p
|
2009-04-20 13:52:29 +00:00
|
|
|
}' "Documentation/perf-$cmd.txt"
|
2009-04-20 13:00:56 +00:00
|
|
|
done
|
2012-08-06 04:41:21 +00:00
|
|
|
|
2013-09-30 10:07:11 +00:00
|
|
|
echo "#ifdef HAVE_LIBELF_SUPPORT"
|
2012-08-06 04:41:21 +00:00
|
|
|
sed -n -e 's/^perf-\([^ ]*\)[ ].* full.*/\1/p' command-list.txt |
|
|
|
|
sort |
|
|
|
|
while read cmd
|
|
|
|
do
|
|
|
|
sed -n '
|
|
|
|
/^NAME/,/perf-'"$cmd"'/H
|
|
|
|
${
|
|
|
|
x
|
|
|
|
s/.*perf-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/
|
|
|
|
p
|
|
|
|
}' "Documentation/perf-$cmd.txt"
|
|
|
|
done
|
2013-09-30 10:07:11 +00:00
|
|
|
echo "#endif /* HAVE_LIBELF_SUPPORT */"
|
2016-01-07 09:14:04 +00:00
|
|
|
|
|
|
|
echo "#ifdef HAVE_LIBAUDIT_SUPPORT"
|
|
|
|
sed -n -e 's/^perf-\([^ ]*\)[ ].* audit*/\1/p' command-list.txt |
|
|
|
|
sort |
|
|
|
|
while read cmd
|
|
|
|
do
|
|
|
|
sed -n '
|
|
|
|
/^NAME/,/perf-'"$cmd"'/H
|
|
|
|
${
|
|
|
|
x
|
|
|
|
s/.*perf-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/
|
|
|
|
p
|
|
|
|
}' "Documentation/perf-$cmd.txt"
|
|
|
|
done
|
|
|
|
echo "#endif /* HAVE_LIBELF_SUPPORT */"
|
2009-04-20 13:00:56 +00:00
|
|
|
echo "};"
|