2 .\" This file and its contents are supplied under the terms of the
3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
4 .\" You may only use this file in accordance with the terms of version
7 .\" A full copy of the text of the CDDL should have accompanied this
8 .\" source. A copy of the CDDL is also available via the Internet at
9 .\" http://www.illumos.org/license/CDDL.
12 .\" Copyright (c) 2015, Joyent, Inc.
19 .Nd compare two CTF containers
32 utility identifies differences between the contents of the
40 can find differences between two
48 When no options are specified,
58 are considered the same, if they have the same name. Two
60 are considered the same if they have the same name and the type of the
61 object is the same. Two
63 are considered the same if they have the same, the same return type, the
64 same number of arguments, and the types of their arguments are the same.
68 are considered the same if they have the same, they represent the same
69 kind of thing, and the contents of the type are the same. This varies
70 for each specific kind, for example, two structs are the same if they
71 have the same members whose types, offsets, and names are all the same.
72 For more information on the specifics for what we look at for each kind
73 of type, and the kinds themselves, see the information we use to encode
75 .Xr ctf 4 . If the option
77 is specified, then the names of basic integer types are ignored. For an
78 example of where this makes sense, see
83 container found inside of either
87 has been uniquified (see
89 for more on uniquification), then the parent
91 container is also required for the diff to complete.
93 The following options are supported:
108 type argument information.
114 only consider the function
116 This option requires that the option
118 be specified and can be repeated multiple times.
122 Ignore the names of integral types. This option is useful when comparing
125 containers that have different programming models. In this case, when
126 comparing integers, the name of the type is not considered. This means
127 that the ILP32 type long which is a 32-bit wide signed integer is the
128 same as the LP64 type int which is a 32-bit wide signed integer, even
129 though they have different names.
141 Diff type information for
146 When diffing type information for
148 only compare if the object is name
149 .Em object . This option requires
151 to be specified and can be repeated multiple times.
155 Specifies the path of file that is the parent of the
161 This option is required if
163 has been uniquified. For more information on uniquification, see
168 Specifies the path of file that is the parent of the
173 This option is required if
175 has been uniquified. For more information on uniquification, see
180 Enables quiet mode. Standard output from the diff will not be emitted.
181 However, diagnostics messages will still be emitted to standard error.
187 information sections in the
195 section, only consider it if the type is name
197 Types specified here do not impact the diffing of
203 specified, other types will be diffed as necessary for the evaluation of
204 the named types; however, the results of those intermediate differences
205 will not impact the results of
207 only named types are considered when evaluating the exit status of
214 .Bd -filled -offset indent -compact
215 Execution completed successfully, no differences were detected
222 .Bd -filled -offset indent -compact
223 Execution completed successfully, but differences were detected
230 .D1 Invalid command line options were specified.
232 .D1 A fatal error occured.
240 The following example compares two
242 containers using the default set
248 .Bd -literal -offset 6n
249 $ ctfdiff /usr/lib/libc.so.1 /usr/lib/libdtrace.so.1
250 ctf container /usr/lib/libc.so.1 type 37 is different
251 ctf container /usr/lib/libc.so.1 type 38 is different
252 ctf container /usr/lib/libc.so.1 type 39 is different
253 ctf container /usr/lib/libc.so.1 type 40 is different
254 ctf container /usr/lib/libc.so.1 type 41 is different
255 ctf container /usr/lib/libc.so.1 type 42 is different
256 ctf container /usr/lib/libc.so.1 type 43 is different
257 ctf container /usr/lib/libc.so.1 type 47 is different
258 ctf container /usr/lib/libc.so.1 type 48 is different
259 ctf container /usr/lib/libc.so.1 type 49 is different
263 Diffing Types Between Two
265 Containers with Parents
267 The following example compares two
270 .Sy /ws/rm/zlan/proto/kernel/drv/amd64/vnd
272 .Sy /ws/rm/zlan/proto/kernel/drv/amd64/overlay
273 that have been uniquified against the same container
274 .Sy /ws/rm/zlan/proto/kernel/amd64/genunix .
275 .Bd -literal -offset 6n
276 $ ctfdiff -t -p /ws/rm/zlan/proto/kernel/amd64/genunix \\
277 -P /ws/rm/zlan/proto/kernel/amd64/genunix \\
278 /ws/rm/zlan/proto/kernel/drv/amd64/vnd \\
279 /ws/rm/zlan/proto/kernel/drv/amd64/overlay
280 ctf container /ws/rm/zlan/proto/kernel/drv/amd64/vnd type 32769 is different
281 ctf container /ws/rm/zlan/proto/kernel/drv/amd64/vnd type 32770 is different
282 ctf container /ws/rm/zlan/proto/kernel/drv/amd64/vnd type 32771 is different
283 ctf container /ws/rm/zlan/proto/kernel/drv/amd64/vnd type 32772 is different
284 ctf container /ws/rm/zlan/proto/kernel/drv/amd64/vnd type 32774 is different
285 ctf container /ws/rm/zlan/proto/kernel/drv/amd64/vnd type 32775 is different
286 ctf container /ws/rm/zlan/proto/kernel/drv/amd64/vnd type 32776 is different
287 ctf container /ws/rm/zlan/proto/kernel/drv/amd64/vnd type 32777 is different
288 ctf container /ws/rm/zlan/proto/kernel/drv/amd64/vnd type 32778 is different
289 ctf container /ws/rm/zlan/proto/kernel/drv/amd64/vnd type 32779 is different
294 Diffing a Specific Function in Two
298 This example shows us looking for differences in the function
300 in two different version of the library
301 .Sy libzfs_core.so.1 .
302 .Bd -literal -offset 6n
303 $ ctfdiff -f -F libzfs_core_init /usr/lib/libzfs_core.so.1 \\
304 /ws/rm/ctf/proto/usr/lib/libzfs_core.so.1
309 Diffing Types to Find Differences Between Different Data Models.
311 This example looks for differences between structures used in an ioctl
312 that the kernel wants to be bitness neutral by comparing a 32-bit and
313 64-bit library that consumes it. In this example, we'll use the library
316 .Sy vnd_ioc_attach_t ,
318 .Sy vnd_ioc_unlink_t ,
322 .Bd -literal -offset 6n
323 $ ctfdiff -t -I -T vnd_ioc_attach_t -T vnd_ioc_link_t \\
324 -T vnd_ioc_unlink_t -T vnd_ioc_buf_t -T vnd_ioc_info_t \\
325 i386/libvnd.so.1 amd64/libvnd.so.1
329 .Sh INTERFACE STABILITY
330 The command syntax is