app.dhover×163 error×45all
// F01 — first pixel & init cost, X11 edition (../../../features/f01-first-pixel.md).
// Derived from the X11 scaffold (../scaffold/app.d), cut down to exactly the
// init-to-first-pixel path: connect, create + map a window, allocate a MIT-SHM
// backbuffer, draw one gradient, present it, and exit as soon as the present is
// confirmed.
//
// Every initialization API call emits one `step name=<call>` line, tagged
// `rt=1` when the call blocks on a server reply (a round-trip in Xlib's
// output-buffer model) and `rt=0` when it only appends to the output buffer.
// X11 is the platform where this distinction is the finding: most of "window
// creation" is free local marshalling, and the wall-clock cost concentrates in
// the handful of reply-bearing calls (XOpenDisplay, XShmQueryExtension,
// XInternAtom, the XSetWMProtocols hidden InternAtom, and the one deliberate
// XSync in the SHM attach dance).
//
//   WSI_SYNC_STEPS=1  brackets every *async* request with an XSync and logs
//                     `step name=XSync after=<call> us=<cost>` — measuring the
//                     server-side processing each fire-and-forget call hides.
//   WSI_NO_SHM=1      forces the plain XPutImage fallback; first pixel is then
//                     only `method=XPutImage_XSync` (server *processed* the
//                     put — core X11 cannot confirm presentation; without the
//                     Present extension that caveat is structural, and with
//                     MIT-SHM the completion event still only means "the
//                     server is done *reading* the segment").
//
// After `first_pixel_presented` the demo emits one summary line:
//   summary concepts=<N> loc=<N> init_to_pixel_us=<N>
// concepts = distinct platform object/handle types touched (the F01 concept
// count, itemized in ../../scaffold.md); loc = lines of this file (excluding
// instrument.d and c.c), kept in sync manually with `wc -l app.d`.
//
// Headless-safe: no reachable X server prints `SKIP:` and exits 0. Findings:
// ../../f01-first-pixel.md.
module 
(module) app
app
;
import
(module) c
c
; // ImportC: Xlib + Xutil + Xatom + XShm + sys/ipc + sys/shm + poll
C preprocess command `cpp` failed for file `/home/runner/work/sparkles/sparkles/docs/research/window-system-integration/os-apis/x11/examples/f01-first-pixel/c.c`, exit status 1
import
(module) instrument
instrument
;
import
(package) core
core
.
(package) core.stdc
stdc
.
(module) core.stdc.config

D compatible types that correspond to various basic types in associated C and C++ compilers.

Source

core/stdc/config.d

@copyrightCopyright Sean Kelly 2005 - 2009.@licenseDistributed under the Boost Software License 1.0. (See accompanying file LICENSE)@authorsSean Kelly@standardsISO/IEC 9899:1999 (E)
config
: c_long;
import
(package) core
core
.
(package) core.stdc
stdc
.
(module) core.stdc.stdio

D header file for C99 <stdio.h>

pubs.opengroup.org/onlinepubs/009695399/basedefs/stdio.h.html, stdio.h

Source

core/stdc/stdio.d

@copyrightCopyright Sean Kelly 2005 - 2009.@licenseDistributed under the Boost Software License 1.0. (See accompanying file LICENSE)@authorsSean Kelly, Alex Rønne Petersen@standardsISO/IEC 9899:1999 (E)
stdio
:
(alias) app.printf = int core.stdc.stdio.printf(scope const(char*) format, scope const ...) nothrow @nogc
printf
;
import
(package) core
core
.
(package) core.stdc
stdc
.
(module) core.stdc.stdlib

D header file for C99.

pubs.opengroup.org/onlinepubs/009695399/basedefs/stdlib.h.html, stdlib.h

Source

core/stdc/stdlib.d

