Vitaly Chikunov
5950c9d7f9
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:44:30 +02:00
..
2020-08-05 09:59:49 +02:00
2020-08-21 13:05:38 +02:00
2020-09-05 11:22:49 +02:00
2019-08-26 11:58:29 -03:00
2019-07-29 18:34:40 -03:00
2019-10-15 11:47:38 -03:00
2019-09-25 09:51:49 -03:00
2021-03-04 10:26:32 +01:00
2020-07-16 08:16:47 +02:00
2021-03-04 10:26:35 +01:00
2021-05-14 09:44:30 +02:00
2020-07-16 08:16:38 +02:00
2021-05-14 09:44:26 +02:00
2019-08-31 22:27:52 -03:00
2019-09-20 15:58:11 -03:00
2019-08-29 17:38:32 -03:00
2019-09-20 15:58:11 -03:00
2019-09-20 15:58:11 -03:00
2020-02-05 21:22:40 +00:00
2019-09-20 09:19:20 -03:00
2019-08-31 19:10:19 -03:00
2020-01-04 19:18:26 +01:00
2019-09-25 16:26:34 -03:00
2021-05-07 10:51:37 +02:00
2019-08-31 19:10:19 -03:00
2021-04-14 08:24:17 +02:00
2019-08-31 22:24:10 -03:00
2019-10-16 10:08:32 -03:00
2019-09-30 17:29:54 -03:00
2019-09-25 09:51:42 -03:00
2020-11-24 13:29:05 +01:00
2019-09-20 15:58:11 -03:00
2020-06-22 09:31:27 +02:00
2020-09-09 19:12:36 +02:00
2020-06-24 17:50:45 +02:00
2019-09-25 16:26:34 -03:00
2020-01-23 08:23:01 +01:00
2020-10-29 09:57:50 +01:00
2019-09-20 15:58:11 -03:00
2020-10-14 10:32:59 +02:00
2020-11-18 19:20:18 +01:00
2019-08-31 22:27:48 -03:00
2019-08-28 17:19:34 -03:00
2019-09-30 17:29:22 -03:00
2020-04-01 11:02:00 +02:00
2020-04-17 10:50:21 +02:00
2021-01-30 13:54:10 +01:00
2019-07-09 10:13:26 -03:00
2019-10-31 21:38:41 +01:00
2019-06-17 12:29:16 +02:00
2019-09-25 09:51:49 -03:00
2019-08-29 17:38:32 -03:00