Vitaly Chikunov
486642baea
perf beauty: Fix fsconfig generator
...
[ Upstream commit 2e1daee14e67fbf9b27280b974e2c680a22cabea ]
After gnulib update sed stopped matching `[[:space:]]*+' as before,
causing the following compilation error:
In file included from builtin-trace.c:719:
trace/beauty/generated/fsconfig_arrays.c:2:3: error: expected expression before ']' token
2 | [] = "",
| ^
trace/beauty/generated/fsconfig_arrays.c:2:3: error: array index in initializer not of integer type
trace/beauty/generated/fsconfig_arrays.c:2:3: note: (near initialization for 'fsconfig_cmds')
Fix this by correcting the regular expression used in the generator.
Also, clean up the script by removing redundant egrep, xargs, and printf
invocations.
Committer testing:
Continues to work:
$ cat tools/perf/trace/beauty/fsconfig.sh
#!/bin/sh
# SPDX-License-Identifier: LGPL-2.1
if [ $# -ne 1 ] ; then
linux_header_dir=tools/include/uapi/linux
else
linux_header_dir=$1
fi
linux_mount=${linux_header_dir}/mount.h
printf "static const char *fsconfig_cmds[] = {\n"
ms='[[:space:]]*'
sed -nr "s/^${ms}FSCONFIG_([[:alnum:]_]+)${ms}=${ms}([[:digit:]]+)${ms},.*/\t[\2] = \"\1\",/p" \
${linux_mount}
printf "};\n"
$ tools/perf/trace/beauty/fsconfig.sh
static const char *fsconfig_cmds[] = {
[0] = "SET_FLAG",
[1] = "SET_STRING",
[2] = "SET_BINARY",
[3] = "SET_PATH",
[4] = "SET_PATH_EMPTY",
[5] = "SET_FD",
[6] = "CMD_CREATE",
[7] = "CMD_RECONFIGURE",
};
$
Fixes: d35293004a5e4 ("perf beauty: Add generator for fsconfig's 'cmd' arg values")
Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: http://lore.kernel.org/lkml/20210414182723.1670663-1-vt@altlinux.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-14 09:50:38 +02:00
..
2021-04-28 13:40:02 +02:00
2021-01-19 18:27:19 +01:00
2021-05-14 09:50:29 +02:00
2021-01-30 13:55:19 +01:00
2021-05-07 11:04:31 +02:00
2021-01-27 11:55:20 +01:00
2020-07-06 10:46:23 +00:00
2020-08-22 10:53:12 +01:00
2021-04-21 13:00:57 +02:00
2020-09-21 07:50:58 -06:00
2021-04-16 11:43:20 +02:00
2021-05-14 09:50:30 +02:00
2020-09-04 11:58:15 -07:00
2021-03-30 14:31:53 +02:00
2021-05-14 09:50:38 +02:00
2021-05-14 09:50:05 +02:00
2021-01-30 13:55:19 +01:00
2020-06-11 16:27:24 +01:00
2021-05-14 09:50:30 +02:00
2020-08-19 14:11:44 +02:00
2020-08-11 14:34:17 -07:00
2020-09-04 12:46:06 +01:00
2020-07-13 10:42:02 -07:00