[PATCH] plugins/lockstep: document plugin logging requirement

Dalbir Singh <[email protected]>
Newsgroups org.nongnu.qemu-devel
Message-ID <CAAJFZSZ+2tzVSyfe983Q=d14Xcmu0a3H41-2NdNvv0pDqUViLA@mail.gmail.com>
plugins/lockstep: document plugin logging requirement

qemu_plugin_outs() output from this plugin — including the
"No divergence :-)" summary and any divergence reports — is routed
through qemu_log_mask(CPU_LOG_PLUGIN, ...), which is silent unless
QEMU's own logging is enabled. A user running the plugin exactly as
shown in this file's own usage will see no output at all and can
reasonably conclude the plugin is doing nothing.

Document that -d plugin -D <logfile> is required to see any output.

Found via manual, reproducible experimentation (deterministic guest
binary, controlled single-instruction divergence, TB-address and
instruction-count cross-checked against objdump) with AI (Claude)
assistance in the investigation; the missing-output behavior and the
fix were independently verified by hand before this patch was written.

Signed-off-by: Dalbir <[email protected]>

diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c
index xxxxxxx..xxxxxxx 100644
--- a/contrib/plugins/lockstep.c
+++ b/contrib/plugins/lockstep.c
@@ -7,6 +7,12 @@
  * introduced a subtle and hard to find bug.
  *
  * Caveats:
+ *   - qemu_plugin_outs() output (including "No divergence :-)" and any
+ *     divergence reports) is routed through the plugin log mask, so it is
+ *     silent unless QEMU's own logging is enabled, e.g.:
+ *         -d plugin -D /path/to/logfile
+ *     Without -d plugin, the plugin runs and compares correctly but
+ *     produces no visible output at all.
  *   - single-threaded linux-user apps only with non-deterministic syscalls
  *   - no MTTCG enabled system emulation (icount may help)
  *
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.