dtactivity: the activity window (t0091)

A table of the processes -- PID, name, user, % CPU since the last sample,
threads, real and virtual memory -- sorted by the column title you click; Show
(all, mine, system), a filter, Quit Process (asks; SIGTERM; Force Quit SIGKILL)
and Inspect; and under it four tabs, CPU, System Memory, Disk Activity and
Network, with the numbers and a three-minute history graph.  All of it through
McdeSys (processes, CPU times, memory, disk and network counters, signals, the
commits of 2026-11-14/15); no ps(1), no top(1).  New program: programs/
dtactivity (Makefile.am, programs/Makefile.am, configure.ac, PLIST line
dt/bin/dtactivity; make mcde-linux plist: ok).

Frugal, as t0080 asks: one timer, 2 s, only while the window is mapped and not
fully obscured.  Measured with strace -c -f -p for 15 s: 2349 system calls
visible, 0 unmapped (xdotool windowunmap), 0 with an override-redirect window
over the whole screen, 2365 shown again.  Control: an idle sleep gives the same
empty summary, a process that makes calls does not.

Quit Process measured against real processes in a PID namespace (unshare -rpf
--mount-proc: only the test session's processes exist, so neither the tests nor
the screenshot show the host's): Cancel leaves a process alive, Quit ends it, a
process that ignores SIGTERM survives Quit and is ended by Force Quit.  Filter
and column sorting seen in screenshots (the committed image is the CPU tab with
two busy loops and the 24 MB/s of a disk writer in the other tab).  Cross
compile for NetBSD (x86_64--netbsd-gcc -Wall -Wextra): no diagnostic.  The
"Cannot convert string mcde to type FontStruct" warning is the shared
*renderTable fallback: dtimage prints it too.

Not built: Show "with window", the global menu, Cmd+F and Cmd+1..5, the
administrator's way for another user's process (t0079; it says "belongs to
somebody else"), a legend for the graph colours, the dtappscan entry; the NetBSD
backends of the numbers were never run.  Sorting by clicking a header was not
exercised by a script (the layout was); the default sort (CPU, descending) is
what the screenshots show.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
lotherkandClaude Sonnet 5.5 committed 2026-11-15 05:20:01 +00:00
1 parent 6676102ec8
commit 5ea507d4dc
6 files changed
+1087 -1

No files matched your search

+25
View File
@@ -261,6 +261,31 @@ narratives and test notes, is `docs/reference/mcde-agents-history-2026-11-13.txt
sysctl net.inet.tcp.pcblist on NetBSD is the follow-up). Ping, traceroute,
whois and a port scan need privileges or a network a test session does not
have; they are named as follow-ups in the program's comment.
- **dtactivity** (`programs/dtactivity`, t0091): the activity window. A
table of the processes (PID, name, user, % CPU since the last sample,
threads, real and virtual memory) that sorts by the column title you click
(the header is one label of the list's fixed font, the click is mapped to a
column by character width); Show (all, mine, system: uid below 1000) and a
filter (name, user or pid, any case); Quit Process (asks, SIGTERM; Force
Quit, SIGKILL) and Inspect (parent, user, state, memory, CPU time, command
line); and under it CPU, System Memory, Disk Activity and Network with the
numbers and a three-minute history graph (XFillRectangle, no animation).
Everything is McdeSys: `mcde_sys_processes`, `_cpu_times`, `_memory`,
`_disk_io`, `_net_io`, `_signal` -- no ps(1), no top(1). A disk that stands
on another (dm-, md, NetBSD wedges dk) is not added up; the loopback is not
in the Network numbers. **One timer, 2 s, only while the window is mapped
and not fully obscured** (MapNotify/UnmapNotify, VisibilityNotify).
Measured with `strace -c -f -p` for 15 s: 2349 system calls visible, **0
unmapped, 0 fully covered** (an override-redirect window over the screen),
2365 when shown again; an idle `sleep` gives the same empty summary, a busy
process does not. Quit/Force Quit measured against real processes in a PID
namespace (`unshare -rpf --mount-proc`, which also keeps the host's
processes out of screenshots): Cancel leaves a process alive, Quit ends it,
a process that ignores SIGTERM survives Quit and dies of Force Quit. Not
built yet: Show "with window", the global menu, Cmd+F and Cmd+1..5, the
administrator's way for another user's process (t0079: it says "belongs to
somebody else"), a legend for the graph colours, and the dtappscan entry.
The NetBSD backends of the numbers were never run.
- **Device events** (`mcde_sys_disk_events`, `lib/McdeSys/events.c`): a
non-blocking descriptor of the kernel's uevent socket (Linux, AF_NETLINK
NETLINK_KOBJECT_UEVENT group 1) for the programs that must know when a
+1
View File
@@ -923,6 +923,7 @@ programs/dtphoto/Makefile
programs/dtconsole/Makefile
programs/dtnetutility/Makefile
programs/dtimage/Makefile
programs/dtactivity/Makefile
programs/dtcmprefs/Makefile
programs/dtpaint/Makefile
programs/dttoolbox/Makefile
+1
View File
@@ -2568,6 +2568,7 @@ dt/bin/dthelpprint.sh
${PLIST.docs}dt/bin/dthelptag
dt/bin/dthelpview
dt/bin/dticon
dt/bin/dtactivity
dt/bin/dtimage
dt/bin/dtimsstart
dt/bin/dtinfo
+1 -1
View File
@@ -6,7 +6,7 @@ SUBDIRS = backdrops icons dsdm dtmail dtpad dtfile dterror dtwm dtlogin \
palettes dtappintegrate dtprintegrate dtconfig \
dtcreate dtprintinfo fontaliases dtdspmsg dtimsstart \
dtpdm dtsr dtpdmd dtinfo types tttypes util dtopen localized \
dthelp dtdocbook dtlaunch dtbar dtsystemsettings dtdiskutility dtbackup dtappscan dtkeys dtthemesync dtphoto dtpaint dttoolbox mcdesoundd dtconsole dtnetutility dtimage dtcmprefs
dthelp dtdocbook dtlaunch dtbar dtsystemsettings dtdiskutility dtbackup dtappscan dtkeys dtthemesync dtphoto dtpaint dttoolbox mcdesoundd dtconsole dtnetutility dtimage dtcmprefs dtactivity
# The application builder and ttsnoop, its demonstration, need dtcodegen, a
# program the build runs: not in a cross build (--disable-appbuilder; the native
+14
View File
@@ -0,0 +1,14 @@
MAINTAINERCLEANFILES = Makefile.in
bin_PROGRAMS = dtactivity
dtactivity_CPPFLAGS = -I$(top_srcdir)/include \
-DCDE_INSTALLATION_TOP=\"$(CDE_INSTALLATION_TOP)\"
dtactivity_LDADD = $(LIBMCDESYS) $(DTCLIENTLIBS) $(XTOOLLIB)
dtactivity_SOURCES = dtactivity.c
if SOLARIS
dtactivity_LDADD += -lintl
endif
File diff suppressed because it is too large. Load diff