drm/nouveau: consume the return of large GSP message
[drm/drm-misc.git] / tools / perf / trace / beauty / socket.sh
blob670c6db298ae029812a5eaa885cb986e7a1f56b2
1 #!/bin/sh
2 # SPDX-License-Identifier: LGPL-2.1
4 if [ $# -gt 0 ] ; then
5 uapi_header_dir=$1
6 beauty_header_dir=$2
7 else
8 uapi_header_dir=tools/include/uapi/linux/
9 beauty_header_dir=tools/perf/trace/beauty/include/linux/
12 printf "static const char *socket_ipproto[] = {\n"
13 ipproto_regex='^[[:space:]]+IPPROTO_(\w+)[[:space:]]+=[[:space:]]+([[:digit:]]+),.*'
15 grep -E $ipproto_regex ${uapi_header_dir}/in.h | \
16 sed -r "s/$ipproto_regex/\2 \1/g" | \
17 sort -n | xargs printf "\t[%s] = \"%s\",\n"
18 printf "};\n\n"
20 printf "static const char *socket_level[] = {\n"
21 socket_level_regex='^#define[[:space:]]+SOL_(\w+)[[:space:]]+([[:digit:]]+)([[:space:]]+/.*)?'
23 grep -E $socket_level_regex ${beauty_header_dir}/socket.h | \
24 sed -E "s%$socket_level_regex%\2 \1%g" | \
25 sort -n | xargs printf "\t[%s] = \"%s\",\n"
26 printf "};\n\n"
28 printf 'DEFINE_STRARRAY(socket_level, "SOL_");\n'