From 3c6b9a5df861c4ee5751bdc87aa87818a9721565 Mon Sep 17 00:00:00 2001 From: Michael Schwarz Date: Wed, 4 Jan 2023 13:52:07 +0100 Subject: [PATCH] Speedup script for fig13 --- .gitignore | 1 + esop23_fig13.rb | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index b88d5e47c..f8090988c 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ goblint juliet/C juliet/summary_table.html +esop23_fig13/* esop23_table2_set_our/* esop23_table2_set_goblint/* esop23_table2_set_watts/* diff --git a/esop23_fig13.rb b/esop23_fig13.rb index 3a0ea3ad6..16eb6e120 100755 --- a/esop23_fig13.rb +++ b/esop23_fig13.rb @@ -25,7 +25,7 @@ end end if highlighter.nil? then - puts "Warning: No syntax highlighter installed (code2html, source-highlight, pygmentize)." + # puts "Warning: No syntax highlighter installed (code2html, source-highlight, pygmentize)." highlighter = lambda {|f,o| "cp #{f} #{o}"} end @@ -78,7 +78,7 @@ def print_res (i) if $print_desc then f.puts "#NameDescriptionSize" else - f.puts "#Name" + f.puts "#NameLLocThread IDs (unique)" end $analyses.each do |a| aname = a[0] @@ -136,17 +136,17 @@ def print_res (i) # thenumbers = "#{safely}; " # thenumbers << "#{vulner} + " # thenumbers << "#{unsafe}; " - thenumbers = "" + # thenumbers = "" # thenumbers << "#{uncalled}; " if uncalled > 0 # thenumbers << "#{dead}+" # thenumbers << "#{live}=" if is_first then - thenumbers << "LLoC #{total}" - thenumbers << ";#TIDs (unique): #{threads} (#{uniques})" + f.puts "#{total}" + f.puts "#{threads} (#{uniques})" is_first = false end # thenumbers << ";M: #{mutexes} (#{max_protected};#{sum_protected};#{avg_protected})" - f.puts "#{"%.2f" % dur} s (#{thenumbers})" + f.puts "#{"%.2f" % dur} s" else f.puts "failed (code: #{cod.first.to_s})" end @@ -328,11 +328,14 @@ def proc_linux_res(resultfile, url, filename) `echo "EXITCODE #{status}" >> #{outfile}` end else - # Run again to get precision dump - cmd = "#{goblint} --conf #{goblint_conf} #{aparam} #{filename} #{p.params} --enable dbg.uncalled --enable allglobs --enable printstats --enable dbg.debug -v --enable dbg.print_dead_code --sets exp.apron.prec-dump #{precfile} 1>#{outfileprec} 2>&1" - system(cmd) + if aname == "oct" || aname == "tid" then + # Run again to get precision dump + cmd = "#{goblint} --conf #{goblint_conf} #{aparam} #{filename} #{p.params} --enable dbg.uncalled --enable allglobs --enable printstats --enable dbg.debug -v --enable dbg.print_dead_code --sets exp.apron.prec-dump #{precfile} 1>#{outfileprec} 2>&1" + system(cmd) + + precfiles << precfile + end puts "-- Done!" - precfiles << precfile end print_res p.id proc_linux_res(outfile, p.url, filename)