From 27594eeae6f40a402bc3110f06d57975168e74e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Thu, 4 Jun 2015 19:20:15 +0200 Subject: ics-openvpn as a submodule! beautiful ics-openvpn is now officially on GitHub, and they track openssl and openvpn as submodules, so it's easier to update everything. Just a git submodule update --recursive. I've also set up soft links to native modules from ics-openvpn in app, so that we don't copy files in Gradle (which was causing problems with the submodules .git* files, not being copied). That makes the repo cleaner. --- app/lzo/util/table.pl | 360 -------------------------------------------------- 1 file changed, 360 deletions(-) delete mode 100644 app/lzo/util/table.pl (limited to 'app/lzo/util/table.pl') diff --git a/app/lzo/util/table.pl b/app/lzo/util/table.pl deleted file mode 100644 index 8b352073..00000000 --- a/app/lzo/util/table.pl +++ /dev/null @@ -1,360 +0,0 @@ -#! /usr/bin/perl -## -## vi:ts=4:et -## -##---------------------------------------------------------------------------## -## -## Author: -## Markus F.X.J. Oberhumer -## -## Description: -## Convert the output of the LZO lzotest program into a nice table. -## -## Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer -## -##---------------------------------------------------------------------------## - -$PROG = $0; -require 'ctime.pl'; - -# -# get options -# - -while ($_ = $ARGV[ $[ ], /^-/) { - shift(@ARGV); - /^--$/ && ($opt_last = 1, last); - - /^--sort=name/ && ($opt_sort_summary_by_name++, next); - /^--sort=ratio/ && ($opt_sort_summary_by_ratio++, next); - /^-s/ && ($opt_summary_only++, next); - /^-t/ && ($opt_clear_time++, next); -} - - -$alg = ''; -$sep = "+" . ("-" x 76) . "+\n"; - -$block_size = -1; - -$n = 0; -@algs = (); -%average = (); -%total = (); - -$lzo_version_string = ''; -$lzo_version_date = ''; - - -# /*********************************************************************** -# // -# ************************************************************************/ - -while (<>) { - - if (/(^|\s)(\d+)\s+block\-size/i) { - if ($block_size < 0) { - $block_size = $2; - &intro($block_size); - } elsif ($block_size != $2) { - die "$PROG: block-size: $block_size != $2\n"; - } - next; - } - - if (/^\s*LZO\s.*library\s+\(v\s*([\w\.\s]+)\s*\,\s*([^\)]+)\)/) { - $lzo_version_string = $1; - $lzo_version_date = $2; - next; - } - - if (/^\s*(\S+(\s+\[\S+\])?)\s*(\|.*\|)\s*$/i) { - if ($1 ne $alg) { - &footer($1); - &header($1); - } - $line = $3; - &stats(*line); - print "$line\n" if (!$opt_summary_only); - } -} -&footer($1); - -&summary(); - -exit(0); - - -# /*********************************************************************** -# // -# ************************************************************************/ - -sub stats { - local (*l) = @_; - local ($x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8); - - if ($l !~ /^\|\s*(.+?)\s+(\d+)\s+(\d+)\s+(\d+)\s+([\d\.]+\s+)?([\d\.]+\s+)?([\d\.]+)\s+([\d\.]+)\s*\|/) { - die $_; - } - - $n++; - - $x1 = $1; $x2 = $2; $x3 = $3; $x4 = $4; - $x5 = ($x2 > 0) ? $x4 * 100.0 / $x2 : 0.0; - $x6 = ($x2 > 0) ? $x4 * 8.0 / $x2 : 0.0; - $x7 = $7; $x8 = $8; - - # convert from kB/s to MB/s (for old versions of lzotest) - if ($x7 =~ /\.\d\d$/) { $x7 = $x7 / 1000.0; } - if ($x8 =~ /\.\d\d$/) { $x8 = $x8 / 1000.0; } - - if ($opt_clear_time) { - $x7 = $x8 = 0.0; - } - - $s[0] += $x2; - $s[1] += $x3; - $s[2] += $x4; - $s[3] += $x5; - $s[4] += $x6; - if ($x7 > 0) { - $s[5] += 1.0 / $x7; $sn[5] += 1; - } - if ($x8 > 0) { - $s[6] += 1.0/ $x8; $sn[6] += 1; - } - - $x1 =~ s/\s+$//; - $l = sprintf("| %-14s %10d %5d %9d %6.1f %5.2f %9.3f %9.3f |", - $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8); -} - - -# /*********************************************************************** -# // -# ************************************************************************/ - -sub header { - local ($t) = @_; - - $alg = $t; - - # reset stats - $n = 0; - @s = (0, 0, 0, 0.0, 0.0, 0.0, 0.0); - @sn = (0, 0, 0, 0, 0, 0, 0); - - return if $opt_summary_only; - - print "\n$alg\n\n"; - print $sep; -print < 0 ? $sn[5] / $s[5] : 0.0; - $shm6 = $s[6] > 0 ? $sn[6] / $s[6] : 0.0; - - push(@algs,$alg); - - $average{$alg} = - sprintf("| %-14s %10d %5d %9d %6.1f %5.2f %9.3f %9.3f |\n", - "Average", $s[0]/$n, $s[1]/$n, $s[2]/$n, - $s[3]/$n, $s[4]/$n, - $shm5, $shm6); - - $total{$alg} = - sprintf("| %-14s %10d %5d %9d %6.1f %5.2f %9.3f %9.3f |\n", - "Total", $s[0], $s[1], $s[2], - $s[2]/$s[0]*100, $s[2]/$s[0]*8, - $shm5, $shm6); - - return if $opt_summary_only; - - print $sep; - print $average{$alg}; - print $total{$alg}; - print $sep, "\n"; -} - - -# /*********************************************************************** -# // -# ************************************************************************/ - -$sort_mode = 0; - -sub cmp_by_ratio { - local ($aa, $bb); - - if ($sort_mode == 0) { - $aa = $average{$a}; - $bb = $average{$b}; - } elsif ($sort_mode == 1) { - $aa = $total{$a}; - $bb = $total{$b}; - } else { - die; - } - - ($aa =~ m%^\s*\|\s+\S+\s+\d+\s+\d+\s+\d+\s+(\S+)%) || die; - $aa = $1; - ($bb =~ m%^\s*\|\s+\S+\s+\d+\s+\d+\s+\d+\s+(\S+)%) || die; - $bb = $1; - - # $aa < $bb; - $aa cmp $bb; -} - - -# /*********************************************************************** -# // -# ************************************************************************/ - -sub summary { - local ($l); - local (@k); - - $sort_mode = 0; - if ($opt_sort_summary_by_name) { - @k = sort(@algs); - } elsif ($opt_sort_summary_by_ratio) { - @k = sort(cmp_by_ratio @algs); - } else { - @k = @algs; - } - - print "\n\n"; - print "Summary of average values\n\n"; - print $sep; -print <