usr/src/tools/scripts/wsdiff.1
changeset 2538 b5894d78c55a
child 12899 5abbd90da85a
equal deleted inserted replaced
2537:0607d7a40022 2538:b5894d78c55a
       
     1 .\" ident	"%Z%%M%	%I%	%E% SMI"
       
     2 .\" " CDDL HEADER START
       
     3 .\" "
       
     4 .\" " The contents of this file are subject to the terms of the
       
     5 .\" " Common Development and Distribution License (the "License").
       
     6 .\" " You may not use this file except in compliance with the License.
       
     7 .\" "
       
     8 .\" " You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
       
     9 .\" " or http://www.opensolaris.org/os/licensing.
       
    10 .\" " See the License for the specific language governing permissions
       
    11 .\" " and limitations under the License.
       
    12 .\" "
       
    13 .\" " When distributing Covered Code, include this CDDL HEADER in each
       
    14 .\" " file and include the License file at usr/src/OPENSOLARIS.LICENSE.
       
    15 .\" " If applicable, add the following below this CDDL HEADER, with the
       
    16 .\" " fields enclosed by brackets "[]" replaced with your own identifying
       
    17 .\" " information: Portions Copyright [yyyy] [name of copyright owner]
       
    18 .\" "
       
    19 .\" " CDDL HEADER END
       
    20 .\" "
       
    21 .\" "Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
       
    22 .\" "Use is subject to license terms."
       
    23 .TH wsdiff 1 "07 Jul 2006"
       
    24 .I wsdiff
       
    25 \- report differences between proto area objects
       
    26 .SH SYNOPSIS
       
    27 \fBwsdiff [-vVt] [-r \fIresults\fP] [-i \fIfilelist\fP] \fIold\fP \fInew\fP
       
    28 .LP
       
    29 .SH DESCRIPTION
       
    30 .IX "OS-Net build tools" "wsdiff" "" "\fBwsdiff\fP"
       
    31 .LP
       
    32 The wsdiff utility detects and reports on object differences found between
       
    33 two proto areas constructed from the same workspace. This can be useful
       
    34 when trying to understand which objects have changed as a result of a particular
       
    35 source change.
       
    36 .LP
       
    37 \fIold\fP specifies the baseline proto area constructed without the source
       
    38 change. \fInew\fP specifies the proto area constructed with the source
       
    39 change. Both \fIold\fP and \fInew\fP should be constructed from the same
       
    40 workspace, otherwise wsdiff will find object differences not associated
       
    41 with the source change.
       
    42 .SH OPTIONS
       
    43 .TP 10
       
    44 .B -v
       
    45 Do not truncate the diffs logged to the results file. By default wsdiff
       
    46 will truncate the length of a sufficiently long set of object diffs to preserve
       
    47 the readability of the results file. -v can be used to override this behaviour.
       
    48 .TP 10
       
    49 .B -V
       
    50 Log observed differences for all ELF sections, rather than logging only the first
       
    51 difference found. When wsdiff encounters an ELF section difference, by default
       
    52 it will log the difference associated with that section only, and move on. -V forces
       
    53 wsdiff to log all ELF section differences found between two objects, rather than
       
    54 just the first. Because of the extra work involved, this may slow wsdiff down
       
    55 considerably.
       
    56 .TP 10
       
    57 .B -t
       
    58 Look for the onbld tools in $SRC/tools rather than /opt/onbld/bin
       
    59 .TP 10
       
    60 .B -r
       
    61 Log results to the specified log file. The log file contains a list of new, deleted,
       
    62 and changed objects, as well as diffs signifying what wsdiff found to be different.
       
    63 .TP 10
       
    64 .B -i
       
    65 Specify which objects should be compared by wsdiff via an input file list (See
       
    66 EXAMPLES).
       
    67 .LP
       
    68 .SH OUTPUT
       
    69 .LP
       
    70 The list of objects appearing to differ between \fIold\fP and \fInew\fP is
       
    71 printed to stdout. If -r was specified, the list of differing objects and
       
    72 their differrences are logged to \fIresults\fP.
       
    73 .LP
       
    74 .SH EXAMPLES
       
    75 .PP
       
    76 \fBExample 1: Using wsdiff to determine patch deliverables\fR
       
    77 .PP
       
    78 The following example shows how to use wsdiff to determine the set of objects
       
    79 requiring (re)delivery via patch as a result of a given source change:
       
    80 .LP
       
    81 Starting with a built workspace, move the existing proto area aside:
       
    82 .LP
       
    83 .nf
       
    84 user@example$ ls
       
    85 Codemgr_wsdata/  proto/           usr/
       
    86 
       
    87 user@example$ mv proto proto.old
       
    88 .fi
       
    89 .LP
       
    90 Next, integrate the source changes, rebuild, and invoke wsdiff specifying the
       
    91 old and new proto areas:
       
    92 .LP
       
    93 .nf
       
    94 user@example$ ls
       
    95 Codemgr_wsdata/  proto/           proto.old/      usr/
       
    96 
       
    97 user@example$ wsdiff proto.old proto
       
    98 platform/SUNW,SPARC-Enterprise/kernel/sparcv9/unix
       
    99 platform/SUNW,Sun-Fire-15000/kernel/sparcv9/unix
       
   100 platform/sun4v/kernel/sparcv9/unix
       
   101 platform/sun4u/kernel/sparcv9/unix
       
   102 platform/SUNW,Ultra-Enterprise-10000/kernel/sparcv9/unix
       
   103 platform/SUNW,Sun-Fire/kernel/sparcv9/unix
       
   104 .fi
       
   105 .PP
       
   106 \fBExample 2: The wsdiff results file\fR
       
   107 .PP
       
   108 With the -r option, wsdiff will log the list of objects that appear different, as well
       
   109 as a set of diffs highlighting the observed difference:
       
   110 .LP
       
   111 .nf
       
   112 user@example$ wsdiff -r results proto.old proto
       
   113 platform/SUNW,SPARC-Enterprise/kernel/sparcv9/unix
       
   114 platform/SUNW,Sun-Fire-15000/kernel/sparcv9/unix
       
   115 platform/sun4v/kernel/sparcv9/unix
       
   116 platform/sun4u/kernel/sparcv9/unix
       
   117 platform/SUNW,Ultra-Enterprise-10000/kernel/sparcv9/unix
       
   118 platform/SUNW,Sun-Fire/kernel/sparcv9/unix
       
   119 
       
   120 user@example$ cat results
       
   121 # This file was produced by wsdiff
       
   122 # 2006/7/10 at 18:28:56
       
   123 Base proto area: proto.old/
       
   124 Patch (new) proto area: proto/
       
   125 Results file: results
       
   126 
       
   127 platform/SUNW,SPARC-Enterprise/kernel/sparcv9/unix
       
   128 NOTE: ELF .text difference detected.
       
   129 
       
   130 89562,89567c89562,89567
       
   131 <     lgrp_cpu_init+0x158:    9e 10 20 01  mov       0x1, %o7
       
   132 <     lgrp_cpu_init+0x15c:    b3 2b d0 1c  sllx      %o7, %i4, %i1
       
   133 <     lgrp_cpu_init+0x160:    9a 12 40 19  or        %o1, %i1, %o5
       
   134 <     lgrp_cpu_init+0x164:    da 76 a0 30  stx       %o5, [%i2 + 0x30]
       
   135 <     lgrp_cpu_init+0x168:    d8 04 e0 00  ld        [%l3], %o4
       
   136 <     lgrp_cpu_init+0x16c:    80 a3 20 00  cmp       %o4, 0x0
       
   137 ---
       
   138 >     lgrp_cpu_init+0x158:    9a 10 20 01  mov       0x1, %o5
       
   139 >     lgrp_cpu_init+0x15c:    b3 2b 50 1c  sllx      %o5, %i4, %i1
       
   140 >     lgrp_cpu_init+0x160:    98 12 00 19  or        %o0, %i1, %o4
       
   141 >     lgrp_cpu_init+0x164:    d8 76 a0 30  stx       %o4, [%i2 + 0x30]
       
   142 >     lgrp_cpu_init+0x168:    d6 04 e0 00  ld        [%l3], %o3
       
   143 >     lgrp_cpu_init+0x16c:    80 a2 e0 00  cmp       %o3, 0x0
       
   144 
       
   145 ...
       
   146 
       
   147 .fi
       
   148 .PP
       
   149 \fBExample 3: Using an input file list\fR
       
   150 .PP
       
   151 The -i option tells wsdiff to compare a specific list of objects. This can be useful
       
   152 in conjunction with other options that direct wsdiff to log more verbosely, allowing
       
   153 one to "drill down" into a particular object's differences:
       
   154 .LP
       
   155 .nf
       
   156 user@example$ echo "usr/lib/mdb/kvm/sparcv9/genunix.so" > flist
       
   157 user@example$ wsdiff -vV -r results -i flist proto.old proto
       
   158 usr/lib/mdb/kvm/sparcv9/genunix.so
       
   159 
       
   160 user@example$ cat results
       
   161 <... verbose differences only for genunix.so ...>
       
   162 .fi
       
   163 .PP
       
   164 \fBExample 4: Invoking wsdiff through nightly(1)\fR
       
   165 .PP
       
   166 By specifying -w in NIGHTLY_OPTIONS, nightly(1) will use wsdiff(1) to determine
       
   167 which objects look different, compared to the previous build. A pre-existing proto area
       
   168 must exist for wsdiff(1) to compare against. nightly(1) will move aside the
       
   169 pre-existing proto area (renaming it to $ROOT.prev under proto), and will
       
   170 invoke wsdiff at the end of the build. The list of changed objects will be reported
       
   171 in the nightly mail message, and a results file "wsdiff_results" will appear in the
       
   172 nightly log area.
       
   173 .LP
       
   174 .SH SEE ALSO
       
   175 .LP
       
   176 .IR lintdump(1),
       
   177 .IR nightly(1),
       
   178 .IR elfdump(1),