summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-03-31Implement recordingstaging/cWill Thompson8-41/+555
2019-03-26pcap-monitor: clear G_MESSAGES_DEBUG from environmentWill Thompson1-0/+1
g_log_default_handler() is documented to write INFO and DEBUG messages to stdout. flatpak-spawn emits such messages if run with G_MESSAGES_DEBUG=all, and its stdout is by necessity shared with its child. In this case, the child is dbus-monitor. Running Bustle with G_MESSAGES_DEBUG=all in a Flatpak sandbox, then trying to record a log, would cause the pcap-format message stream to be interleaved with output like: ** (flatpak-spawn:116): DEBUG: 21:54:39.917: child_pid: 25091 and libpcap complains that 2a 2a 20 28 is not a known format header.
2019-03-26Show load errors in infobarWill Thompson2-16/+57
2019-03-22Add new Flatpak manifest, build it in CIWill Thompson2-25/+62
2019-03-22Don't share owned_names values across copy()Will Thompson1-37/+81
Previously, owned_names itself was copied, but the GHashTables which are its values were not. This means that name ownership changes would affect previous instances in the chain. As explained in the TODO, we could do this more lazily for a potentially-large memory saving. (In fact, I thought I had done so already, but no.) Let's do it the memory-hungry and slow but safe way for now.
2019-03-21Draw signals properlyWill Thompson1-26/+57
2019-03-21Track adjacent NameModels explicitlyWill Thompson4-68/+139
The previous scheme worked fine for the unfiltered log but will not work when filtering is introduced, because the row where the state is BUSTLE_NAME_MODEL_LANE_STATE_NEW or BUSTLE_NAME_MODEL_LANE_STATE_CLOSING may be filtered out.
2019-03-21Intern search index termsWill Thompson2-8/+4
This is largely an excuse to use GRefString
2019-03-21Rename main executable to 'bustle'Will Thompson1-7/+6
2019-03-21Find libpcap using pkg-configWill Thompson1-2/+1
At some point in the past 10 years, it's grown a .pc file.
2019-03-21Reimplement core functionality in CWill Thompson16-2/+3177
Obviously I did not write this all in one go, but I didn't preserve my incremental work. bustle-window.ui is almost unmodified from data/bustle.ui, and the build system builds the existing C code, but otherwise it's all new. The key part is that the log is represented as a GtkTreeModel (specifically a GtkListStore) with references between method calls and the corresponding reply¹ are represented with a GtkTreeRowReference. The chart is drawn using a GtkTreeView and a custom renderer that renders one horizontal stripe of the chart at a time. The approach (and the colour scheme for the lanes) is inspired by gitg. The current name-ownership state is tracked explicitly for each row of the diagram (using an externally-immutable data structure, naturally). By using the GtkTreeView machinery, we get many things essentially for free that I've failed to implement in the old codebase for over a decade, including type-ahead search (30 minutes) and selection tracking (surely less buggy than my implementation). There are many missing features: - None of the UI is wired up outside the diagram itself and the details pane. This is just a matter of typing. - The rendering of each message is incomplete: undirected signals are simply not drawn, for example. - Support for showing system and session bus logs side-by-side. I think this will be relatively straightforward: it's just™ a matter of a few extra model columns and another TreeViewColumn. I have not worked out how to fit some aspects of the old diagram into the new world order: - Arcs between method calls and the reply are really hard to do when you fundamentally don't know where the other side will be. I was always very unsatisfied with how this looked for very busy diagrams in the old codebase so maybe I can find another way to display this anyway. - Headers for each "lane" in the diagram, showing which name(s) it owns. Again, I was never satisfied with how it looked before (taking only the last component of each name worked fine for Telepathy but is useless in many other cases) so I think this will just stay unimplemented. I'll either add a colour-coded legend, or something to the details pane, or both. ¹ or replies: the edge case where more than one reply is seen for a given message is handled
2019-03-13Add DOAP fileWill Thompson2-0/+24
This is used by tools like GNOME Builder to show some project metadata.
2019-03-08Bump version to 0.7.5.1Will Thompson1-1/+1
2019-03-08News for 0.7.5bustle-0.7.5Will Thompson3-2/+21
2019-03-08Don't check in messages.potWill Thompson4-328/+1
It's traditional not to do this because of the likelihood that it will drift out of date. This does make life a little harder for translators, but we've never seen one in half a decade...
2019-03-07Renderer: build fake names more quietlyWill Thompson1-15/+7
This is expected, not an error. We can also just track the next available fake name, rather than scanning the map each time.
2019-03-07Renderer: use Data.Map.StrictWill Thompson1-2/+2
We don't need any of these maps to be lazy; they will all be fully-evaluated.
2019-03-07Pcap: drop unused importsWill Thompson1-6/+1
2019-03-07Update diagram immediately when filter changesWill Thompson2-17/+11
2019-03-07FilterDialog: update Reset button state more efficientlyWill Thompson2-24/+50
A step towards updating the diagram immediately, too.
2019-03-07Support "positive" filteringWill Thompson5-51/+145
Previously, the filtering mechanism was “hide all messages which involve one of these names”, although the dialog presented them in the opposite sense. I often want to say something a bit different: “show only messages which involve one of these names”. Implement this with three states for each name: Default, Only, and Never. The logic for each message is: * If it involves at least one Never name, hide it * If there are no Only names, show it * Otherwise, show it if it involves at least one Only name
2019-03-07Modernize filter dialogWill Thompson3-48/+111
Unfortunately, setting border-width=0 on the GtkDialog's internal vbox child is deleted by a round-trip though Glade, so one needs to be careful with that!
2019-03-07icons: scale SVGs to 256×256pxWill Thompson2-98/+103
This is the maximum size for scalable images according to /usr/share/icons/hicolor/index.theme; at some point, Flatpak got more militant about enforcing this.
2019-03-07icons: switch SVGs from 90 DPI to 96 DPIWill Thompson2-30/+29
When opening these icons, Inkscape reports: $FILENAME was created in an older version of Inkscape (90 DPI) and we need to make it compatible with newer versions (96 DPI). with a link to https://inkscape.org/en/learn/faq#dpi_change for more details. These are intended for screen display, so I picked the option to not rescale at all; in practice this did cause the XML to be rewritten in mostly-harmless ways.
2019-03-01Update INSTALL.mdWill Thompson1-38/+28
2018-12-07Merge branch 'placate-hlint' into 'master'Will Thompson2-26/+18
Placate hlint See merge request bustle/bustle!13
2018-12-07details: silence hlint complaning about a redundant 'do'Will Thompson1-9/+7
This isn't the change hlint proposed, but it eliminates binding and immediately deconstructing 's_'.
2018-12-07details: simplify showing verbatim error messageWill Thompson1-16/+10
hlint complained about some of this, and while I was looking into it I noticed an existing TODO. This way is neater.
2018-12-07cabal: bump version to 0.7.4.1Will Thompson1-1/+1
2018-12-07Merge commit '4aaba6f'Will Thompson11-77/+291
I made the 0.7.4 release from a diverged local branch. :(
2018-12-07Update messages.potbustle-0.7.4Will Thompson1-14/+26
2018-12-07News for 0.7.4Will Thompson3-1/+26
2018-12-07monitor: use a PTY to send SIGINT to privileged childWill Thompson1-18/+117
Previously, we sent SIGKILL directly to the child process. If we're monitoring the system bus, the child process is owned by root, so the parent process can't send it signals. In this case, we relied on the child process dying with "Broken pipe" when it next tries to write to stdout (which we close). If you run `pkexec dbus-monitor --system` in a terminal, you are able to press Ctrl-C to send SIGINT to that privileged child process. This is because the signal is not sent directly. Instead, the terminal emulator writes ^C to the child's controlling terminal; the kernel turns this into SIGINT and send that to the child. We can do the same thing here. Here are the steps: * Create a pseudo-terminal (PTY) master/slave (not my terminology) pair * Make this PTY the controlling terminal for the child process: * Make the slave FD the stdin for the child * In a GSubprocessLauncher child_setup function, which runs between fork() and exec(): * Move the process to a new session with setsid(), removing any existing controlling terminal * Call ioctl(STDIN_FILENO, TIOCSCTTY, 0) to set the stdin FD as the controlling terminal * When it comes time to kill the child, write ^C into the master side of the PTY We continue to send SIGINT (rather than SIGKILL; it seems kinder) the old-fashioned way (in case something goes wrong setting the controlling terminal) and closing the pipe so that the child eventually dies with EPIPE (in case the old-fashioned way fails too). A potential fly in the works is that, in the Flatpak case, the immediate child is a flatpak-spawn process; `pkexec dbus-monitor --system` is actually launched from the session helper. Happily, the session helper already calls setsid() + TIOCSCTTY if any of stdin/stdout/stderr on the spawned process are TTYs <https://github.com/flatpak/flatpak/blob/1.0.1/session-helper/flatpak-session-helper.c#L182-L202> so we just skip the child_setup function in that case. See https://blog.nelhage.com/2011/02/changing-ctty/ for some useful background reading on controlling terminals.
2018-12-07bustle-pcap: include newline on startup errorsWill Thompson1-5/+4
2018-12-07pcap-monitor: factor out building argv and spawning subprocessWill Thompson1-15/+34
2018-12-07Remove references to freedesktop.org/wiki/Software/BustleWill Thompson4-9/+3
That page just points to https://gitlab.freedesktop.org/bustle/bustle now!
2018-12-07details: show error message verbatimWill Thompson1-1/+11
(Valid) error replies always have exactly one string argument; it's much more legible if we show it without the @s annotation and backslash-escapes inside the string.
2018-12-07Show error name in detailsWill Thompson2-14/+68
For some reason I've never noticed this was missing before!
2018-11-29Merge branch 'lc/nix' into 'master'Will Thompson2-3/+4
Add nix compatibility See merge request bustle/bustle!12
2018-11-29Add nix compatibilityDaniel Firth1-1/+2
2018-11-29Bump to stack lts-12.20Daniel Firth2-2/+2
2018-11-22Use .pcap extension by defaultWill Thompson1-1/+1
2018-11-20appdata: split <id>/<launchable>, add <content_rating>Will Thompson1-1/+3
2018-11-15Update release instructionsWill Thompson1-1/+4
2018-11-15Bump to development version 0.7.3.1Will Thompson1-1/+1
2018-11-15Release 0.7.3bustle-0.7.3Will Thompson3-3/+4
2018-11-15Update messages.potWill Thompson1-18/+39
2018-11-14Update NEWS and AppDataWill Thompson2-0/+12
2018-11-14Update to Haskell Platform 8.4.3Will Thompson1-8/+8
2018-11-14.desktop: handle application/vnd.tcpdump.pcap filesWill Thompson1-1/+2