Skip to contentSkip to conversation

tools: intel_gpu_abrt "get" function

PATCH In review Rodrigo Vivi 2 participants 5 messages Dec 13, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 tools: intel_gpu_abrt "get" function

A function to make it easy to collect any file or directory needed later.

---
 tools/intel_gpu_abrt | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)
tools/intel_gpu_abrt +14 -6
index 141a524..b243a5f 100755
@@ -1,5 +1,13 @@
 #!/bin/sh
 
+get(){
+    if [ ! -e $tardir/${@:$#} ] ; then
+	mkdir -p $tardir/${@:$#}
+    fi
+    if [ -e $1 ] ; then
+	cp -a ${@:1:$#-1} $tardir/${@:$#} 2>/dev/null
+    fi
+}
 if [ -d /debug/dri ] ; then
 	debugfs_path=/debug_dri
 fi
@@ -25,15 +33,15 @@ tmpdir=`mktemp -d`
 tardir=$tmpdir/intel_gpu_abrt
 mkdir $tardir
 
-mkdir $tardir/debugfs
-cp $i915_debugfs/* $tardir/debugfs
+get $i915_debugfs/* debugfs
 
-mkdir $tardir/mod_opts
-cp /sys/module/i915/parameters/* $tardir/mod_opts
+get /sys/module/i915/parameters/* mod_opts
 
 mkdir $tardir/X
-cp /var/log/Xorg.*.log $tardir/X
-cp /etc/X11/xorg.conf $tardir/X
+get /var/log/Xorg.0.log X
+get /var/log/Xorg.0.log.old X
+get /etc/X11/xorg.conf X
+get /etc/X11/xorg.conf.d/ X
 
 dmesg > $tardir/dmesg
 lspci -nn > $tardir/lspci
Signature · 1 line
1.7.11.7
#1 lore raw

PATCH 2/4 tools: intel_gpu_abrt collecting more useful info

---
 tools/intel_gpu_abrt | 12 ++++++++++++
 1 file changed, 12 insertions(+)
tools/intel_gpu_abrt +12 -0
index b243a5f..fe3684d 100755
@@ -8,6 +8,9 @@ get(){
 	cp -a ${@:1:$#-1} $tardir/${@:$#} 2>/dev/null
     fi
 }
+
+igtdir=`dirname $0`
+
 if [ -d /debug/dri ] ; then
 	debugfs_path=/debug_dri
 fi
@@ -38,6 +41,7 @@ get $i915_debugfs/* debugfs
 get /sys/module/i915/parameters/* mod_opts
 
 mkdir $tardir/X
+xrandr --verbose > $tardir/X/xrandr
 get /var/log/Xorg.0.log X
 get /var/log/Xorg.0.log.old X
 get /etc/X11/xorg.conf X
@@ -46,6 +50,14 @@ get /etc/X11/xorg.conf.d/ X
 dmesg > $tardir/dmesg
 lspci -nn > $tardir/lspci
 
+$igtdir/intel_reg_dumper > $tardir/intel_reg_dumper.txt
+$igtdir/intel_bios_dumper $tardir/intel_bios_dump
+$igtdir/intel_stepping > $tardir/intel_stepping
+
+echo 1 > /sys/devices/pci0000:00/0000:00:02.0/rom
+cat /sys/devices/pci0000:00/0000:00:02.0/rom > $tardir/vbios.dump
+echo 0 > /sys/devices/pci0000:00/0000:00:02.0/rom
+
 (cd $tmpdir; tar -c intel_gpu_abrt ) > intel_gpu_abrt.tar
 
 rm $tmpdir -Rf
Signature · 1 line
1.7.11.7
#2 lore raw

PATCH 3/4 tools: intel_gpu_abrt checking for root access

In reply to Rodrigo Vivi

needed by other igt tools that are collecting more usefull information.

---
 tools/intel_gpu_abrt | 5 +++++
 1 file changed, 5 insertions(+)
tools/intel_gpu_abrt +5 -0
index fe3684d..9ca58c0 100755
@@ -1,5 +1,10 @@
 #!/bin/sh
 
+if [[ $UID -ne 0 ]]; then
+    echo "$0 must be run as root"
+    exit 1
+fi
+
 get(){
     if [ ! -e $tardir/${@:$#} ] ; then
 	mkdir -p $tardir/${@:$#}
Signature · 1 line
1.7.11.7
#3 lore raw

PATCH 4/4 tools: intel_gpu_abrt bug report template.

In reply to Rodrigo Vivi

checking if file has been generated and output a template for a good bug report

---
 tools/intel_gpu_abrt | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
tools/intel_gpu_abrt +32 -0
index 9ca58c0..4fbff76 100755
@@ -67,4 +67,36 @@ echo 0 > /sys/devices/pci0000:00/0000:00:02.0/rom
 
 rm $tmpdir -Rf
 
+if [ -f intel_gpu_abrt.tar ] ; then
+	cat <<EOF
+intel_gpu_abrt.tar has been created.
+
+Please attach it to https://bugs.freedesktop.org
+with a good bug description as suggested in this template:
+
+System environment:
+-- chipset:
+-- system architecture: `uname -m`
+-- xf86-video-intel:
+-- xserver: `grep "X.Org X Server" /var/log/Xorg.0.log | awk '{print $NF}'`
+-- mesa:
+-- libdrm: `pkg-config --modversion libdrm`
+-- kernel: `uname -r`
+-- Linux distribution:
+-- Machine or mobo model:
+-- Display connector:
+
+Reproducing steps:
+
+Additional info:
+
+EOF
 exit 0
+else
+cat <<EOF
+Error on tarball generation.
+For bug report, please follow manual instructions available at:
+https://01.org/linuxgraphics/documentation/how-report-bugs-0
+EOF
+exit 1
+fi
Signature · 1 line
1.7.11.7
#4 lore raw

Re: [PATCH 4/4] tools: intel_gpu_abrt bug report template.

Quoted 1 line · Rodrigo Vivi

checking if file has been generated and output a template for a good bug report

Slurped in all patches, thanks.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch