Skip to content

Commit

Permalink
perf beauty socket: Rename 'regex' to 'ipproto_regex'
Browse files Browse the repository at this point in the history
Paving the way for more regexps to be used here.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
acmel committed Nov 12, 2021
1 parent 1a1edf3 commit 82e3664
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/perf/trace/beauty/socket.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ else
fi

printf "static const char *socket_ipproto[] = {\n"
regex='^[[:space:]]+IPPROTO_(\w+)[[:space:]]+=[[:space:]]+([[:digit:]]+),.*'
ipproto_regex='^[[:space:]]+IPPROTO_(\w+)[[:space:]]+=[[:space:]]+([[:digit:]]+),.*'

egrep $regex ${uapi_header_dir}/in.h | \
sed -r "s/$regex/\2 \1/g" | \
egrep $ipproto_regex ${uapi_header_dir}/in.h | \
sed -r "s/$ipproto_regex/\2 \1/g" | \
sort | xargs printf "\t[%s] = \"%s\",\n"
printf "};\n"

0 comments on commit 82e3664

Please sign in to comment.