Skip to content

Instantly share code, notes, and snippets.

@laanwj
Created August 25, 2017 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laanwj/263ca4c61c4bbbd00cc7ff33f8a92d8d to your computer and use it in GitHub Desktop.
Save laanwj/263ca4c61c4bbbd00cc7ff33f8a92d8d to your computer and use it in GitHub Desktop.
a20x KGSL dump cmdbuf
#!/bin/bash
# enable command stream dumping, clear kernel ringbuffer,
# write output to a file provided on the command line
# this can be converted to .rd using dmesg2rd.py from
# https://github.com/laanwj/freedreno/blob/master/mlog/dmesg2rd.py
set -e
if [ "$(whoami)" != "root" ]; then
echo "This script needs to be executed as root"
exit 1
fi
function ctrl_c() {
echo "** Trapped CTRL-C, disabling command stream dump"
echo "0" > /sys/kernel/debug/kgsl/dumpcmdbufs
}
trap ctrl_c INT
echo "1" > /sys/kernel/debug/kgsl/dumpcmdbufs
dmesg -C
dmesg -w > "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment