Products › lamco-dsi-tools › Docs › Output and exit codes
Output and exit codes
The JSON output of each command, the exit codes, and the JUnit report for CI.
The three programs of lamco-dsi-tools (DSI: Desktop session interfaces) use one JSON form and a small set of exit codes, so that they compose in shell scripts and automated checks. This page condenses docs/reference/json-output.md and lists every exit code from docs/reference/exit-codes.md.
Global flags
dsisee and dsido take the same flags, before or after the command:
--json: JSON on standard output in place of text.--verbose: Debug logging on standard error.--timeout <seconds>: A limit on the command's working time (default 30, 0 for none). It doesn't cover the window a command was asked to keep open with--duration, nor a wait for a permission dialog. A command that the limit, Ctrl-C or a termination signal ends while it records writes the capture of what it had, with the dissector markedcut_short_by, and exits 2, 130 or 143.--junit <file>: Writes a JUnit XML file with one test case, which fails when the command fails.--out <file>: Writes the command's capture to a file. A file named with--outis written before anything goes to standard output.
The commands that open a permission dialog (eis probe, eis observe, observe --allow-dialogs, check --allow-dialogs, dsido eis inject and the other portal routes) take --dialog-timeout <seconds> (default 120, 0 for none). That wait is measured and reported, and kept out of the working time --timeout limits.
dsitell takes --json. It has no time limit, since it reads files. Its --junit belongs to health and compare.
JSON output
Every command of the three programs takes --json and then prints one JSON document on standard output in place of text. Every document has schema_version as its first member, currently v1. A member that's added later doesn't change the version, so a reader has to pass over members it doesn't know.
dsisee and dsido
Every dsisee and dsido command prints a capture: The header, the environment, each dissector's outcome and the records (see The capture file). Most commands add a summary member beside the records, holding what the command worked out from them. A summary is the command's reading of its own records. It's never in their place, and dsitell doesn't read it.
| Command | summary holds |
|---|---|
portal diagnose, portal probe | Counts: Whether the frontend has an owner, a start the instrument made, interfaces, backends by source, the RemoteDesktop version, owner changes. |
pipewire diagnose, pipewire probe | The daemon's version and the nodes; the driver cycle timing. |
wayland diagnose, wayland protocols | The compositor a version method was used for; the classification of the globals, marked as an interpretation. |
eis diagnose, eis probe | The level the built-in table assumes, with its label; the life of the libei connection (phases, dialog_wait_ns, reached, devices, ready_sent, closure and more). |
capture probe, capture observe | route (protocol, mechanism_id, chosen_because) and the frame timing. With --read-markers, markers; with --cursor-mode metadata, cursor; with --window or --cursor, those members. |
input routes, clipboard routes | The input or clipboard function of the health summary. |
input witness | What reached the window: Events by kind, focus, commits, marked_commits, presentation_clock_id. |
clipboard observe | route, selections, reads (each with bytes, sha256, complete and three times), and two distributions. |
output observe | outputs_described (each output as each interface describes it) and the outputs function. |
audio observe, audio stream | audio_described and xrun_count; stream and the markers heard. |
session remote-desktop | names, exported, differs_from_draft and draft (the address, commit and date the comparison was made against). |
session logind, eis observe, input capture, observe | None. The document is the capture. |
check | A health member in place of summary. |
dsido inject and replay | route, action, typed and skipped, the steps planned and sent, keymap, request_to_sent, and where they apply witness_wait, device, before_first_step, touch_placing, dialog_wait_ns, replay_of. |
dsido clipboard set, output set, audio play, screen animate, load | What was set, changed and restored, played, presented, or loaded. input-capture enable adds none. |
With --soak, the commands that take it write the capture to --out as a stream, and the document on standard output says what the run came to: The file, how it ended, the records and bytes written, and the size cap.
dsitell
Each dsitell command prints a document of its own. The ones a script most often reads:
health: One summary per capture undercaptures, each withoverall(the worst examined state, and counts ofnot_examinedandassumed),functions(always eight, in order, each withstate,statementsandroutes),also_looked_forandfindings. A statement'srecordsare indexes into the capture'srecords.timing:clock,captures,durations(each withname,count,min_ns,median_ns,p95_ns,p99_ns,max_ns,jitter_ns,clock,basisandwaits_for_person),rates(alwaysestimated) andrefused(durations across two clocks). Percentiles use the nearest rank, andjitter_nsis the population standard deviation. With--series, one figure over time:whole,over,longest,buckets,rate,span,streamand, where the capture holds a watch,session.compare:fail_onandfailing(the exit code is 1 exactly whenfailingis true),baselineandcandidate,clocks, and sectionsenvironment,dissectors,advertised,portal_capabilities,health,findings,timing,portal_start,timing_refused,timing_policyandregressions. Every section holds every row, anddiffersorchangesays which differ.matrix:columns, thenhealth,findingsandtimingrows with one entry per column.loop,glass,clipboard,audio: The two or three files,clock,closed(which is also the exit code), the pairs, and the distributions. A figure with two clock names carriesone_clockandrests_onwhen it was computed, and is undernot_computedotherwise.bundle,scrub: The file or directory written, andredaction:replaced(always fifteen kinds, and a sixteenth with--redact-app-ids),left_inside_longer_wordsandkept.replay: Per capture, who wrote and who reads it,mechanisms,against_stored,healthandtiming.findings: The catalog, or one entry.
Errors
When a command fails in JSON mode, the message goes to standard error and standard output carries an error object:
{ "schema_version": "v1", "error": { "kind": "not_available", "message": "..." } }
| Program | kind |
|---|---|
dsisee, dsido | not_available (the thing asked for isn't on this machine), refused (it's there and declined, for example a dialog that was declined), failed or timed_out. When a D-Bus peer answered with an error, the object also has bus_error with its name and message. |
dsitell | unreadable, not_a_capture, unknown_schema_version, clock_mismatch (timing was given captures that can't be combined), output (a file or standard output couldn't be written) or usage. |
When a command that records is ended by its limit or a signal, the capture is the only document on standard output: No error object follows it. When a dsido injector falls short, the capture is still the document, with the injector's outcome in dissectors. A command line that can't be parsed is reported by the argument parser on standard error, with no JSON object.
Exit codes of dsisee and dsido
| Code | Meaning |
|---|---|
0 | The command ran. |
1 | The command failed: What it reads isn't there, it was refused, or it went wrong. |
2 | A time limit ran out (--timeout, or --dialog-timeout for a command that opens a dialog), or the command line couldn't be parsed. |
130, 143 | An interrupt (SIGINT, which Ctrl-C sends) or a termination signal (SIGTERM) ended a command that was recording. Its capture is written first. |
141 | The reader of standard output closed the pipe, as | head does. Nothing is printed on standard error. |
Cases worth knowing:
dsisee observeanddsisee checkexit 0 once they've written the capture, whatever is in it. A dissector that failed is an outcome in the capture, and a functioncheckreports as broken is a line in its summary:dsiseejudges nothing. They exit 2 when--timeoutruns out, after writing what finished. For an exit code that follows the health summary, rundsitell healthon the capture.- A command that's the front of a single dissector, such as
dsisee portal diagnose, exits 1 when that dissector couldn't do its work. One that records for a window and fell short after recording something writes the capture of that, then exits 1. - A command that opens a portal session writes its capture from its first step on. When a step fails, is declined or isn't answered, the capture holds the steps and a
session_faultrecord, and the command exits 1 or 2 as the fault says. A declined dialog isrefused(1), and one not answered within--dialog-timeoutistimed_out(2). dsisee capture probeandcapture observeexit 1, asnot_available, when no capture route can be taken, or the portal is the only one and neither--allow-dialogsnor--route portalwas given. In a build without thepipewirefeature,capture probealso exits 1 whenever its route is the portal, before any dialog. With the feature, it exits 1 through the portal when no buffer arrived.dsisee clipboard observeanddsido clipboard setexit 1, asnot_available, when no clipboard route can be taken.clipboard setthrough the portal exits 1, as refused, when the portal starts the session with the clipboard not enabled.- A command that connects to the Wayland display gives the compositor ten seconds for each round trip it sets itself up with. One that isn't answered is recorded as
round_trip_unanswered, and a command whose one job that was exits 2. - A
dsidoaction that isn't well formed exits 2 before anything is opened. An injection that fell short exits 1, or 2 for a time limit, after writing its capture. A touch with no touchscreen exits 1, as not available (always onwlr). With no libei device resumed at all in ten seconds it's a time-out, 2. dsido <route> replayexits 2 before anything is opened for a file that isn't a capture, holds no injection, or holds more than one action. Otherwise it exits as the route'sinjectdoes.dsido <route> inject --wait-witnessexits 1 when no witness said it had the focus in time. Nothing was sent.dsido output setexits 2 for no change or one that isn't well formed. It exits 1 asnot_available(no interface, no such output, mode or scale, or--test-onlyon KWin), asrefused(the test said no, KWin answered the apply withfailed, or GNOME's interface isn't as expected), or asfailed(a tested change wasn't taken, or the prior state couldn't be put back). It exits 2 when the desktop didn't answer a configuration within ten seconds. Ended by a limit or a signal, it still applies the prior state before it returns, and never exits 0.dsisee audio streamexits 1, after writing its capture, when no buffer arrived or fewer markers were heard than--expectnamed.dsido audio playexits 1 when its stream failed or the graph didn't ask for the run's buffers. Without thepipewirefeature both exit 1 as not available and write no capture.dsido session inhibitexits 0 when at least one of its two interfaces gave a lock and it was held for the time asked, and 1 when neither did. That the session locked all the same changes no exit code: It'sSOAK-006.- A command that opens a portal session exits 2 when
--persistis given without--restore-token, or--restore-tokennames a file with no token and--persistasks for none. The capture commands exit 1 when--persist,--restore-tokenor--sessionis given and the route isn't the portal's. - A run with
--soakexits 1 when its file reached--soak-capor couldn't be written, 0 when it lasted the time asked, and 2, 130 or 143 when a limit or signal ended it.--soakwithout--outexits 1 before anything is opened. A run killed outright has no exit code of its own. dsisee capture observe --until-file <path>exits 0 when something appears at the path. Something already there when the command starts exits 1 before anything is opened.
Exit codes of dsido-uinput
| Code | Meaning |
|---|---|
0 | Done. |
1 | Failed. |
2 | Not a request the helper takes, or an argument. |
3 | Refused: The helper may not open the node as the user it runs as, or it was started set-user-ID or set-group-ID. |
4 | No uinput here: /dev/uinput doesn't exist. |
Exit codes of dsitell
| Code | Meaning |
|---|---|
0 | The command ran. For health: No examined function is broken. For loop: Every injected step a window can see was seen by the witness. For glass: Every frame that was to be captured was. For clipboard: The content that was set came back whole. For audio: Every marker played was heard. For compare: No class named with --fail-on has a regression, which is always so when none is named. |
1 | health: An examined function is broken, or absent with --fail-on-absent. loop: A step wasn't seen, or the injection holds no step a window can see. glass: A presented frame was dropped by the capture route or is in doubt, no frame was captured, or a step didn't reach the pixels. clipboard: No read of the watcher is the content that was set. audio: A marker played wasn't heard, or none was played. compare: The candidate regresses in a class named with --fail-on. |
2 | A file isn't a capture, has a schema version this build doesn't read, couldn't be read, or an output file couldn't be written; captures given to timing, or to a loop command, don't name one machine and one boot; findings was asked for an identifier not in the catalog; scrub found no capture or would overwrite a file; replay --out was given several captures; timing --series was given an unknown figure, several captures or --bucket 0; or the command line couldn't be parsed. |
141 | The reader of standard output closed the pipe. |
matrix, replay, timing, bundle and findings have no failing verdict: They exit 0 when they wrote their output and 2 otherwise. A replay that reads a capture otherwise than a stored reading did says so and exits 0. Differences alone never change the exit code of compare.
health
The exit code follows the states of the functions that were examined, and nothing else. Findings don't set it.
| State | Exit code | With --fail-on-absent |
|---|---|---|
working, present | 0 | 0 |
absent | 0 | 1 |
broken | 1 | 1 |
not_examined, assumed | 0 | 0 |
absent isn't a failure by default because what a desktop doesn't have is often its design. A portal nobody has called yet is not_examined, not absent, so --fail-on-absent doesn't fail on it. Given several captures, health exits 1 when any has a failing function.
dsisee observe --out capture.json
dsitell health --fail-on-absent --junit health.xml capture.json || exit 1
JUnit reports
dsitell health --junit <file> writes one test case per function (named after its capture too when there are several):
| State | Test case |
|---|---|
working, present | Passed |
absent | Passed, or failed with --fail-on-absent |
broken | Failed |
not_examined, assumed | Skipped, with the reason as its message |
dsitell compare --junit <file> writes one test case per class of regression, five in all:
| The class | Test case |
|---|---|
Was named with --fail-on and has a regression | Failed, with each regression in the message |
Was named with --fail-on and has none | Passed |
Wasn't named with --fail-on | Skipped, with how many regressions were found and which |
| Had nothing to compare | Skipped, whether or not it was named |
A class that wasn't asked for, or that had nothing under it, is never reported as a pass. dsisee --junit <file> and dsido --junit <file> write one test case for the command, which fails when the command does.