Skip to content

Commit 2293523

Browse files
committed
[Gardening] De-RST DriverParseableOutput
1 parent 8352550 commit 2293523

File tree

3 files changed

+92
-98
lines changed

3 files changed

+92
-98
lines changed

docs/CompilerPerformance.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ highly dependent on **compilation modes**. Information concerning those modes
8484
that's relevant to compilation performance is recounted in the following
8585
section; for more details on the driver, see [the driver docs](Driver.md), as
8686
well as docs on [driver internals](DriverInternals.md)
87-
and [driver parseable output](DriverParseableOutput.rst).
87+
and [driver parseable output](DriverParseableOutput.md).
8888

8989
After discussing compilation modes in the following section, we'll also touch on
9090
large-scale variation in workload that can occur _without_ obvious hotspots, in

docs/DriverParseableOutput.rst docs/DriverParseableOutput.md

+91-96
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
=======================
21
Parseable Driver Output
32
=======================
43

5-
.. contents::
6-
:local:
7-
8-
.. highlight:: none
9-
104
Introduction
115
============
126

@@ -21,13 +15,15 @@ Message Format
2115
The parseable output provided by the Swift driver is provided as messages
2216
encoded in JSON objects. All messages are structured like this::
2317

24-
<Message Length>\n
25-
{
26-
"kind": "<Message Kind>",
27-
"name": "<Message Name>",
28-
"<key>": "<value>",
29-
...
30-
}\n
18+
```
19+
<Message Length>\n
20+
{
21+
"kind": "<Message Kind>",
22+
"name": "<Message Name>",
23+
"<key>": "<value>",
24+
...
25+
}\n
26+
```
3127

3228
This allows the driver to pass as much information as it wants about the ongoing
3329
compilation, and programs which parse this data can decide what to use and what
@@ -65,9 +61,6 @@ If "pid" is greater than 0 it will always match the value in "process.real_pid".
6561
Message Kinds
6662
=============
6763

68-
.. contents::
69-
:local:
70-
7164
The driver may emit four kinds of messages: "began", "finished", "signalled",
7265
and "skipped".
7366

@@ -85,33 +78,33 @@ will specify the command which was executed under the "command_executable" and
8578
To get the real process identifier for the process that started, get the value
8679
of "process.real_pid".
8780

