xref: /aosp_15_r20/external/stg/doc/stgdiff.md (revision 9e3b08ae94a55201065475453d799e8b1378bea6)
1*9e3b08aeSAndroid Build Coastguard Worker# `stgdiff`
2*9e3b08aeSAndroid Build Coastguard Worker
3*9e3b08aeSAndroid Build Coastguard Worker`stgdiff` is used to compare ABI representations from various sources, like
4*9e3b08aeSAndroid Build Coastguard Workerlibabigail XML, BTF and ELF/DWARF.
5*9e3b08aeSAndroid Build Coastguard Worker
6*9e3b08aeSAndroid Build Coastguard Worker## Usage
7*9e3b08aeSAndroid Build Coastguard Worker
8*9e3b08aeSAndroid Build Coastguard Worker```
9*9e3b08aeSAndroid Build Coastguard Workerstgdiff
10*9e3b08aeSAndroid Build Coastguard Worker  [-m|--metrics]
11*9e3b08aeSAndroid Build Coastguard Worker  [-a|--abi|-b|--btf|-e|--elf|-s|--stg] file1
12*9e3b08aeSAndroid Build Coastguard Worker  [-a|--abi|-b|--btf|-e|--elf|-s|--stg] file2
13*9e3b08aeSAndroid Build Coastguard Worker  [-x|--exact]
14*9e3b08aeSAndroid Build Coastguard Worker  [-t|--types]
15*9e3b08aeSAndroid Build Coastguard Worker  [{-i|--ignore} <ignore-option>] ...
16*9e3b08aeSAndroid Build Coastguard Worker  [{-f|--format} <output-format>] ...
17*9e3b08aeSAndroid Build Coastguard Worker  [{-o|--output} {filename|-}] ...
18*9e3b08aeSAndroid Build Coastguard Worker  [{-F|--fidelity} {filename|-}]
19*9e3b08aeSAndroid Build Coastguard Workerimplicit defaults: --abi --format small
20*9e3b08aeSAndroid Build Coastguard Worker--exact (node equality) cannot be combined with --output
21*9e3b08aeSAndroid Build Coastguard Workeroutput formats: plain flat small short viz
22*9e3b08aeSAndroid Build Coastguard Workerignore options: type_declaration_status symbol_type_presence primitive_type_encoding member_size enum_underlying_type qualifier linux_symbol_crc interface_addition type_definition_addition
23*9e3b08aeSAndroid Build Coastguard Worker```
24*9e3b08aeSAndroid Build Coastguard Worker
25*9e3b08aeSAndroid Build Coastguard Worker## Input
26*9e3b08aeSAndroid Build Coastguard Worker
27*9e3b08aeSAndroid Build Coastguard Worker### Formats
28*9e3b08aeSAndroid Build Coastguard Worker
29*9e3b08aeSAndroid Build Coastguard Worker*   `-a|--abi`
30*9e3b08aeSAndroid Build Coastguard Worker
31*9e3b08aeSAndroid Build Coastguard Worker    Read ABI XML representation generated by libabigail's `abidw`. Not all ABI
32*9e3b08aeSAndroid Build Coastguard Worker    XML features are consumed. Some XML "tidying" is performed before parsing:
33*9e3b08aeSAndroid Build Coastguard Worker
34*9e3b08aeSAndroid Build Coastguard Worker    *   types with naming typedefs are re-anonymised
35*9e3b08aeSAndroid Build Coastguard Worker    *   (rare) duplicate data members are removed
36*9e3b08aeSAndroid Build Coastguard Worker    *   (partial and entire) duplicate type definitions are removed
37*9e3b08aeSAndroid Build Coastguard Worker
38*9e3b08aeSAndroid Build Coastguard Worker    After parsing, function parameter and return type qualifiers are removed.
39*9e3b08aeSAndroid Build Coastguard Worker
40*9e3b08aeSAndroid Build Coastguard Worker*   `-b|--btf`
41*9e3b08aeSAndroid Build Coastguard Worker
42*9e3b08aeSAndroid Build Coastguard Worker    Read ABI information from the `.BTF` ELF section. BTF only covers the C type
43*9e3b08aeSAndroid Build Coastguard Worker    system and can be obtained in the following ways:
44*9e3b08aeSAndroid Build Coastguard Worker
45*9e3b08aeSAndroid Build Coastguard Worker    *   `gcc -gbtf` generates BTF instead of DWARF
46*9e3b08aeSAndroid Build Coastguard Worker    *   `clang -c -g -target bpf` works similarly, but only for BPF targets
47*9e3b08aeSAndroid Build Coastguard Worker    *   `pahole -J` reads existing DWARF debug information and adds BTF
48*9e3b08aeSAndroid Build Coastguard Worker
49*9e3b08aeSAndroid Build Coastguard Worker*   `-e|--elf`
50*9e3b08aeSAndroid Build Coastguard Worker
51*9e3b08aeSAndroid Build Coastguard Worker    Read ABI information from ELF symbols and DWARF types.
52*9e3b08aeSAndroid Build Coastguard Worker
53*9e3b08aeSAndroid Build Coastguard Worker*   `-s|--stg`
54*9e3b08aeSAndroid Build Coastguard Worker
55*9e3b08aeSAndroid Build Coastguard Worker    Read ABI information from a `.stg` file.
56*9e3b08aeSAndroid Build Coastguard Worker
57*9e3b08aeSAndroid Build Coastguard Worker### Options
58*9e3b08aeSAndroid Build Coastguard Worker
59*9e3b08aeSAndroid Build Coastguard Worker*   `--types`
60*9e3b08aeSAndroid Build Coastguard Worker
61*9e3b08aeSAndroid Build Coastguard Worker    Captures all named types found in ELF files as interface types, regardless
62*9e3b08aeSAndroid Build Coastguard Worker    of whether those types are reachable by any symbol.
63*9e3b08aeSAndroid Build Coastguard Worker
64*9e3b08aeSAndroid Build Coastguard Worker## Comparison
65*9e3b08aeSAndroid Build Coastguard Worker
66*9e3b08aeSAndroid Build Coastguard WorkerThe default behaviour is to compare two ABIs for equivalence.
67*9e3b08aeSAndroid Build Coastguard Worker
68*9e3b08aeSAndroid Build Coastguard Worker### Options
69*9e3b08aeSAndroid Build Coastguard Worker
70*9e3b08aeSAndroid Build Coastguard Worker*   `-i|--ignore`
71*9e3b08aeSAndroid Build Coastguard Worker
72*9e3b08aeSAndroid Build Coastguard WorkerThe following two ignore options suppress noisy diffs that are inevitable when
73*9e3b08aeSAndroid Build Coastguard Workerconsuming ABI XML output from `abidw`.
74*9e3b08aeSAndroid Build Coastguard Worker
75*9e3b08aeSAndroid Build Coastguard Worker*   `symbol_type_presence`
76*9e3b08aeSAndroid Build Coastguard Worker
77*9e3b08aeSAndroid Build Coastguard Worker    Ignore changes in symbol type presence, thus `stgdiff` does not report loss
78*9e3b08aeSAndroid Build Coastguard Worker    or gain of symbol type information.
79*9e3b08aeSAndroid Build Coastguard Worker
80*9e3b08aeSAndroid Build Coastguard Worker*   `type_declaration_status`
81*9e3b08aeSAndroid Build Coastguard Worker
82*9e3b08aeSAndroid Build Coastguard Worker    Ignore changes in type declaration status, thus `stgdiff` does not report
83*9e3b08aeSAndroid Build Coastguard Worker    loss or gain of user-defined type definitions.
84*9e3b08aeSAndroid Build Coastguard Worker
85*9e3b08aeSAndroid Build Coastguard WorkerThe following options are useful when comparing ABI representations that differ
86*9e3b08aeSAndroid Build Coastguard Workerin how much (DWARF) information they preserve.
87*9e3b08aeSAndroid Build Coastguard Worker
88*9e3b08aeSAndroid Build Coastguard Worker*   `primitive_type_encoding`
89*9e3b08aeSAndroid Build Coastguard Worker
90*9e3b08aeSAndroid Build Coastguard Worker    Ignore primitve type encodings during comparison. BTF provides a subset of
91*9e3b08aeSAndroid Build Coastguard Worker    encoding information. libabigail XML lacks encoding information.
92*9e3b08aeSAndroid Build Coastguard Worker
93*9e3b08aeSAndroid Build Coastguard Worker*   `member_size`
94*9e3b08aeSAndroid Build Coastguard Worker
95*9e3b08aeSAndroid Build Coastguard Worker    Ignore member sizes during comparison. libabigail XML does not model them.
96*9e3b08aeSAndroid Build Coastguard Worker
97*9e3b08aeSAndroid Build Coastguard Worker*   `enum_underlying_type`
98*9e3b08aeSAndroid Build Coastguard Worker
99*9e3b08aeSAndroid Build Coastguard Worker    Ignore enum-underlying types during comparison. BTF doesn't model them.
100*9e3b08aeSAndroid Build Coastguard Worker    libabigail provides incomplete information.
101*9e3b08aeSAndroid Build Coastguard Worker
102*9e3b08aeSAndroid Build Coastguard Worker*   `qualifier`
103*9e3b08aeSAndroid Build Coastguard Worker
104*9e3b08aeSAndroid Build Coastguard Worker    Ignore qualifiers during comparison. Both libabigail and STG interpret and
105*9e3b08aeSAndroid Build Coastguard Worker    adjust type qualifiers but sometimes do so differently.
106*9e3b08aeSAndroid Build Coastguard Worker
107*9e3b08aeSAndroid Build Coastguard Worker*   `linux_symbol_crc`
108*9e3b08aeSAndroid Build Coastguard Worker
109*9e3b08aeSAndroid Build Coastguard Worker    Ignore Linux kernel symbol CRC changes during comparison. This can be useful
110*9e3b08aeSAndroid Build Coastguard Worker    for ABI comparisons across different toolchains, where CRC changes are often
111*9e3b08aeSAndroid Build Coastguard Worker    large and not useful.
112*9e3b08aeSAndroid Build Coastguard Worker
113*9e3b08aeSAndroid Build Coastguard WorkerThese two options can be used for ABI compatibility testing where the first ABI
114*9e3b08aeSAndroid Build Coastguard Workeris expected to be a subset of the second.
115*9e3b08aeSAndroid Build Coastguard Worker
116*9e3b08aeSAndroid Build Coastguard Worker*   `interface_addition`
117*9e3b08aeSAndroid Build Coastguard Worker
118*9e3b08aeSAndroid Build Coastguard Worker    Ignore interface (symbol and type root) additions during comparison.
119*9e3b08aeSAndroid Build Coastguard Worker
120*9e3b08aeSAndroid Build Coastguard Worker*   `type_definition_addition`
121*9e3b08aeSAndroid Build Coastguard Worker
122*9e3b08aeSAndroid Build Coastguard Worker    Ignore type definition additions during comparison. Any extra symbol and
123*9e3b08aeSAndroid Build Coastguard Worker    type roots may reach extra definitions of existing types.
124*9e3b08aeSAndroid Build Coastguard Worker
125*9e3b08aeSAndroid Build Coastguard Worker### Fidelity Reporting
126*9e3b08aeSAndroid Build Coastguard Worker
127*9e3b08aeSAndroid Build Coastguard Worker*   `-F|--fidelity`
128*9e3b08aeSAndroid Build Coastguard Worker
129*9e3b08aeSAndroid Build Coastguard WorkerCompares ABI representations for fidelity of symbol and type information. It
130*9e3b08aeSAndroid Build Coastguard Workerreports the following kinds of fidelity changes:
131*9e3b08aeSAndroid Build Coastguard Worker
132*9e3b08aeSAndroid Build Coastguard Worker*   Addition or removal of types (fully defined or declaration only)
133*9e3b08aeSAndroid Build Coastguard Worker*   Loss or gain of type definitions
134*9e3b08aeSAndroid Build Coastguard Worker*   Loss or gain of type information for symbols
135*9e3b08aeSAndroid Build Coastguard Worker
136*9e3b08aeSAndroid Build Coastguard Worker## Output
137*9e3b08aeSAndroid Build Coastguard Worker
138*9e3b08aeSAndroid Build Coastguard WorkerAll outputs are based on a diff graph which is rooted at the comparison of two
139*9e3b08aeSAndroid Build Coastguard Workersymbol table nodes.
140*9e3b08aeSAndroid Build Coastguard Worker
141*9e3b08aeSAndroid Build Coastguard WorkerThe `--format` and `--output` options may be repeated to obtain outputs of
142*9e3b08aeSAndroid Build Coastguard Workerdifferent formats.
143*9e3b08aeSAndroid Build Coastguard Worker
144*9e3b08aeSAndroid Build Coastguard Worker### Formats
145*9e3b08aeSAndroid Build Coastguard Worker
146*9e3b08aeSAndroid Build Coastguard Worker*   `plain`
147*9e3b08aeSAndroid Build Coastguard Worker
148*9e3b08aeSAndroid Build Coastguard Worker    Serialise the diff graph via depth first search, avoiding revisiting nodes
149*9e3b08aeSAndroid Build Coastguard Worker    that have been visited or are being visited. The report mirrors the search
150*9e3b08aeSAndroid Build Coastguard Worker    tree.
151*9e3b08aeSAndroid Build Coastguard Worker
152*9e3b08aeSAndroid Build Coastguard Worker    This format is only suitable for small inputs because the indentation level
153*9e3b08aeSAndroid Build Coastguard Worker    is proportional to recursion depth and the resulting output may be
154*9e3b08aeSAndroid Build Coastguard Worker    unreadable.
155*9e3b08aeSAndroid Build Coastguard Worker
156*9e3b08aeSAndroid Build Coastguard Worker    Example:
157*9e3b08aeSAndroid Build Coastguard Worker
158*9e3b08aeSAndroid Build Coastguard Worker    ```
159*9e3b08aeSAndroid Build Coastguard Worker    function symbol 'unsigned int fun(enum A, enum B)' changed
160*9e3b08aeSAndroid Build Coastguard Worker      type 'unsigned int(enum A, enum B)' changed
161*9e3b08aeSAndroid Build Coastguard Worker        parameter 1 type 'enum A' changed
162*9e3b08aeSAndroid Build Coastguard Worker          enumerator 'Ae' value changed from 0 to 1
163*9e3b08aeSAndroid Build Coastguard Worker        parameter 2 type 'enum B' changed
164*9e3b08aeSAndroid Build Coastguard Worker          enumerator 'Be' value changed from 1 to 2
165*9e3b08aeSAndroid Build Coastguard Worker    ```
166*9e3b08aeSAndroid Build Coastguard Worker
167*9e3b08aeSAndroid Build Coastguard Worker*   `flat`
168*9e3b08aeSAndroid Build Coastguard Worker
169*9e3b08aeSAndroid Build Coastguard Worker    Serialise the diff graph being broken into smaller pieces, each rooted at a
170*9e3b08aeSAndroid Build Coastguard Worker    symbol, a user-defined type or a primitive type. Each piece is serialised as
171*9e3b08aeSAndroid Build Coastguard Worker    a tree at the top level.
172*9e3b08aeSAndroid Build Coastguard Worker
173*9e3b08aeSAndroid Build Coastguard Worker    Example:
174*9e3b08aeSAndroid Build Coastguard Worker
175*9e3b08aeSAndroid Build Coastguard Worker    ```
176*9e3b08aeSAndroid Build Coastguard Worker    function symbol 'unsigned int fun(enum A, enum B)' changed
177*9e3b08aeSAndroid Build Coastguard Worker      type 'unsigned int(enum A, enum B)' changed
178*9e3b08aeSAndroid Build Coastguard Worker        parameter 1 type 'enum A' changed
179*9e3b08aeSAndroid Build Coastguard Worker        parameter 2 type 'enum B' changed
180*9e3b08aeSAndroid Build Coastguard Worker
181*9e3b08aeSAndroid Build Coastguard Worker    type 'enum A' changed
182*9e3b08aeSAndroid Build Coastguard Worker      enumerator 'Ae' value changed from 0 to 1
183*9e3b08aeSAndroid Build Coastguard Worker
184*9e3b08aeSAndroid Build Coastguard Worker    type 'enum B' changed
185*9e3b08aeSAndroid Build Coastguard Worker      enumerator 'Be' value changed from 1 to 2
186*9e3b08aeSAndroid Build Coastguard Worker    ```
187*9e3b08aeSAndroid Build Coastguard Worker
188*9e3b08aeSAndroid Build Coastguard Worker*   `small`
189*9e3b08aeSAndroid Build Coastguard Worker
190*9e3b08aeSAndroid Build Coastguard Worker    Like the `flat` output, but any subtrees that contain no diffs are pruned.
191*9e3b08aeSAndroid Build Coastguard Worker    This report excludes symbols and types that have changed only due to some
192*9e3b08aeSAndroid Build Coastguard Worker    other type change.
193*9e3b08aeSAndroid Build Coastguard Worker
194*9e3b08aeSAndroid Build Coastguard Worker    Example:
195*9e3b08aeSAndroid Build Coastguard Worker
196*9e3b08aeSAndroid Build Coastguard Worker    ```
197*9e3b08aeSAndroid Build Coastguard Worker    type 'enum A' changed
198*9e3b08aeSAndroid Build Coastguard Worker      enumerator 'Ae' value changed from 0 to 1
199*9e3b08aeSAndroid Build Coastguard Worker
200*9e3b08aeSAndroid Build Coastguard Worker    type 'enum B' changed
201*9e3b08aeSAndroid Build Coastguard Worker      enumerator 'Be' value changed from 1 to 2
202*9e3b08aeSAndroid Build Coastguard Worker    ```
203*9e3b08aeSAndroid Build Coastguard Worker
204*9e3b08aeSAndroid Build Coastguard Worker*   `short`
205*9e3b08aeSAndroid Build Coastguard Worker
206*9e3b08aeSAndroid Build Coastguard Worker    The `short` report is a result of the following post-processing
207*9e3b08aeSAndroid Build Coastguard Worker    transformations on the `small` report:
208*9e3b08aeSAndroid Build Coastguard Worker
209*9e3b08aeSAndroid Build Coastguard Worker    *   Changes in symbols where only the CRC value has changed are collapsed
210*9e3b08aeSAndroid Build Coastguard Worker        and the total number of changes is reported.
211*9e3b08aeSAndroid Build Coastguard Worker    *   Runs of member offset changes are collapsed and the amount by which the
212*9e3b08aeSAndroid Build Coastguard Worker        offsets have shifted is reported.
213*9e3b08aeSAndroid Build Coastguard Worker    *   Added and removed symbols are reported in a compact manner with variable
214*9e3b08aeSAndroid Build Coastguard Worker        and function symbols separated.
215*9e3b08aeSAndroid Build Coastguard Worker
216*9e3b08aeSAndroid Build Coastguard Worker*   `viz`
217*9e3b08aeSAndroid Build Coastguard Worker
218*9e3b08aeSAndroid Build Coastguard Worker    Print the difference graph in Graphviz format.
219*9e3b08aeSAndroid Build Coastguard Worker
220*9e3b08aeSAndroid Build Coastguard Worker    Example:
221*9e3b08aeSAndroid Build Coastguard Worker
222*9e3b08aeSAndroid Build Coastguard Worker    ```
223*9e3b08aeSAndroid Build Coastguard Worker    digraph "ABI diff" {
224*9e3b08aeSAndroid Build Coastguard Worker      "0" [shape=rectangle, label="'symbols'"]
225*9e3b08aeSAndroid Build Coastguard Worker      "1" [label="'unsigned int fun(enum A, enum B)'"]
226*9e3b08aeSAndroid Build Coastguard Worker      "2" [label="'unsigned int(enum A, enum B)'"]
227*9e3b08aeSAndroid Build Coastguard Worker      "3" [color=red, shape=rectangle, label="'enum A'"]
228*9e3b08aeSAndroid Build Coastguard Worker      "3" -> "3:0"
229*9e3b08aeSAndroid Build Coastguard Worker      "3:0" [color=red, label="enumerator 'Ae' value changed from 0 to 1"]
230*9e3b08aeSAndroid Build Coastguard Worker      "2" -> "3" [label="parameter 1"]
231*9e3b08aeSAndroid Build Coastguard Worker      "4" [color=red, shape=rectangle, label="'enum B'"]
232*9e3b08aeSAndroid Build Coastguard Worker      "4" -> "4:0"
233*9e3b08aeSAndroid Build Coastguard Worker      "4:0" [color=red, label="enumerator 'Be' value changed from 1 to 2"]
234*9e3b08aeSAndroid Build Coastguard Worker      "2" -> "4" [label="parameter 2"]
235*9e3b08aeSAndroid Build Coastguard Worker      "1" -> "2" [label=""]
236*9e3b08aeSAndroid Build Coastguard Worker      "0" -> "1" [label=""]
237*9e3b08aeSAndroid Build Coastguard Worker    }
238*9e3b08aeSAndroid Build Coastguard Worker    ```
239*9e3b08aeSAndroid Build Coastguard Worker
240*9e3b08aeSAndroid Build Coastguard Worker## Exact Node Equality
241*9e3b08aeSAndroid Build Coastguard Worker
242*9e3b08aeSAndroid Build Coastguard Worker*   `-x|--exact`: perform exact node equality (ignoring node identity) instead
243*9e3b08aeSAndroid Build Coastguard Worker    of generating an ABI equivalence diff graph; no outputs may be specified.
244*9e3b08aeSAndroid Build Coastguard Worker
245*9e3b08aeSAndroid Build Coastguard Worker## Other options:
246*9e3b08aeSAndroid Build Coastguard Worker
247*9e3b08aeSAndroid Build Coastguard Worker*   `-m|--metrics`: print duration of ABI parsing, comparison and reporting.
248*9e3b08aeSAndroid Build Coastguard Worker
249*9e3b08aeSAndroid Build Coastguard Worker## Return code
250*9e3b08aeSAndroid Build Coastguard Worker
251*9e3b08aeSAndroid Build Coastguard WorkerIf input files' ABIs are equivalent (or equal with `--exact`), `stgdiff` will
252*9e3b08aeSAndroid Build Coastguard Workerreturn 0. Otherwise:
253*9e3b08aeSAndroid Build Coastguard Worker
254*9e3b08aeSAndroid Build Coastguard Worker*   Return code 1: there was an exception during comparison, see `stderr` for
255*9e3b08aeSAndroid Build Coastguard Worker    the exception reason.
256*9e3b08aeSAndroid Build Coastguard Worker*   Return code 4: ABIs differ.
257*9e3b08aeSAndroid Build Coastguard Worker
258*9e3b08aeSAndroid Build Coastguard Worker## Examples
259*9e3b08aeSAndroid Build Coastguard Worker
260*9e3b08aeSAndroid Build Coastguard Worker*   Compare two ABI XML files, and print a short report to stdout:
261*9e3b08aeSAndroid Build Coastguard Worker
262*9e3b08aeSAndroid Build Coastguard Worker    ```
263*9e3b08aeSAndroid Build Coastguard Worker    stgdiff -a abi.0.xml abi.1.xml -f short -o -
264*9e3b08aeSAndroid Build Coastguard Worker    ```
265*9e3b08aeSAndroid Build Coastguard Worker
266*9e3b08aeSAndroid Build Coastguard Worker*   Compare two ABI XML files **without printing anything**:
267*9e3b08aeSAndroid Build Coastguard Worker
268*9e3b08aeSAndroid Build Coastguard Worker    ```
269*9e3b08aeSAndroid Build Coastguard Worker    stgdiff -a abi.0.xml abi.1.xml && echo "Equivalent" || echo "Not equivalent, return code: $?"
270*9e3b08aeSAndroid Build Coastguard Worker    ```
271*9e3b08aeSAndroid Build Coastguard Worker
272*9e3b08aeSAndroid Build Coastguard Worker*   Compare two ABI XML files, print short report to stdout and also print diff
273*9e3b08aeSAndroid Build Coastguard Worker    graph visualisation to the file:
274*9e3b08aeSAndroid Build Coastguard Worker
275*9e3b08aeSAndroid Build Coastguard Worker    ```
276*9e3b08aeSAndroid Build Coastguard Worker    stgdiff -a abi.0.xml abi.1.xml -f short -o - -f viz -o graph.viz
277*9e3b08aeSAndroid Build Coastguard Worker    ```
278*9e3b08aeSAndroid Build Coastguard Worker
279*9e3b08aeSAndroid Build Coastguard Worker*   Compare two ABI XML files, ignoring type presence and type declaration
280*9e3b08aeSAndroid Build Coastguard Worker    status changes, and print short report to stdout:
281*9e3b08aeSAndroid Build Coastguard Worker
282*9e3b08aeSAndroid Build Coastguard Worker    ```
283*9e3b08aeSAndroid Build Coastguard Worker    stgdiff -i symbol_type_presence -i type_declaration_status -a abi.0.xml abi.1.xml -f short -o -
284*9e3b08aeSAndroid Build Coastguard Worker    ```
285*9e3b08aeSAndroid Build Coastguard Worker
286*9e3b08aeSAndroid Build Coastguard Worker*   Compare ABI XML to ABI from ELF and print a short report to file:
287*9e3b08aeSAndroid Build Coastguard Worker
288*9e3b08aeSAndroid Build Coastguard Worker    ```
289*9e3b08aeSAndroid Build Coastguard Worker    stgdiff -a abi.xml -e example.o -f short -o example.diff
290*9e3b08aeSAndroid Build Coastguard Worker    ```
291*9e3b08aeSAndroid Build Coastguard Worker
292*9e3b08aeSAndroid Build Coastguard Worker*   Compare two STG files and print fidelity report to stdout:
293*9e3b08aeSAndroid Build Coastguard Worker
294*9e3b08aeSAndroid Build Coastguard Worker    ```
295*9e3b08aeSAndroid Build Coastguard Worker    stgdiff -s abi.0.stg abi.1.stg -F -
296*9e3b08aeSAndroid Build Coastguard Worker    ```
297*9e3b08aeSAndroid Build Coastguard Worker
298*9e3b08aeSAndroid Build Coastguard Worker*   Compare symbols and named types in two ELF files and print a short report to
299*9e3b08aeSAndroid Build Coastguard Worker    stdout:
300*9e3b08aeSAndroid Build Coastguard Worker
301*9e3b08aeSAndroid Build Coastguard Worker    ```
302*9e3b08aeSAndroid Build Coastguard Worker    stgdiff -t -e example1.o example2.o -f short -o -
303*9e3b08aeSAndroid Build Coastguard Worker    ```
304