perf trace beauty: Fix generation of errno id->str table on ALT Linux

For some reason using:

         cat <<EoFuncBegin
  static const char *errno_to_name__$arch(int err)
  {
         switch (err) {
  EoFuncBegin

In tools/perf/trace/beauty/arch_errno_names.sh isn't working on ALT
Linux sisyphus (development version), which could be some distro
specific glitch, so just get this done in an alternative way that works
everywhere while giving notice to the people working on that distro to
try and figure our what really took place.

Cc: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent ab66fdac
...@@ -33,23 +33,13 @@ create_errno_lookup_func() ...@@ -33,23 +33,13 @@ create_errno_lookup_func()
local arch=$(arch_string "$1") local arch=$(arch_string "$1")
local nr name local nr name
cat <<EoFuncBegin printf "static const char *errno_to_name__%s(int err)\n{\n\tswitch (err) {\n" $arch
static const char *errno_to_name__$arch(int err)
{
switch (err) {
EoFuncBegin
while read name nr; do while read name nr; do
printf '\tcase %d: return "%s";\n' $nr $name printf '\tcase %d: return "%s";\n' $nr $name
done done
cat <<EoFuncEnd printf '\tdefault: return "(unknown)";\n\t}\n}\n'
default:
return "(unknown)";
}
}
EoFuncEnd
} }
process_arch() process_arch()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment