rundiff (2783:381a5413b55a) rundiff (6115:7c6971582cd4)
1#! /usr/bin/env perl
2
3# Copyright (c) 2003 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 29 unchanged lines hidden (view full) ---

38# automatically fork a subprocess if the last character in the
39# "filename" is a pipe (|). Thus to compare the instruction traces
40# from two versions of m5 (m5a and m5b), you can do this:
41#
42# rundiff 'm5a --traceflags=InstExec |' 'm5b --traceflags=InstExec |'
43#
44
45use strict;
1#! /usr/bin/env perl
2
3# Copyright (c) 2003 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 29 unchanged lines hidden (view full) ---

38# automatically fork a subprocess if the last character in the
39# "filename" is a pipe (|). Thus to compare the instruction traces
40# from two versions of m5 (m5a and m5b), you can do this:
41#
42# rundiff 'm5a --traceflags=InstExec |' 'm5b --traceflags=InstExec |'
43#
44
45use strict;
46
46use FileHandle;
47use Getopt::Std;
48
49#
50# Options:
51# -c <n> : print n lines of context before & after changes
52# -l <n> : use n lines of lookahead
53# -x : use "complex" diff from Algorithm::Diff (see below)
54#

--- 105 unchanged lines hidden (view full) ---

160 # Print the differing lines.
161 printlines(\@lines1, $n1, '-');
162 printlines(\@lines2, $n2, '+');
163 $lineno1 += $n1;
164 $lineno2 += $n2;
165
166 # Set $postcontext to print the next $postcontext_lines matching lines.
167 $postcontext = $postcontext_lines;
47use Getopt::Std;
48
49#
50# Options:
51# -c <n> : print n lines of context before & after changes
52# -l <n> : use n lines of lookahead
53# -x : use "complex" diff from Algorithm::Diff (see below)
54#

--- 105 unchanged lines hidden (view full) ---

160 # Print the differing lines.
161 printlines(\@lines1, $n1, '-');
162 printlines(\@lines2, $n2, '+');
163 $lineno1 += $n1;
164 $lineno2 += $n2;
165
166 # Set $postcontext to print the next $postcontext_lines matching lines.
167 $postcontext = $postcontext_lines;
168
169 STDOUT->flush();
168}
169
170
171########################
172#
173# Complex diff algorithm
174#
175########################

--- 138 unchanged lines hidden ---
170}
171
172
173########################
174#
175# Complex diff algorithm
176#
177########################

--- 138 unchanged lines hidden ---