SourceForge has been redesigned. Learn more.
Close

Diff of /nouveau-pm/run-trace.sh [d1bba6] .. [131335]  Maximize  Restore

Switch to side-by-side view

--- a/nouveau-pm/run-trace.sh
+++ b/nouveau-pm/run-trace.sh
@@ -6,49 +6,36 @@
 }
 
 if [ $UID -ne 0 ]; then
-	error "The script must be run as root"
+	error "Running as a non root user"
 fi
 
-# Check if the mmio is the current tracer
 TRACER=`cat /sys/kernel/debug/tracing/current_tracer`
 if test "x$TRACER" != xmmiotrace; then
 	error "mmiotrace is not the current tracer"
 fi
 
-# Check for required programs
-for i in "cat" "grep" "gawk" "sed" "perl" "lspci" "tar" "xz" "gzip" "git" "timeout"
+for i in "cat" "grep" "gawk" "sed" "perl" " lspci" "tar" "xz" "gzip"
 do
 	$i --version 1>/dev/null || error "$1 not found"
 done
 
+timeout --help 2>/dev/null
+if [ $? -ne 1 ]; then
+	error "timeout not found"
+fi
+
 TMPDIR=`mktemp -d nouveau-pm.XXXXXXXXXX` || error "Cannot create temporary directory"
 
 cat /sys/kernel/debug/tracing/trace_pipe > $TMPDIR/dump-downclock &
-sleep 10
 echo "Running glxgears" > /sys/kernel/debug/tracing/trace_marker
-timeout 10s glxgears 2>/dev/null
+timeout 5s glxgears
 echo "Stoping glxgears" > /sys/kernel/debug/tracing/trace_marker
+
 echo "Running the monitor_downclocking"
 ./monitor_downclocking 2> /sys/kernel/debug/tracing/trace_marker
-MONITOR_RETURN=$?
-case "$MONITOR_RETURN" in
-#	[1])
-#		error ""
-#		;;
-	[2])
-		error "The driver is not operating in Adaptive clock state"
-		;;
-	[3])
-		error "The PowerMizer mode is not Adaptive"
-		;;
-	[4])
-		error "Timeout while waiting for the driver to reach default 2D frequencies"
-		;;
-esac
 
 echo "Dumping done. Stopping tracer"
 sleep 1
-# XXX: check the following and print another ERROR message if does return an error
 echo nop > /sys/kernel/debug/tracing/current_tracer
 sleep 1
 kill -12 %1
@@ -75,11 +62,11 @@
 rm ./dev_pci_id
 
 # The PBAR0
-NV_PBAR0=0x`cat ./lspci | grep 'Region 0' | gawk '{print $5}'`
+NV_BASE_OFFSET=0x`cat ./lspci | grep 'Region 0' | gawk '{print $5}'`
 
 # Now lets get BOOT_0
-grep $NV_PBAR0 ./dump-downclock | gawk '{ATTRB=$1; offset=strtonum($5); \
-						if ((ATTRB == "R") && (offset=='$NV_PBAR0')) \
+grep $NV_BASE_OFFSET ./dump-downclock | gawk '{ATTRB=$1; offset=strtonum($5); \
+						if ((ATTRB == "R") && (offset=='$NV_BASE_OFFSET')) \
 								print $6;}' | head -n 1 > ./BOOT
 
 # Now to get the card generation/arch
@@ -100,14 +87,14 @@
 mv ./$TMPDIR/* ./$nouveau_pm_name/
 
 tar -cpzf $nouveau_pm_name.tar.gz ./$nouveau_pm_name/
+cd ..
 
 echo "Unmounting debugfs"
-# XXX: Another message to ignore if cannot me unmounted or send to /dev/null ?
 umount /sys/kernel/debug
 
 echo "Removing temporary directories"
-rm -rf $TMPDIR
-rm -rf $nouveau_pm_name
+rm -rf $TMPDIR/
+rm -rf $nouveau_pm_name/
 
 exit 0