[Swift-commit] r5618 - provenancedb
lgadelha at ci.uchicago.edu
lgadelha at ci.uchicago.edu
Wed Feb 15 07:34:47 CST 2012
Author: lgadelha
Date: 2012-02-15 07:34:46 -0600 (Wed, 15 Feb 2012)
New Revision: 5618
Modified:
provenancedb/build_script_run_provenance_graph.sh
provenancedb/list_script_runs.sh
Log:
Minor updates.
Modified: provenancedb/build_script_run_provenance_graph.sh
===================================================================
--- provenancedb/build_script_run_provenance_graph.sh 2012-02-14 22:04:22 UTC (rev 5617)
+++ provenancedb/build_script_run_provenance_graph.sh 2012-02-15 13:34:46 UTC (rev 5618)
@@ -14,21 +14,22 @@
query="select pgraph_edge.* from proc,pgraph_edge where (proc.id=pgraph_edge.parent or proc.id=pgraph_edge.child) and proc.run_id='$1';"
echo "digraph \"$1\" {" > $1.dot
-#$SQLCMD --tuples-only -c "$query" | sed -e '/^ *$/d' | awk '{print "\""$1"\"" " -> " "\""$3"\""}' >> $1.dot
+#$SQLCMD --tuples-only -c "$query" | sed -e '/^ *$/d' | sort | uniq | awk '{print "\""$1"\"" " -> " "\""$3"\""}' >> $1.dot
$SQLCMD --tuples-only -c "$query" | sed -e '/^ *$/d' > /tmp/$1.tmp
while read parent separator child; do
- isfc=$(echo $parent | grep ^execute)
+ isfc=$(echo "$parent" | grep ^execute)
if [ "X" == "X$isfc" ]; then
- variable=$parent
- functioncall=$child
+ variable="$parent"
+ functioncall="$child"
else
- variable=$child
- functioncall=$parent
+ variable="$child"
+ functioncall="$parent"
fi
-
+
variabletype=$($SQLCMD --tuples-only -c "select type from variable where id='$variable'" | awk '{print $1}')
-
+ functioncalllabel="$functioncall"
+ variablelabel="$variable"
if [ "$variabletype" == "mapped" ]; then
variablelabel="variable:mapped:"$($SQLCMD --tuples-only -c "select filename from variable where id='$variable'" | awk '{print $1}')
fi
@@ -38,13 +39,19 @@
if [ "$variabletype" == "composite" ]; then
variablelabel="variable:composite"
fi
+
- functioncalllabel="functioncall:"$($SQLCMD --tuples-only -c "select name from function_call where id='$functioncall'" | awk '{print $1}')
- echo "\"$variable\" [ label=\"$variablelabel\" ];" >> /tmp/$1.header.dot
- echo "\"$functioncall\" [ label=\"$functioncalllabel\"];" >> /tmp/$1.header.dot
- echo "\"$parent\" -> \"$child\";" >> /tmp/$1.body.dot
+ functioncalllabel="function_call:"$($SQLCMD --tuples-only -c "select name from function_call where id='$functioncall'" | awk '{print $1}')
+ parameter=$($SQLCMD --tuples-only -c "select parameter from ds_use where function_call_id='$functioncall' and variable_id='$variable';" | awk '{print $1}')
+
+ echo "\"$variable\" [ label=\"$variablelabel\", style=filled, fillcolor=lightcyan ];" >> /tmp/$1.header.dot
+ echo "\"$functioncall\" [ label=\"$functioncalllabel\", shape=box, style=filled, fillcolor=lightcyan ];" >> /tmp/$1.header.dot
+ echo "\"$parent\" -> \"$child\" [ label=\"$parameter\" ];" >> /tmp/$1.body.dot
+
done < /tmp/$1.tmp
cat /tmp/$1.header.dot | sort | uniq >> $1.dot
cat /tmp/$1.body.dot >> $1.dot
-echo "}" >> $1.dot
\ No newline at end of file
+rm /tmp/$1.header.dot /tmp/$1.body.dot
+echo "}" >> $1.dot
+dot -Tsvg -o $1.svg $1.dot
Modified: provenancedb/list_script_runs.sh
===================================================================
--- provenancedb/list_script_runs.sh 2012-02-14 22:04:22 UTC (rev 5617)
+++ provenancedb/list_script_runs.sh 2012-02-15 13:34:46 UTC (rev 5618)
@@ -11,6 +11,6 @@
source $PROVDIR/etc/provenance.config
export PATH=$PROVDIR:$PATH
-query="select * from script_run;"
+query="select * from script_run order by start_time;"
$SQLCMD -c "$query"
\ No newline at end of file
More information about the Swift-commit
mailing list