Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[cris-mirror.git] / tools / perf / trace / beauty / drm_ioctl.sh
blob2149d3a98e425607c5d95888cc65a291a5c95c17
1 #!/bin/sh
3 drm_header_dir=$1
4 printf "#ifndef DRM_COMMAND_BASE\n"
5 grep "#define DRM_COMMAND_BASE" $drm_header_dir/drm.h
6 printf "#endif\n"
8 printf "static const char *drm_ioctl_cmds[] = {\n"
9 grep "^#define DRM_IOCTL.*DRM_IO" $drm_header_dir/drm.h | \
10 sed -r 's/^#define +DRM_IOCTL_([A-Z0-9_]+)[ ]+DRM_IO[A-Z]* *\( *(0x[[:xdigit:]]+),*.*/ [\2] = "\1",/g'
11 grep "^#define DRM_I915_[A-Z_0-9]\+[ ]\+0x" $drm_header_dir/i915_drm.h | \
12 sed -r 's/^#define +DRM_I915_([A-Z0-9_]+)[ ]+(0x[[:xdigit:]]+)/\t[DRM_COMMAND_BASE + \2] = "I915_\1",/g'
13 printf "};\n"