]> git.cworth.org Git - apitrace/blobdiff - scripts/tracediff.sh
Cleanup/comment/format code.
[apitrace] / scripts / tracediff.sh
index 01f383403c7af1999e820d1bb15037522d8cc6a2..9f9633d2d4666f94e41411d427402279a59ca62d 100755 (executable)
 
 set -e
 
-TRACEDUMP=${TRACEDUMP:-`dirname "$0"`/tracedump}
+APITRACE=${APITRACE:-apitrace}
 
-$TRACEDUMP
+$APITRACE dump
 
 stripdump () {
-    # http://www.theeggeadventure.com/wikimedia/index.php/Linux_Tips#Use_sed_to_remove_ANSI_colors
-    $TRACEDUMP "$1" \
+    $APITRACE dump --color=never --no-arg-names "$1" \
     | sed \
-        -e 's/\x1b\[[0-9]\{1,2\}\(;[0-9]\{1,2\}\)\{0,2\}m//g' \
         -e 's/\r$//g' \
         -e 's/^[0-9]\+ //' \
         -e 's/hdc = \w\+/hdc/g' \
@@ -52,6 +50,10 @@ mkfifo "$FIFO2"
 stripdump "$1" "$FIFO1" &
 stripdump "$2" "$FIFO2" &
 
-sdiff --width=`tput cols` --speed-large-files "$FIFO1" "$FIFO2" | less -R
+sdiff \
+    --width=`tput cols` \
+    --speed-large-files \
+    "$FIFO1" "$FIFO2" \
+| less -R
 
 rm -rf "$FIFODIR"