Alexandre Julliard : winapi_stats: Reimplement in perl, we don' t need a database for that.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Sep 11 14:46:36 CDT 2007


Module: tools
Branch: master
Commit: ca8e577b311fb1296d9dd491894dc4b8c497b3a0
URL:    http://source.winehq.org/git/tools.git/?a=commit;h=ca8e577b311fb1296d9dd491894dc4b8c497b3a0

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Sep 11 21:21:50 2007 +0200

winapi_stats: Reimplement in perl, we don't need a database for that.

---

 winapi_stats |   62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 wine_release |    7 ++---
 2 files changed, 65 insertions(+), 4 deletions(-)

diff --git a/winapi_stats b/winapi_stats
new file mode 100755
index 0000000..9f5e774
--- /dev/null
+++ b/winapi_stats
@@ -0,0 +1,62 @@
+#!/usr/bin/perl
+#
+# Filter to generate the winapi stats table using winapi_extract.
+# Must be run from the Wine top-level source directory.
+#
+
+my %stats;
+
+open STATS, "-|" or exec "./tools/winapi/winapi_extract", "--pseudo-stub-statistics", "--no-verbose", "--no-progress" or die "cannot run winapi_extract";
+while (<STATS>)
+{
+    chomp;
+    if (/\*\.c: (.*): (\d+) of (\d+) functions are stubs \((\d+) real, (\d+) pseudo\) and (\d+) are forwards/)
+    {
+        my ($dll, $stubs, $total, $real, $pseudo, $forwards) = ($1, $2, $3, $4, $5, $6);
+        next if $dll =~ /^(wine.*\.drv|wine.*\.acm|wined3d|winedos|wprocs)$/;
+        $stats{$dll} = [ $stubs, $total, $real, $pseudo, $forwards ];
+        ${$stats{" Total"}}[0] += $stubs;
+        ${$stats{" Total"}}[1] += $total;
+        ${$stats{" Total"}}[2] += $real;
+        ${$stats{" Total"}}[3] += $pseudo;
+        ${$stats{" Total"}}[4] += $forwards;
+    }
+}
+close STATS;
+
+my $bg = 0;
+
+print "<!--TITLE:[Win API Stats]-->\n\n";
+print "<h3>Win API Stats</h3>\n\n";
+print "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\">\n\n";
+print "<tr class=\"hdr\">\n";
+print "<th>Library</th>\n";
+print "<th>API count</th>\n";
+print "<th>% implemented</th>\n";
+print "<th>Total stubs</th>\n";
+print "<th>Real stubs</th>\n";
+print "<th>Pseudo stubs</th>\n";
+print "<th>Forwards</th>\n";
+print "</tr>\n";
+
+foreach my $dll (sort keys %stats)
+{
+    my ($stubs, $total, $real, $pseudo, $forwards) = @{$stats{$dll}};
+    my $color = $bg ? "white" : "grey";
+    my $pct = $total ? ($total - $stubs) / $total * 100 : 0;
+    printf "<tr>\n";
+    printf "<td class=\"%s\">%s</td>\n", $color, $dll;
+    printf "<td class=\"%s\">%u</td>\n", $color, $total;
+    printf "<td class=\"pct%u\">%u%%</td>\n", int(($pct + 2.5) / 5) * 5, $pct;
+    printf "<td class=\"%s\">%u</td>\n", $color, $stubs;
+    printf "<td class=\"%s\">%u</td>\n", $color, $real;
+    printf "<td class=\"%s\">%u</td>\n", $color, $pseudo;
+    printf "<td class=\"%s\">%u</td>\n", $color, $forwards;
+    printf "</tr>\n";
+    $bg = !$bg;
+}
+
+my $now = `date`;
+chomp $now;
+print "\n</table>\n</div>\n";
+print "<p>last modified: $now</p>\n";
diff --git a/wine_release b/wine_release
index c3d1f60..909ae14 100755
--- a/wine_release
+++ b/wine_release
@@ -17,6 +17,7 @@ oldver=$1
 version=$2
 
 templates_dir="/home/winehq/opt/lostwages/templates"
+tools_dir="/home/winehq/opt/git-tools"
 
 cd /home/winehq/opt/source
 
@@ -24,7 +25,7 @@ cd /home/winehq/opt/source
 rm -rf wine-$version
 
 git clone -l -s -n git/wine.git wine-$version
-(cd wine-$version && git checkout -b dummy wine-$version)
+(cd wine-$version && git checkout wine-$version)
 
 # move wine link
 rm -f wine
@@ -77,9 +78,7 @@ make htmlpages && rm -rf ../WineAPI && mv documentation/html ../WineAPI
 
 # Wine API Stats
 echo "==== UPDATING WINE API STATS PAGE ===="
-./tools/winapi/winapi_extract --pseudo-stub-statistics --no-verbose --no-progress > winapi_stats.txt
-../winapi_stats.php > $templates_dir/en/winapi_stats.template
-rm -f winapi_stats.txt
+$tools_dir/winapi_stats > winapi_stats.template && mv winapi_stats.template $templates_dir/en/winapi_stats.template
 
 # cleanup source tree
 git clean -q -d -x




More information about the wine-cvs mailing list