Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / tools / perf / trace / beauty / vhost_virtio_ioctl.sh
blob76f1de6977870acf19cd533e518733e15d0c535f
1 #!/bin/sh
3 vhost_virtio_header_dir=$1
5 printf "static const char *vhost_virtio_ioctl_cmds[] = {\n"
6 regex='^#[[:space:]]*define[[:space:]]+VHOST_(\w+)[[:space:]]+_IOW?\([[:space:]]*VHOST_VIRTIO[[:space:]]*,[[:space:]]*(0x[[:xdigit:]]+).*'
7 egrep $regex ${vhost_virtio_header_dir}/vhost.h | \
8 sed -r "s/$regex/\2 \1/g" | \
9 sort | xargs printf "\t[%s] = \"%s\",\n"
10 printf "};\n"
12 printf "static const char *vhost_virtio_ioctl_read_cmds[] = {\n"
13 regex='^#[[:space:]]*define[[:space:]]+VHOST_(\w+)[[:space:]]+_IOW?R\([[:space:]]*VHOST_VIRTIO[[:space:]]*,[[:space:]]*(0x[[:xdigit:]]+).*'
14 egrep $regex ${vhost_virtio_header_dir}/vhost.h | \
15 sed -r "s/$regex/\2 \1/g" | \
16 sort | xargs printf "\t[%s] = \"%s\",\n"
17 printf "};\n"