[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210414162942.1660600-1-vt@altlinux.org>
Date: Wed, 14 Apr 2021 19:29:42 +0300
From: Vitaly Chikunov <vt@...linux.org>
To: linux-kernel@...r.kernel.org,
Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: "Dmitry V. Levin" <ldv@...linux.org>,
Vitaly Chikunov <vt@...linux.org>
Subject: [PATCH] perf beauty: Fix fsconfig generator
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.
Fixes: d35293004a5e4 ("perf beauty: Add generator for fsconfig's 'cmd' arg values")
Co-authored-by: Dmitry V. Levin <ldv@...linux.org>
Signed-off-by: Vitaly Chikunov <vt@...linux.org>
---
tools/perf/trace/beauty/fsconfig.sh | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/tools/perf/trace/beauty/fsconfig.sh b/tools/perf/trace/beauty/fsconfig.sh
index 83fb24df05c9f..cc76b2aa7a5af 100755
--- a/tools/perf/trace/beauty/fsconfig.sh
+++ b/tools/perf/trace/beauty/fsconfig.sh
@@ -10,8 +10,6 @@ fi
linux_mount=${linux_header_dir}/mount.h
printf "static const char *fsconfig_cmds[] = {\n"
-regex='^[[:space:]]*+FSCONFIG_([[:alnum:]_]+)[[:space:]]*=[[:space:]]*([[:digit:]]+)[[:space:]]*,[[:space:]]*.*'
-egrep $regex ${linux_mount} | \
- sed -r "s/$regex/\2 \1/g" | \
- xargs printf "\t[%s] = \"%s\",\n"
+regex='^[[:space:]]*FSCONFIG_([[:alnum:]_]+)[[:space:]]*=[[:space:]]*([[:digit:]]+)[[:space:]]*,.*'
+sed -nr "s/$regex/\t[\2] = \"\1\",/p" ${linux_mount}
printf "};\n"
--
2.11.0
Powered by blists - more mailing lists