88-
Example::
89-
90-
{
91-
"kind": "began",
92-
"name": "compile",
93-
"pid": 12345,
94-
"process": {
95-
"real_pid": 12345
81+
```json
82+
{
83+
"kind": "began",
84+
"name": "compile",
85+
"pid": 12345,
86+
"process": {
87+
"real_pid": 12345
88+
},
89+
"inputs": ["/src/foo.swift"],
90+
"outputs": [
91+
{
92+
"type": "object",
93+
"path": "/build/foo.o"
9694
},
97-
"inputs": ["/src/foo.swift"],
98-
"outputs": [
99-
{
100-
"type": "object",
101-
"path": "/build/foo.o"
102-
},
103-
{
104-
"type": "swiftmodule",
105-
"path": "/build/foo.swiftmodule"
106-
},
107-
{
108-
"type": "diagnostics",
109-
"path": "/build/foo.dia"
110-
},
111-
],
112-
"command_executable": "swift",
113-
"command_arguments" : ["-frontend", "-c", "-primary-file", "/src/foo.swift", "/src/bar.swift", "-emit-module-path", "/build/foo.swiftmodule", "-emit-diagnostics-path", "/build/foo.dia"]
114-
}
95+
{
96+
"type": "swiftmodule",
97+
"path": "/build/foo.swiftmodule"
98+
},
99+
{
100+
"type": "diagnostics",
101+
"path": "/build/foo.dia"
102+
},
103+
],
104+
"command_executable": "swift",
105+
"command_arguments" : ["-frontend", "-c", "-primary-file", "/src/foo.swift", "/src/bar.swift", "-emit-module-path", "/build/foo.swiftmodule", "-emit-diagnostics-path", "/build/foo.dia"]
106+
}
107+
```
115108

116109
Finished Message
117110
----------------
@@ -124,23 +117,23 @@ missing, no output was generated by the task.
124117
It will contain the process identifier of the operating system and usage under
125118
the "process" key. The usage is optional and could be omitted.
126119

127-
Example::
128-
129-
{
130-
"kind": "finished",
131-
"name": "compile",
132-
"pid": 12345,
133-
"exit-status": 0,
134-
"process": {
135-
"real_pid": 12345,
136-
"usage": {
137-
"utime": 22740,
138-
"stime": 91107,
139-
"maxrss": 7745536
140-
}
141-
}
142-
// "output" key omitted because there was no stdout/stderr.
120+
```json
121+
{
122+
"kind": "finished",
123+
"name": "compile",
124+
"pid": 12345,
125+
"exit-status": 0,
126+
"process": {
127+
"real_pid": 12345,
128+
"usage": {
129+
"utime": 22740,
130+
"stime": 91107,
131+
"maxrss": 7745536
143132
}
133+
}
134+
// "output" key omitted because there was no stdout/stderr.
135+
}
136+
```
144137

145138
Signalled Message
146139
-----------------
@@ -157,22 +150,24 @@ the "process" key. The usage is optional and could be omitted.
157150

158151
Example::
159152

160-
{
161-
"kind": "signalled",
162-
"name": "compile",
163-
"pid": 12345,
164-
"error-message": "Segmentation fault: 11",
165-
"signal": 4,
166-
"process": {
167-
"real_pid": 12345,
168-
"usage": {
169-
"utime": 22740,
170-
"stime": 91107,
171-
"maxrss": 7745536
172-
}
173-
}
174-
// "output" key omitted because there was no stdout/stderr.
153+
```json
154+
{
155+
"kind": "signalled",
156+
"name": "compile",
157+
"pid": 12345,
158+
"error-message": "Segmentation fault: 11",
159+
"signal": 4,
160+
"process": {
161+
"real_pid": 12345,
162+
"usage": {
163+
"utime": 22740,
164+
"stime": 91107,
165+
"maxrss": 7745536
175166
}
167+
}
168+
// "output" key omitted because there was no stdout/stderr.
169+
}
170+
```
176171

177172
Skipped Message
178173
---------------
@@ -181,29 +176,29 @@ A "skipped" message indicates that the driver determined a command did not need
181176
run during the current compilation. A "skipped" message is equivalent to a "began"
182177
message, with the exception that it does not include the "pid" key.
183178

184-
Example::
185-
186-
{
187-
"kind": "skipped",
188-
"name": "compile",
189-
"inputs": ["/src/foo.swift"],
190-
"outputs": [
191-
{
192-
"type": "object",
193-
"path": "/build/foo.o"
194-
},
195-
{
196-
"type": "swiftmodule",
197-
"path": "/build/foo.swiftmodule"
198-
},
199-
{
200-
"type": "diagnostics",
201-
"path": "/build/foo.dia"
202-
},
203-
],
204-
"command_executable": "swift",
205-
"command_arguments": ["-frontend", "-c", "-primary-file", "/src/foo.swift", "/src/bar.swift", "-emit-module-path", "/build/foo.swiftmodule", "-emit-diagnostics-path", "/build/foo.dia"]
206-
}
179+
```json
180+
{
181+
"kind": "skipped",
182+
"name": "compile",
183+
"inputs": ["/src/foo.swift"],
184+
"outputs": [
185+
{
186+
"type": "object",
187+
"path": "/build/foo.o"
188+
},
189+
{
190+
"type": "swiftmodule",
191+
"path": "/build/foo.swiftmodule"
192+
},
193+
{
194+
"type": "diagnostics",
195+
"path": "/build/foo.dia"
196+
},
197+
],
198+
"command_executable": "swift",
199+
"command_arguments": ["-frontend", "-c", "-primary-file", "/src/foo.swift", "/src/bar.swift", "-emit-module-path", "/build/foo.swiftmodule", "-emit-diagnostics-path", "/build/foo.dia"]
200+
}
201+
```
207202

208203
Message Names
209204
=============

docs/contents.rst

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Contents
88

99
IndexInvalidation
1010
AccessControl
11-
DriverParseableOutput
1211
ErrorHandling
1312
ErrorHandlingRationale
1413
Generics

0 commit comments

Comments
 (0)