WineTest log size

Francois Gouget fgouget at free.fr
Fri May 8 10:47:18 CDT 2015


TL;DR: The todo below generates more than 90 KB of test report data. It 
       would be really nice to fix it.
storage32.c:3401: todo_wine ok(failed == expect_failed, "open with byte %x locked, mode %x %s but should %s\n",


Some of my WineTest reports went over the 1.5MB limit again and while 
the issue was not what I initially thought, I wrote a script (see 
attachment) to slice and dice them to figure out who contributes what.

Lines   Bytes  Category
 1530  114848  9 traces generating >= 5120 bytes each
 1842  106511  33 traces generating 2048 - 5119 bytes each
 7020  358649  2221 traces generating < 2048 bytes each

 2071  180266  9 todos generating >= 5120 bytes each
  842   67746  20 todos generating 2048 - 5119 bytes each
 4622  329705  2894 todos generating < 2048 bytes each

  170   15372  Test failed
 2787  144801  Others
--------------------
20884 1317898  Total

Traces are easy to deal with so I've sent some patches. We'll see how it 
goes.

The todos are much harder as they require fixing Wine. Still, if we 
manage to fix the top 9 we'll save around 180 KB. The next 66 KB require 
fixing 20 more todos, which is still somewhat plausible, but it gets 
hopeless after that.

The 'Others' category corresponds to the report header with the 
dlls list, and to the per test summaries.

So we're looking at minimum report size of 813 KB, but in practice we're 
unlikely to get below 1 MB.


Here are the top 20 traces and todos:

$ dupcount --traces *.report | head -n 20
Lines  Chars  Match
  296  31777  font.c:3711:      # Patch pending
  339  20378  protocol.c:765:   # Patch pending
  143  14471  ddrawmodes.c:369: # Patch pending
  171   9576  loader.c:1414:    # Patch pending
  226   9121  clipboard.c:154:  # Patch pending
   90   9050  ddrawmodes.c:340: # Patch pending
  105   7875  istream.c:486:    # Patch pending
   82   7444  win.c:82:
   78   5156  button.c:588:
   85   5015  shlview.c:59:
  145   4785  locale.c:3296:    # Patch pending
  131   4716  protocol.c:583:   # Patch pending
   54   4539  http.c:428:
   56   4300  metafile.c:1736:
   75   4050  locale.c:3215:    # Patch pending
  145   3936  locale.c:3190:    # Patch pending
   57   3846  msg.c:11475:
   98   3626  clipboard.c:132:  # Patch pending
   48   3574  metafile.c:504:

$ dupcount -e '^[^:]*:[0-9]*: Test marked todo*:' *.report | head -n 20
Lines  Chars  Match
  902  93357  storage32.c:3401: Test marked todo:
  296  21312  sock.c:2741: Test marked todo:
  256  18176  virtual.c:3350: Test marked todo:
  256  14592  ebrowser.c:1742: Test marked todo:
  110   8405  shlexec.c:1472: Test marked todo:
   22   6530  shlexec.c:1462: Test marked todo:
   74   6395  font.c:3789: Test marked todo:
   92   6074  propvariant.c:169: Test marked todo:
   63   5425  font.c:3781: Test marked todo:
   63   4788  file.c:4209: Test marked todo:
   63   4714  file.c:4207: Test marked todo:
   29   4569  dib.c:1322: Test marked todo:
   64   4504  graphics.c:3686: Test marked todo:
   64   4432  graphics.c:3657: Test marked todo:
   64   4432  graphics.c:3674: Test marked todo:
   54   4042  saxreader.c:2393: Test marked todo:
   42   3982  qcap.c:337: Test marked todo:
   38   3834  saxreader.c:2489: Test marked todo:
   25   3764  batch.c:312: Test marked todo:


-- 
Francois Gouget <fgouget at free.fr>              http://fgouget.free.fr/
    Indifference will certainly be the downfall of mankind, but who cares?
-------------- next part --------------
#!/usr/bin/perl
# Copyright (C) 2015 Francois Gouget
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
use strict;
use warnings;

my $name0=$0;
$name0 =~ s%^.*/%%;

sub error(@)
{
    print STDERR "$name0:error: ", @_;
}


my ($opt_regexp, $opt_lines, $opt_chars, $opt_traces, $opt_min, $opt_max, $opt_help);
use Getopt::Long;
Getopt::Long::Configure ("no_ignore_case");
my $rc = GetOptions("l"       => \$opt_lines,
                    "c"       => \$opt_chars,
                    "traces!" => \$opt_traces,
                    "m=i"     => \$opt_min,
                    "M=i"     => \$opt_max,
                    "e=s"     => \$opt_regexp,
                    "help"    => \$opt_help,
    );
if ($opt_help)
{
    print "Usage: $name0 [-e REGEXP] [-m MIN] [-M MAX] [-c|-l] [--traces] [--help] FILE...\n";
    print "\n";
    print "Looks for lines matching the regular expression and for each match reports the number of corresponding lines or characters. By default looks for lines starting with '<filename>:<line>:'.\n";
    print "\n";
    print "Options:\n";
    print "  -l                Sort matches by lines matched.\n";
    print "  -c                Sort matches by characters in the lines matched. This is the default.\n";
    print "  --traces          Traces only, not test results (for WineTest logs). The default is both.\n";
    print "  --no-traces       Test results only, not traces (for WineTest logs).\n";
    print "  -m MIN            Only reports on matches with MIN or more lines or characters.\n";
    print "  -M MAX            Only reports on matches less than MAX lines or characters.\n";
    print "  -e REGEXP         Specifies which part of the line to match.\n";
    print "  --help            Prints this help message\n";
    exit 0;
}
if ($rc)
{
    if (defined $opt_regexp and defined $opt_traces)
    {
        error("-e, --traces and --no-traces are mutually exclusive\n");
        $rc = 0;
    }
    else
    {
        $opt_regexp ||= $opt_traces ? "^[^:]*:[0-9]*:(?! Test [a-z ]*:)" :
                        defined $opt_traces ? "^[^:]*:[0-9]*: Test [a-z ]*:" :
                                      "^[^:]*:[0-9]*:( Test [a-z ]*:)?";
    }
    if ($opt_lines and $opt_chars)
    {
        error("-l and -c are mutually exclusive\n");
        $rc = 0;
    }
    elsif (!$opt_lines)
    {
        $opt_chars = 1;
    }
    if (!@ARGV)
    {
        error("you must specify one or more files to analyze\n");
        $rc = 0;
    }
}
if (!$rc)
{
    error("try running $name0 --help\n");
    exit 2;
}

my %lines;
my %chars;
foreach my $filename (@ARGV)
{
    if (open(my $fh, "<", $filename))
    {
        while (my $line=<$fh>)
        {
            if ($line =~ /($opt_regexp)/)
            {
                $lines{$1}++;
                $chars{$1} += length($line);
            }
        }
        close($fh);
    }
    else
    {
        error("could not open '$filename' for reading: $!\n");
        exit 1;
    }
}

sub compare_matches()
{
    return $opt_lines ? $lines{$b} <=> $lines{$a} :
                        $chars{$b} <=> $chars{$a};
}

print "Lines  Chars  Match\n";
my $matches = 0;
my $total_lines = 0;
my $total_chars = 0;
foreach my $match (sort compare_matches keys %lines)
{
    if (defined $opt_min)
    {
        next if ($opt_lines and $lines{$match} < $opt_min);
        next if ($opt_chars and $chars{$match} < $opt_min);
    }
    if (defined $opt_max)
    {
        next if ($opt_lines and $lines{$match} >= $opt_max);
        next if ($opt_chars and $chars{$match} >= $opt_max);
    }

    $matches++;
    $total_lines += $lines{$match};
    $total_chars += $chars{$match};
    printf "%5d %6d  %s\n", $lines{$match}, $chars{$match}, $match;
}
print "$matches matches for a total of $total_lines lines and $total_chars characters\n";

exit 0;


More information about the wine-devel mailing list