@copyrightCopyright Sean Kelly 2005 - 2014.@licenseDistributed under the Boost Software License 1.0. (See accompanying file LICENSE)@authorsSean Kelly@standardsISO/IEC 9899:1999 (E)
stdlib
:
(alias) app.getenv = char* core.stdc.stdlib.getenv(scope const(char*) name) nothrow @nogc
getenv
;
// Constants Xlib/glibc expose only as macros (not ImportC-able); re-declared // per the ImportC guide, same as the scaffold. enum : c_long {
(enum value) app.ExposureMask = 32768L
ExposureMask
= 1L << 15,
(enum value) app.StructureNotifyMask = 131072L
StructureNotifyMask
= 1L << 17,
} enum // XEvent.type discriminators {
(enum value) app.Expose = 12
Expose
= 12,
(enum value) app.MapNotify = 19
MapNotify
= 19,
(enum value) app.ConfigureNotify = 22
ConfigureNotify
= 22,
} enum
(constant) int app.ZPixmap = 2
ZPixmap
= 2;
enum
(constant) int app.ShmCompletion = 0
ShmCompletion
= 0; // offset inside MIT-SHM's allocated event range
enum
(constant) int app.False = 0
False
= 0;
enum
(constant) int app.True = 1
True
= 1;
enum
(constant) int app.POLLIN = 1
POLLIN
= 0x001;
enum
(constant) int app.IPC_PRIVATE = 0
IPC_PRIVATE
= 0;
enum
(constant) int app.IPC_CREAT = 512
IPC_CREAT
= 0x200; // 01000 octal
enum
(constant) int app.IPC_RMID = 0
IPC_RMID
= 0;
/// This file's line count — the F01 LOC figure (excludes instrument.d / c.c). /// Keep in sync with `wc -l app.d`. enum
(constant) int app.locCount = 359

This file's line count — the F01 LOC figure (excludes instrument.d / c.c). Keep in sync with wc -l app.d.

locCount
= 359;
__gshared bool
(__gshared global) bool app.g_syncSteps
g_syncSteps
= false;
/// `step name=<call> rt=<0|1>` — one line per init API call. `rt=1` marks a /// call that blocked on a server reply. void
app.step

``step name=<call> rt=<0|1> — one line per init API call. rt=1 marks a call that blocked on a server reply.

step
(Display*
(parameter) Display* dpy
dpy
, const(char)* name, bool roundTrip) @nogc nothrow
undefined identifier `Display`
{ emitf("step", "name=%s rt=%d", name, cast(int) roundTrip); } /// WSI_SYNC_STEPS=1: bracket an async request with XSync to surface the /// server-side cost the fire-and-forget call hides. void
app.syncPoint

WSI_SYNC_STEPS=1: bracket an async request with XSync to surface the server-side cost the fire-and-forget call hides.

syncPoint
(Display*
(parameter) Display* dpy
dpy
, const(char)* after) @nogc nothrow
undefined identifier `Display`
{ if (!g_syncSteps) return; const
_error_ t0
t0
= nowUs();
XSync(dpy, False); emitf("step", "name=XSync after=%s us=%lld", after, nowUs() - t0); } /// Corner-anchored diagonal gradient (the scaffold's, phase 0 — one frame). void
app.drawGradient

Corner-anchored diagonal gradient (the scaffold's, phase 0 — one frame).

drawGradient
(XImage*
(parameter) XImage* ximg
ximg
) @nogc nothrow
undefined identifier `XImage`
{ const
_error_ w
w
= ximg.
ximg.width
width
,
_error_ h
h
= ximg.
ximg.height
height
;
if (ximg.bits_per_pixel != 32) return; foreach (
(parameter) y
y
; 0 .. h)
{ auto
_error_ row
row
= cast(uint*)(ximg.
ximg.data
data
+ y * ximg.bytes_per_line);
const
_error_ g
g
= cast(uint)(h > 1 ? (y * 255) / (h - 1) : 0);
foreach (
(parameter) x
x
; 0 .. w)
{ const
_error_ r
r
= cast(uint)(w > 1 ? (x * 255) / (w - 1) : 0);
row[x] = (r << 16) | (g << 8) | cast(uint)((x + y) & 0xff); } } } int
int D main()
main
()
{
void instrument.initInstrument(const(char)* demoName) nothrow @nogc

Names the demo, starts the monotonic clock, and emits init_start. Call this first, before any platform API call.

initInstrument
("f01_x11");
(__gshared global) bool app.g_syncSteps
g_syncSteps
=
char* core.stdc.stdlib.getenv(scope const(char*) name) nothrow @nogc
getenv
("WSI_SYNC_STEPS") !is null;
// -- 1. Connect (concept 1: Display*) — the one unavoidable round-trip: // socket connect + authentication + the connection-setup reply. Display*
(local variable) _error_ dpy
dpy
= XOpenDisplay(null);
undefined identifier `Display`
undefined identifier `XOpenDisplay`
if (dpy is null) {
int core.stdc.stdio.printf(scope const(char*) format, scope const ...) nothrow @nogc
printf
("SKIP: no X11 display (XOpenDisplay returned null)\n");
return 0; } step(dpy, "XOpenDisplay", true);
void instrument.emitf(scope const(char)* kind, scope const(char)* fmt, ...) nothrow @nogc

Emit an event with a printf-formatted key=value ... payload.

emitf
("step", "name=XConnectionNumber fd=%d rt=0", XConnectionNumber(dpy));
undefined identifier `XConnectionNumber`
const
(local variable) const(_error_) screen
screen
= XDefaultScreen(dpy); // local: reads connection-setup data
undefined identifier `XDefaultScreen`
const
(local variable) const(_error_) root
root
= XRootWindow(dpy, screen);
undefined identifier `XRootWindow`
Visual*
(local variable) _error_ visual
visual
= XDefaultVisual(dpy, screen); // concept 4: Visual*
undefined identifier `Visual`
undefined identifier `XDefaultVisual`
const
(local variable) const(_error_) depth
depth
= XDefaultDepth(dpy, screen);
undefined identifier `XDefaultDepth`
step(dpy, "XDefaultScreen/Root/Visual/Depth", false); // -- 2. MIT-SHM availability — QueryExtension is reply-bearing. bool
(local variable) bool haveShm
haveShm
= XShmQueryExtension(dpy) != 0;
undefined identifier `XShmQueryExtension`
void instrument.emitf(scope const(char)* kind, scope const(char)* fmt, ...) nothrow @nogc

Emit an event with a printf-formatted key=value ... payload.

emitf
("step", "name=XShmQueryExtension available=%d rt=1", cast(int)
(local variable) bool haveShm
haveShm
);
int
(local variable) int shmCompletionType
shmCompletionType
= -1;
if (
(local variable) bool haveShm
haveShm
&&
char* core.stdc.stdlib.getenv(scope const(char*) name) nothrow @nogc
getenv
("WSI_NO_SHM") !is null)
{
(local variable) bool haveShm
haveShm
= false;
void instrument.emit(scope const(char)* kind) nothrow @nogc

Emit an event with no key=value payload.

emit
("step name=shm_fallback reason=WSI_NO_SHM");
} else if (
(local variable) bool haveShm
haveShm
)
{ // Local: libXext cached the extension info during the query above.
(local variable) int shmCompletionType
shmCompletionType
= XShmGetEventBase(dpy) + ShmCompletion;
undefined identifier `XShmGetEventBase`
void instrument.emitf(scope const(char)* kind, scope const(char)* fmt, ...) nothrow @nogc

Emit an event with a printf-formatted key=value ... payload.

emitf
("step", "name=XShmGetEventBase completion_event=%d rt=0",
(local variable) int shmCompletionType
shmCompletionType
);
} else
void instrument.emit(scope const(char)* kind) nothrow @nogc

Emit an event with no key=value payload.

emit
("step name=shm_fallback reason=extension_absent");
// -- 3. Window (concept 2: Window, an XID minted client-side) ------------ const
(local variable) const(int) width
width
= 480,
(local variable) const(int) height
height
= 320;
Window
(local variable) _error_ win
win
= XCreateSimpleWindow(dpy, root, 0, 0, width, height, 1,
undefined identifier `Window`
undefined identifier `XCreateSimpleWindow`
XBlackPixel(dpy, screen), XWhitePixel(dpy, screen));
void instrument.emitf(scope const(char)* kind, scope const(char)* fmt, ...) nothrow @nogc

Emit an event with a printf-formatted key=value ... payload.

emitf
("step", "name=XCreateSimpleWindow xid=0x%lx rt=0", win);
syncPoint(dpy, "XCreateSimpleWindow"); XStoreName(dpy, win, "Sparkles · X11 F01");
undefined identifier `XStoreName`
step(dpy, "XStoreName", false); syncPoint(dpy, "XStoreName"); // -- 4. Close handshake (concept 3: Atom). XInternAtom carries a reply; // XSetWMProtocols additionally interns WM_PROTOCOLS itself — a *hidden* // second InternAtom round-trip (xtrace-confirmed in ../../scaffold.md). Atom
(local variable) _error_ wmDelete
wmDelete
= XInternAtom(dpy, "WM_DELETE_WINDOW", False);
undefined identifier `Atom`
undefined identifier `XInternAtom`
void instrument.emitf(scope const(char)* kind, scope const(char)* fmt, ...) nothrow @nogc

Emit an event with a printf-formatted key=value ... payload.

emitf
("step", "name=XInternAtom atom=%lu rt=1", wmDelete);
XSetWMProtocols(dpy, win, &wmDelete, 1);
undefined identifier `XSetWMProtocols`
void instrument.emit(scope const(char)* kind) nothrow @nogc

Emit an event with no key=value payload.

emit
("step name=XSetWMProtocols rt=1 note=hidden_InternAtom");
XSelectInput(dpy, win, ExposureMask | StructureNotifyMask);
undefined identifier `XSelectInput`
step(dpy, "XSelectInput", false); XMapWindow(dpy, win);
undefined identifier `XMapWindow`
step(dpy, "XMapWindow", false); syncPoint(dpy, "XMapWindow");
void instrument.emitf(scope const(char)* kind, scope const(char)* fmt, ...) nothrow @nogc

Emit an event with a printf-formatted key=value ... payload.

emitf
("window_created", "xid=0x%lx size=%dx%d", win,
(local variable) const(int) width
width
,
(local variable) const(int) height
height
);
GC
(local variable) _error_ gc
gc
= XDefaultGC(dpy, screen); // concept 5: GC (the default one)
undefined identifier `GC`
undefined identifier `XDefaultGC`
// -- 5. Backbuffer: concepts 6 (XImage*), 7 (ShmSeg XID), 9 (SysV shm // segment, a kernel handle — not an X concept at all). XImage*
(local variable) _error_ ximg
ximg
;
undefined identifier `XImage`
XShmSegmentInfo
(local variable) _error_ shminfo
shminfo
;
undefined identifier `XShmSegmentInfo`
bool
(local variable) bool usingShm
usingShm
= false;
if (
(local variable) bool haveShm
haveShm
)
{ ximg = XShmCreateImage(dpy, visual, cast(uint) depth, ZPixmap, null, &shminfo, width, height); if (ximg !is null) {
void instrument.emitf(scope const(char)* kind, scope const(char)* fmt, ...) nothrow @nogc

Emit an event with a printf-formatted key=value ... payload.

emitf
("step", "name=XShmCreateImage size=%dx%d bpl=%d bpp=%d rt=0",
(local variable) const(int) width
width
,
(local variable) const(int) height
height
, ximg.bytes_per_line, ximg.bits_per_pixel);
const
(local variable) const(_error_) nbytes
nbytes
= cast(
(alias) object.size_t = ulong
size_t
)(ximg.bytes_per_line * ximg.
(field) _error_ ximg.height
height
);
shminfo.shmid = shmget(IPC_PRIVATE, nbytes, IPC_CREAT | 0x180 /* 0600 */ );
void instrument.emitf(scope const(char)* kind, scope const(char)* fmt, ...) nothrow @nogc

Emit an event with a printf-formatted key=value ... payload.

emitf
("step", "name=shmget shmid=%d bytes=%zu rt=kernel", shminfo.shmid, nbytes);
if (shminfo.shmid >= 0) { shminfo.shmaddr = cast(char*) shmat(shminfo.shmid, null, 0);
void instrument.emitf(scope const(char)* kind, scope const(char)* fmt, ...) nothrow @nogc

Emit an event with a printf-formatted key=value ... payload.

emitf
("step", "name=shmat ok=%d rt=kernel",
cast(int)(shminfo.shmaddr !is cast(char*)-1)); if (shminfo.shmaddr !is cast(char*)-1) { ximg.
ximg.data
data
= shminfo.shmaddr;
shminfo.readOnly = False; XShmAttach(dpy, &shminfo);
undefined identifier `XShmAttach`
void instrument.emit(scope const(char)* kind) nothrow @nogc

Emit an event with no key=value payload.

emit
("step name=XShmAttach rt=0");
// The one deliberate round-trip of SHM setup: the server // must have attached before we mark-for-delete, so the // kernel reclaims the segment even if we crash. const
(local variable) const(long) t0
t0
=
long instrument.nowUs() nothrow @nogc

Microseconds elapsed since initInstrument.

nowUs
();
XSync(dpy, False);
undefined identifier `XSync`
void instrument.emitf(scope const(char)* kind, scope const(char)* fmt, ...) nothrow @nogc

Emit an event with a printf-formatted key=value ... payload.

emitf
("step", "name=XSync rt=1 us=%lld",
long instrument.nowUs() nothrow @nogc

Microseconds elapsed since initInstrument.

nowUs
() -
(local variable) const(long) t0
t0
);
shmctl(shminfo.shmid, IPC_RMID, null);
undefined identifier `shmctl`
void instrument.emit(scope const(char)* kind) nothrow @nogc

Emit an event with no key=value payload.

emit
("step name=shmctl_IPC_RMID rt=kernel");
(local variable) bool usingShm
usingShm
= true;
} else shmctl(shminfo.shmid, IPC_RMID, null);
undefined identifier `shmctl`
} if (!
(local variable) bool usingShm
usingShm
)
{ ximg.f.destroy_image(ximg); // XDestroyImage is a macro ximg = null; } } if (!
(local variable) bool usingShm
usingShm
)
void instrument.emit(scope const(char)* kind) nothrow @nogc

Emit an event with no key=value payload.

emit
("step name=shm_fallback reason=alloc_or_attach_failed");
} if (!
(local variable) bool usingShm
usingShm
)
{ import
(package) core
core
.
(package) core.stdc
stdc
.
(module) core.stdc.stdlib

D header file for C99.

pubs.opengroup.org/onlinepubs/009695399/basedefs/stdlib.h.html, stdlib.h

Source

core/stdc/stdlib.d

@copyrightCopyright Sean Kelly 2005 - 2014.@licenseDistributed under the Boost Software License 1.0. (See accompanying file LICENSE)@authorsSean Kelly@standardsISO/IEC 9899:1999 (E)
stdlib
:
(alias) malloc = void* core.stdc.stdlib.malloc(ulong size) nothrow @nogc
malloc
;
auto
(local variable) char* data
data
= cast(char*)
void* core.stdc.stdlib.malloc(ulong size) nothrow @nogc
malloc
(cast(
(alias) object.size_t = ulong
size_t
)
(local variable) const(int) width
width
*
(local variable) const(int) height
height
* 4);
ximg = XCreateImage(dpy, visual, cast(uint) depth, ZPixmap, 0, data, width, height, 32, 0);
void instrument.emitf(scope const(char)* kind, scope const(char)* fmt, ...) nothrow @nogc

Emit an event with a printf-formatted key=value ... payload.

emitf
("step", "name=XCreateImage size=%dx%d bpl=%d bpp=%d rt=0",
(local variable) const(int) width
width
,
(local variable) const(int) height
height
, ximg.bytes_per_line, ximg.bits_per_pixel);
} scope (exit) { if (
(local variable) bool usingShm
usingShm
)
{ XSync(dpy, False); // drain the in-flight put before detaching
undefined identifier `XSync`
XShmDetach(dpy, &shminfo);
undefined identifier `XShmDetach`
} ximg.f.destroy_image(ximg); if (
(local variable) bool usingShm
usingShm
)
shmdt(shminfo.shmaddr);
undefined identifier `shmdt`
XDestroyWindow(dpy, win);
undefined identifier `XDestroyWindow`
XCloseDisplay(dpy);
undefined identifier `XCloseDisplay`
} // -- 6. Wait for Expose (the server's "draw now" signal), present once, // and wait for the confirmation event. concept 8: XEvent. const
(local variable) const(_error_) fd
fd
= XConnectionNumber(dpy);
undefined identifier `XConnectionNumber`
bool
(local variable) bool exposed
exposed
= false,
(local variable) bool presented
presented
= false,
(local variable) bool confirmed
confirmed
= false;
bool
(local variable) bool sawFirstConfigure
sawFirstConfigure
= false;
while (!
(local variable) bool confirmed
confirmed
)
{ while (XPending(dpy) > 0) // XPending flushes the output buffer
undefined identifier `XPending`
{ XEvent
(local variable) _error_ ev
ev
;
undefined identifier `XEvent`
XNextEvent(dpy, &ev);
undefined identifier `XNextEvent`
switch (ev.type) { case MapNotify: // No WM: MapNotify (not ConfigureNotify) is the first // structure event — waiting for ConfigureNotify deadlocks. if (!sawFirstConfigure) { sawFirstConfigure = true; emitf("first_configure", "kind=MapNotify size=%dx%d", width, height); } else emit("map_notify"); break; case ConfigureNotify: // only under a WM (reparent/placement) if (!sawFirstConfigure) { sawFirstConfigure = true; emitf("first_configure", "kind=ConfigureNotify size=%dx%d send_event=%d", ev.xconfigure.
ev.xconfigure.width
width
, ev.xconfigure.
ev.xconfigure.height
height
,
cast(int) ev.xany.send_event); } else emitf("configure_notify", "size=%dx%d send_event=%d", ev.xconfigure.
ev.xconfigure.width
width
, ev.xconfigure.
ev.xconfigure.height
height
,
cast(int) ev.xany.send_event); break; case Expose: emitf("expose", "count=%d area=%dx%d+%d+%d", ev.xexpose.count, ev.xexpose.
ev.xexpose.width
width
, ev.xexpose.
ev.xexpose.height
height
, ev.xexpose.
ev.xexpose.x
x
, ev.xexpose.
ev.xexpose.y
y
);
if (ev.xexpose.count == 0) exposed = true; break; default: if (usingShm && ev.type == shmCompletionType) { // The server finished *reading* the segment. This is the // strongest confirmation core X11 + MIT-SHM offers; it is // still not "on glass" — that needs the Present extension. const
_error_ sh
sh
= cast(const XShmCompletionEvent*)&ev;
emitf("first_pixel_presented", "method=XShmCompletionEvent drawable=0x%lx", sh.drawable); confirmed = true; } break; } } if (
(local variable) bool exposed
exposed
&& !
(local variable) bool presented
presented
)
{ drawGradient(ximg); if (
(local variable) bool usingShm
usingShm
)
{ XShmPutImage(dpy, win, gc, ximg, 0, 0, 0, 0,
undefined identifier `XShmPutImage`
width, height, True); // send_event=True -> completion event XFlush(dpy); // push the put before sleeping in poll()
undefined identifier `XFlush`
void instrument.emit(scope const(char)* kind) nothrow @nogc

Emit an event with no key=value payload.

emit
("step name=XShmPutImage rt=0 send_event=1");
} else { XPutImage(dpy, win, gc, ximg, 0, 0, 0, 0, width, height);
undefined identifier `XPutImage`
void instrument.emit(scope const(char)* kind) nothrow @nogc

Emit an event with no key=value payload.

emit
("step name=XPutImage rt=0");
const
(local variable) const(long) t0
t0
=
long instrument.nowUs() nothrow @nogc

Microseconds elapsed since initInstrument.

nowUs
();
XSync(dpy, False); // no completion contract: round-trip instead
undefined identifier `XSync`
void instrument.emitf(scope const(char)* kind, scope const(char)* fmt, ...) nothrow @nogc

Emit an event with a printf-formatted key=value ... payload.

emitf
("step", "name=XSync rt=1 us=%lld",
long instrument.nowUs() nothrow @nogc

Microseconds elapsed since initInstrument.

nowUs
() -
(local variable) const(long) t0
t0
);
// Proves the server *processed* the put — nothing more.
void instrument.emit(scope const(char)* kind) nothrow @nogc

Emit an event with no key=value payload.

emit
("first_pixel_presented method=XPutImage_XSync");
(local variable) bool confirmed
confirmed
= true;
}
(local variable) bool presented
presented
= true;
void instrument.emitf(scope const(char)* kind, scope const(char)* fmt, ...) nothrow @nogc

Emit an event with a printf-formatted key=value ... payload.

emitf
("frame_callback", "t=%lld frame=1 size=%dx%d",
long instrument.nowUs() nothrow @nogc

Microseconds elapsed since initInstrument.

nowUs
(),
(local variable) const(int) width
width
,
(local variable) const(int) height
height
);
} if (!
(local variable) bool confirmed
confirmed
)
{ pollfd
(local variable) _error_ pfd
pfd
;
undefined identifier `pollfd`
pfd.
pfd.fd
fd
= fd;
pfd.events = POLLIN; pfd.revents = 0; poll(&pfd, 1, 1000); // bounded: a silent server can't hang the demo
undefined identifier `poll`
if (
long instrument.nowUs() nothrow @nogc

Microseconds elapsed since initInstrument.

nowUs
() > 5_000_000)
{
void instrument.emit(scope const(char)* kind) nothrow @nogc

Emit an event with no key=value payload.

emit
("auto_exit reason=timeout");
return 1; } } } // concepts: Display*, Window, Atom, Visual*, GC, XImage*, XEvent = 7; // MIT-SHM adds the ShmSeg XID and the kernel shm segment = 9.
void instrument.emitf(scope const(char)* kind, scope const(char)* fmt, ...) nothrow @nogc

Emit an event with a printf-formatted key=value ... payload.

emitf
("summary", "concepts=%d loc=%d init_to_pixel_us=%lld",
(local variable) bool usingShm
usingShm
? 9 : 7,
(constant) int app.locCount = 359

This file's line count — the F01 LOC figure (excludes instrument.d / c.c). Keep in sync with wc -l app.d.

locCount
,
long instrument.nowUs() nothrow @nogc

Microseconds elapsed since initInstrument.

nowUs
());
void instrument.emit(scope const(char)* kind) nothrow @nogc

Emit an event with no key=value payload.

emit
("teardown");
return 0; }