🔇 Move the library's per-event info lines to debug

No line at info may fire per present, frame, ring message or other
per-event path. Measured on development: an arm64 macOS 27.0.1 boot
logged 1326 lines, 867 of them the display's change of IOSurface at
WindowServer's presents and 396 library lookups; an x86 macOS 26.7.2 boot
on the 780M logged 3248, 1296 and 349.

- The display's change between IOSurfaces, each library lookup, each
  shared event named or made from another process's, and each queue made
  unshared are debug lines, the first, second and last under targets of
  their own that the lane gate's and check-boot's runs name at debug:
  reims_vgpu::graphics::shown (msi-drag.py times composites by it),
  ::library (msi-boot.sh's launch gaps) and ::queues (its count). The
  display's change between the scanout and a surface stays at info.
- reims-vgpu-graphics' lines of a reset and a context's close, which
  reims-vgpu's own repeat with what they let go of, are debug; its line of
  completion records handed over, once a second, is info the first time.
- The surface order's and the IOSurface views' summaries come at most
  once a minute, not at every 4096th command buffer or 256th
  SURFACE_PAGES; check-boot.sh reads the caches' count up to a minute old.
- A long wait's end, a CPU wait's end or its cut at a reset, and a
  newLibraryWithData: of bytes Metal refuses too are debug; the CPU wait's
  lines lose the runs of spaces their strings held.
- A fold at the views' budget, and the video arms' first picture of each
  way, frame of each outcome and reason of each fallback, are info once
  per process (their kind), not once per session.
This commit is contained in:
Anees Iqbal committed 2026-11-11 03:44:57 -08:00
1 parent f131db7751
commit f754939907
16 files changed
+138 -85

No files matched your search

+14 -5
View File
@@ -1452,7 +1452,8 @@ impl Shared {
// message in flight comes before it.
self.lanes.wait_begun(self.epoch.load(Ordering::Acquire));
self.host.device_reset();
log::info!(target: "reims_vgpu_graphics", "the device was reset");
// At debug: reims-vgpu's own line of the reset, at info, carries its counts.
log::debug!(target: "reims_vgpu_graphics", "the device was reset");
}
}
@@ -1760,7 +1761,8 @@ impl Shared {
});
}
self.host.context_closed(context, answer);
log::info!(target: "reims_vgpu_graphics", "context {context} closed");
// At debug: reims-vgpu's own line of the close, at info, says what it let go of.
log::debug!(target: "reims_vgpu_graphics", "context {context} closed");
}
/// `BLOCK_GRANT`: the region keeps the block as its context's, where it lies in the
@@ -2814,8 +2816,9 @@ impl Shared {
/// Posts the records handed over on `queue`'s ring, oldest first, until none is left, with
/// no lock held across a post; one posted after a reset since it was handed over is dropped
/// as a post drops it. At most once a second, says at info how many were handed over in all,
/// and the longest one waited for a thread to take it since the last line.
/// as a post drops it. At most once a second, says how many were handed over in all, and the
/// longest one waited for a thread to take it since the last line: the process's first such
/// line at info, a path a guest's load takes, and the later ones at debug.
fn post_handed(&self, queue: &QueueShared) {
loop {
let (message, epoch, at) = {
@@ -2844,8 +2847,14 @@ impl Shared {
.is_ok()
{
let waited = self.handed_wait_ns.swap(0, Ordering::Relaxed);
log::info!(
let level = if last == 0 {
log::Level::Info
} else {
log::Level::Debug
};
log::log!(
target: "reims_vgpu_graphics::handed",
level,
"{} completion records handed over to the queues' threads in all, from threads \
that may not post them; the longest wait for a thread to post one since the \
last line: {} us",
+2 -2
View File
@@ -1390,8 +1390,8 @@ impl GpuDevice<VulkanPlatform> for VulkanDevice {
e @ rt::Error::Compile(metal2vulkan::error::Error::InvalidInput(_)),
) => {
// Metal's NSError names no cause; the runtime's names its check and
// the offset in the file.
log::info!(
// the offset in the file. At debug: a guest call Metal refuses too.
log::debug!(
target: "reims_vgpu_vulkan::gpu",
"{sel} refused {} bytes as no metallib: {e}",
data.len()
+2 -1
View File
@@ -207,8 +207,9 @@ fn fold_within(within: std::ops::Range<u64>) -> u64 {
AT_LIMIT.with(|a| a.set(outer));
let freed = before.saturating_sub(files::mappings());
if freed > 0 {
// A fallback a guest's load reaches: at info once per process (`kind`), later at debug.
log::info!(
target: "reims_vgpu_vulkan::os",
target: "reims_vgpu_vulkan::os", kind = "fold";
"at the views' budget (vm.max_map_count): {freed} of the views' {before} mappings \
freed by mapping the pages no import holds through dma-bufs"
);
+16 -5
View File
@@ -877,11 +877,20 @@ impl<P: Platform> Presented<P> {
/// the texture shown before, for [`Self::show`]'s caller.
fn swap(&self, id: u32, texture: Option<ShownTexture<P>>) -> Option<Arc<DisplayHold>> {
let previous = self.surface_id.swap(id, Ordering::AcqRel);
if previous != id {
// A guest that draws into a few IOSurfaces in turn (WindowServer's three) changes the
// surface shown at every present, so each change is a debug line of its own target, which
// a run that counts the display's flips names (`reims_vgpu::graphics::shown=debug`); only
// a change between the scanout and a surface is an info line too.
if previous != id && (previous == 0 || id == 0) {
log::info!(
target: "reims_vgpu::graphics",
"the display shows IOSurface {id} (was {previous}; 0 is the scanout)"
);
} else if previous != id {
log::debug!(
target: "reims_vgpu::graphics::shown",
"the display shows IOSurface {id} (was {previous}; 0 is the scanout)"
);
}
// The texture shown before may be the last hold of a closed context's: let go of in a
// refusal scope, so a release the platform dies at is refused, logged, and the present
@@ -1761,8 +1770,10 @@ impl<P: ApiPlatform> GraphicsControl<P> {
});
let (obj_id, size) = RgfxLibraryLookup::read_from_prefix(message)
.map_or((0, 0), |(m, _)| (m.obj_id, m.slice_size));
log::info!(
target: "reims_vgpu::graphics",
// Each guest process's library lookups: a debug line of its own target, which a run that
// times the guest's launches names (`reims_vgpu::graphics::library=debug`).
log::debug!(
target: "reims_vgpu::graphics::library",
"library lookup (object {obj_id:#x}, {size} bytes): {}",
if status == RGFX_STATUS_OK { "hit" } else { "miss" }
);
@@ -1806,7 +1817,7 @@ impl<P: ApiPlatform> GraphicsControl<P> {
(self.decoders).sender(Some(sender_context(poster, message)), Sinks::default());
if ty == RGFX_CMD_SHARED_EVENT_NAME {
let (seqno, status) = entry::run(|_| decoder.name_shared_event(message, listen));
log::info!(
log::debug!(
target: "reims_vgpu::graphics",
"shared event {obj_id:#x} named for other processes: status {status}"
);
@@ -1816,7 +1827,7 @@ impl<P: ApiPlatform> GraphicsControl<P> {
} else {
let answer = entry::run(|_| decoder.import_shared_event(message, listen));
if let Some(answer) = answer {
log::info!(
log::debug!(
target: "reims_vgpu::graphics",
"shared event {obj_id:#x} made from another process's: status {}, value {}",
answer.status,
@@ -1601,7 +1601,14 @@ impl<P: Platform> GraphicsDecoder<P> {
// off it (`surface_order`).
let order_waits = match &take.order {
Some(waits) => {
(self.shared.surface_order.lock()).before(device, m.queue_obj_id, &cb, waits)?
let now = self.shared.platform.clock().now_mono();
(self.shared.surface_order.lock()).before(
device,
m.queue_obj_id,
&cb,
waits,
now,
)?
}
None => Vec::new(),
};
+26 -38
View File
@@ -558,15 +558,12 @@ pub enum DecodeError {
ContextClosed,
}
/// How many `SURFACE_PAGES` pass between the logs of what the surface views did, at most
/// ([`views_log_due`]).
const VIEWS_LOGGED_EVERY: u64 = 256;
/// The longest the logs of what the surface views did wait for [`VIEWS_LOGGED_EVERY`]
/// `SURFACE_PAGES`: the first after it logs them too. Where dormant blocks keep most device
/// caches, a desktop makes a few new ones a second, and 256 `SURFACE_PAGES` took minutes, so the
/// lines bounded the caches' rates and never gave them. The kext logs its dormant blocks on the
/// How long the logs of what the surface views did wait after the last: the first
/// `SURFACE_PAGES` after it logs them ([`views_log_due`]). A summary at info comes at most once a
/// minute, however many `SURFACE_PAGES` a desktop's churn sends (docs/conventions.md); a run
/// that reads the counts reads lines up to a minute old. The kext logs its dormant blocks on the
/// same interval.
const VIEWS_LOGGED_AFTER: std::time::Duration = std::time::Duration::from_secs(10);
const VIEWS_LOGGED_AFTER: std::time::Duration = std::time::Duration::from_secs(60);
/// How long a `SURFACE_PAGES` waits for a copy of a device cache into its pages still in flight
/// ([`GraphicsDecoder::wait_copies_into`]): as long as the kext's new block over a surface's
@@ -598,12 +595,11 @@ fn first_plane_of(block: u64, layout: &RgfxSurfacePagesLayout, length: u64) -> O
}
}
}
/// Whether a `SURFACE_PAGES`, the `counted`th the views' counts hold, logs what the surface
/// views did at `now`, the last log having been at `last`: every [`VIEWS_LOGGED_EVERY`]th, and
/// the first [`VIEWS_LOGGED_AFTER`] or more after the last log.
fn views_log_due(counted: u64, now: MonoTime, last: MonoTime) -> bool {
counted.is_multiple_of(VIEWS_LOGGED_EVERY)
|| now.saturating_duration_since(last) >= VIEWS_LOGGED_AFTER
/// Whether a `SURFACE_PAGES` logs what the surface views did at `now`, the last log having been
/// at `last`: the first [`VIEWS_LOGGED_AFTER`] or more after the last log.
fn views_log_due(now: MonoTime, last: MonoTime) -> bool {
now.saturating_duration_since(last) >= VIEWS_LOGGED_AFTER
}
/// What a present of an IOSurface shows ([`GraphicsDecoder::surface_present`]).
@@ -1176,9 +1172,8 @@ impl<P: Platform> GraphicsDecoder<P> {
/// marked [`RGFX_SURFACE_PAGES_DEFERRED`] or [`RGFX_SURFACE_PAGES_ATTACH`] is a deferred
/// block or its pages ([`Self::deferred_surface_pages`]); and one marked
/// [`RGFX_SURFACE_PAGES_ASK_CACHE`], with its surface's `layout`, asks whether it needs one
/// ([`Self::asks_cache`]). A summary of what the views did is logged every
/// [`VIEWS_LOGGED_EVERY`], and at the first [`VIEWS_LOGGED_AFTER`] after the last
/// ([`views_log_due`]).
/// ([`Self::asks_cache`]). A summary of what the views did is logged at the first
/// [`VIEWS_LOGGED_AFTER`] after the last ([`views_log_due`]).
pub(crate) fn carry_out_surface_pages(
&self,
device: &P::Device,
@@ -1220,21 +1215,17 @@ impl<P: Platform> GraphicsDecoder<P> {
clock.now_mono().saturating_duration_since(start).as_micros(),
start.saturating_duration_since(settle.begun).as_micros()
);
let c = views.lock().counts();
let d = self.surface_caches.lock().counts();
// A deferred block, and a block named by its runs, make no view, so they are counted
// here too.
let counted = (c.made + c.reused + c.bad_runs + c.not_mapped + c.private + c.by_runs)
.saturating_add(d.deferred + d.deferred_refused + d.deferred_in_place);
let now = clock.now_mono();
let logged_at = &self.shared.views_logged_at;
let last = logged_at.load(Ordering::Relaxed);
// One message logs for each time due, where two blocks' lanes find it due at once.
if views_log_due(counted, now, MonoTime::from_nanos(last))
if views_log_due(now, MonoTime::from_nanos(last))
&& logged_at
.compare_exchange(last, now.as_nanos(), Ordering::Relaxed, Ordering::Relaxed)
.is_ok()
{
let c = views.lock().counts();
let d = self.surface_caches.lock().counts();
log::info!(
target: "reims_vgpu::graphics",
"IOSurface pages in place: {} views made, {} taken from the cache, {} let go of \
@@ -2985,8 +2976,10 @@ impl<P: Platform> GraphicsDecoder<P> {
device.new_command_queue()
};
if unshared && made.is_some() {
log::info!(
target: "reims_vgpu::graphics",
// A debug line of its own target, which a run that counts the guest's
// unshared queues names (`reims_vgpu::graphics::queues=debug`).
log::debug!(
target: "reims_vgpu::graphics::queues",
"queue {:#x}: made unshared (RGFX_QUEUE_UNSHARED)", m.obj_id
);
}
@@ -5719,23 +5712,18 @@ mod tests {
assert_eq!(check(fields(81, 0)), None);
}
/// What the surface views did is logged at every 256th `SURFACE_PAGES`, and at the first one
/// ten seconds or more after the last log, however few came between.
/// What the surface views did is logged at the first `SURFACE_PAGES` a minute or more after
/// the last log, however many came between, and at no other
#[test]
fn the_views_counts_are_logged_by_count_and_by_time() {
fn the_views_counts_are_logged_at_most_once_a_minute() {
let last = MonoTime::from_nanos(5_000_000_000);
let after = |d: std::time::Duration| last.saturating_add(d);
let ms = std::time::Duration::from_millis;
// The 256th logs at once, and so do its multiples.
assert!(views_log_due(256, after(ms(1)), last));
assert!(views_log_due(512, last, last));
// Others wait for the interval.
assert!(!views_log_due(255, after(ms(1)), last));
assert!(!views_log_due(3, after(ms(9_999)), last));
assert!(views_log_due(3, after(ms(10_000)), last));
assert!(views_log_due(257, after(ms(60_000)), last));
assert!(!views_log_due(after(ms(1)), last));
assert!(!views_log_due(after(ms(59_999)), last));
assert!(views_log_due(after(ms(60_000)), last));
// A clock that reads earlier than the last log waits as if no time had passed.
assert!(!views_log_due(3, MonoTime::from_nanos(1), last));
assert!(!views_log_due(MonoTime::from_nanos(1), last));
}
/// The closed contexts' runs hold each number inserted, joined with the runs it is next to,
@@ -60,6 +60,7 @@ use reims_vgpu_graphics::wire::RGFX_CONTEXT_OBJ_ID_SHIFT;
use reims_vgpu_vulkan::core::platform::command::{CommandBuffer, CommandQueue, CompletedInfo};
use reims_vgpu_vulkan::core::platform::device::GpuDevice;
use reims_vgpu_vulkan::core::platform::event::{EventRef, SharedEvent};
use reims_vgpu_vulkan::core::platform::os::clock::MonoTime;
use reims_vgpu_vulkan::core::platform::{Handle, Platform};
use reims_vgpu_vulkan::core::raise::{OnFault, RaiseResult, refusals};
@@ -68,8 +69,10 @@ use super::commit_order;
/// The waits and signals run under a live raise handler (the ring loop's).
const ON: OnFault = OnFault::Return;
/// How many command buffers that hold the op pass between the logs of what the order did.
const LOGGED_EVERY: u64 = 4096;
/// How long the logs of what the order did wait after the last: the first command buffer that
/// holds the op after it logs them. A summary at info comes at most once a minute, however many
/// command buffers a guest sends (docs/conventions.md).
const LOGGED_AFTER: std::time::Duration = std::time::Duration::from_secs(60);
/// What a queue's submission ring has published: the highest seqno of a message on it, taken or
/// not; `None` where the queue has ended at the device. Given by the host as the queue is made.
@@ -281,6 +284,8 @@ impl<P: Platform> Queue<P> {
pub(crate) struct SurfaceOrder<P: Platform> {
queues: HashMap<u64, Queue<P>>,
counts: OrderCounts,
/// When the counts were last logged ([`LOGGED_AFTER`]); `None` before the first buffer.
logged_at: Option<MonoTime>,
}
impl<P: Platform> SurfaceOrder<P> {
@@ -288,6 +293,7 @@ impl<P: Platform> SurfaceOrder<P> {
SurfaceOrder {
queues: HashMap::new(),
counts: OrderCounts::default(),
logged_at: None,
}
}
@@ -427,16 +433,20 @@ impl<P: Platform> SurfaceOrder<P> {
}
/// Makes `cb`, a command buffer of queue `queue` that holds the op, wait on the GPU for each
/// buffer of `waits` not yet finished (the module doc); the waits it made, one a queue.
/// buffer of `waits` not yet finished (the module doc); the waits it made, one a queue. Logs
/// the counts where it comes [`LOGGED_AFTER`] or more after their last log, at `now`.
pub(crate) fn before(
&mut self,
device: &P::Device,
queue: u64,
cb: &P::CommandBuffer,
waits: &[RgfxSurfaceOrderWait],
now: MonoTime,
) -> RaiseResult<Vec<OrderWait<P>>> {
self.counts.buffers += 1;
if self.counts.buffers.is_multiple_of(LOGGED_EVERY) {
let last = *self.logged_at.get_or_insert(now);
if now.saturating_duration_since(last) >= LOGGED_AFTER {
self.logged_at = Some(now);
let c = self.counts;
log::info!(
target: "reims_vgpu::graphics",
@@ -683,9 +693,10 @@ impl<P: Platform> super::GraphicsDecoder<P> {
let mut waited = 0;
while !w.wait(CPU_WAIT_SLICE_MS) {
if cancel.cut_since(begun) {
log::info!(
log::debug!(
target: "reims_vgpu::graphics",
"surface order: a reset of the device ended the CPU wait of work started off a command buffer for a buffer of another queue at {}",
"surface order: a reset of the device ended the CPU wait of work started \
off a command buffer for a buffer of another queue at {}",
w.value
);
return;
@@ -694,15 +705,18 @@ impl<P: Platform> super::GraphicsDecoder<P> {
if waited == CPU_WAIT_LOGGED_MS {
log::warn!(
target: "reims_vgpu::graphics",
"surface order: work started off a command buffer has waited {CPU_WAIT_LOGGED_MS} ms on the CPU for a buffer of another queue at {}, which has not finished; it waits on",
"surface order: work started off a command buffer has waited \
{CPU_WAIT_LOGGED_MS} ms on the CPU for a buffer of another queue at {}, \
which has not finished; it waits on",
w.value
);
}
}
if waited >= CPU_WAIT_LOGGED_MS {
log::info!(
log::debug!(
target: "reims_vgpu::graphics",
"surface order: the buffer of another queue at {} finished after about {waited} ms of a CPU wait",
"surface order: the buffer of another queue at {} finished after about \
{waited} ms of a CPU wait",
w.value
);
}
@@ -48,10 +48,11 @@ pub(crate) struct WaitingBuffer {
}
impl WaitingBuffer {
/// The buffer finished (its completed handler ran): the log says so where it named the wait.
/// The buffer finished (its completed handler ran): the log says so at debug where it named
/// the wait.
pub(crate) fn finished(&self) {
if self.state.swap(FINISHED, Ordering::SeqCst) == LOGGED {
log::info!(
log::debug!(
target: "reims_vgpu::graphics",
"{} finished after waiting for {}",
self.named(),
+9 -4
View File
@@ -633,11 +633,15 @@ impl<P: Platform> CacheTargets<P> {
}
}
/// Logs `why` once in `said`'s session: why a picture was not decoded into its cache.
/// Logs `why` once in `said`'s session, and at info once per process (`kind`): why a picture was
/// not decoded into its cache.
fn say(said: &Mutex<Vec<String>>, why: String) {
let mut said = said.lock();
if !said.contains(&why) {
log::info!("hardware video: {NAME}: a picture not decoded into its device cache: {why}");
log::info!(
kind:% = why;
"hardware video: {NAME}: a picture not decoded into its device cache: {why}"
);
said.push(why);
}
}
@@ -738,11 +742,12 @@ struct VaPicture<P: Platform> {
type SessionCopier<P> = Result<Arc<Mutex<Box<dyn GpuCopier<P>>>>, String>;
impl<P: Platform> VaPicture<P> {
/// Logs, once a session, why a picture was copied by the CPU.
/// Logs, once a session, and at info once per process (`kind`), why a picture was copied by
/// the CPU.
fn copied_because(&self, why: String) {
let mut said = self.said.lock();
if !said.contains(&why) {
log::info!("hardware video: {NAME}: a picture copied by the CPU: {why}");
log::info!(kind:% = why; "hardware video: {NAME}: a picture copied by the CPU: {why}");
said.push(why);
}
}
+5 -1
View File
@@ -846,8 +846,12 @@ fn land_pictures<P: Platform>(
Some(Ok(way)) => {
let mut counts = counts.lock();
if let Some(i) = Way::ALL.iter().position(|w| *w == way) {
// A session's first of each way; once per process at info (`kind`).
if counts.landed[i] == 0 {
log::info!("hardware video: {name}: a picture landed {}", way.says());
log::info!(
kind = way.says();
"hardware video: {name}: a picture landed {}", way.says()
);
}
counts.landed[i] += 1;
}
@@ -540,8 +540,10 @@ fn finish_frames<P: Platform>(
{
let mut counts = counts.lock();
if let Some(i) = Outcome::ALL.iter().position(|o| *o == outcome) {
// A session's first of each outcome; once per process at info (`kind`).
if counts.frames[i] == 0 && outcome != Outcome::Failed {
log::info!(
kind = outcome.says();
"hardware video: {name}: a frame encoded, {}",
outcome.says()
);
+7 -4
View File
@@ -23,7 +23,8 @@
# -e ECID the guest's ECID, in decimal or 0x hex
#
# The guest runs with 8 GiB and 4 CPUs, as Ambrosia's tested boots do, with QEMU's
# REIMS_VGPU_WINDOW=0 (no window on the host) and REIMS_VGPU_LOG=info, as the lane gate runs it.
# REIMS_VGPU_WINDOW=0 (no window on the host) and REIMS_VGPU_LOG=info with the display's flips
# (reims_vgpu::graphics::shown at debug), as the lane gate runs it.
# Under TCG, for a Linux member, its RAM is a shared memfd, as reims-ctl's VMs on Linux have it. The
# device maps the memfd-backed main RAM in place and leaves out vmapple's firmware and configuration
# regions, which have no file behind them and hold no IOSurface, so every surface still maps in place
@@ -264,7 +265,7 @@ fi
# --- the boot -----------------------------------------------------------------------------------
t0=$(now)
REIMS_VGPU_WINDOW=0 REIMS_VGPU_LOG=info "$qemu" "${accel[@]}" \
REIMS_VGPU_WINDOW=0 REIMS_VGPU_LOG=info,reims_vgpu::graphics::shown=debug "$qemu" "${accel[@]}" \
-M "vmapple,uuid=$ecid$machine" "${mem[@]}" -smp 4 -bios "$firmware" \
-drive "file=$clone/aux.img.trimmed,if=pflash,format=raw" \
-drive "file=$clone/disk.img,if=pflash,format=raw" \
@@ -441,7 +442,8 @@ if [[ -n $ssh_s ]]; then
else
cover_say=
fi
# The host logs each display flip; those during the probe's call are WindowServer's own
# The host logs each display flip (reims_vgpu::graphics::shown, which this run names at
# debug); those during the probe's call are WindowServer's own
# presents, the rate the probe's frames can reach the display at.
q0=$(wc -l < "$out/qemu.log") t0=$SECONDS
probe=$(G 60 "echo '$GUEST_PASS' | sudo -S -p '' launchctl asuser \$(id -u) sudo -u \$(id -un) perl -e 'alarm shift @ARGV; exec @ARGV' $((40 * slow)) \$HOME/ambrosia-check/present_probe -t 10" |
@@ -589,7 +591,8 @@ if [[ -n $ssh_s ]]; then
verdict windowserver-metal "$( ((ok)) && echo PASS || echo FAIL)" "$(IFS=';'; echo "${ws[*]}" | sed 's/;/; /g')"
# The page count: the host's last count of its IOSurface device caches (logged only once one
# is made), and the kext's count lines, read in the guest after its Metal work.
# is made, at most once a minute, so up to a minute behind the boot's end), and the kext's count
# lines, read in the guest after its Metal work.
caches=$(grep -o 'IOSurface device caches: .*' "$out/qemu.log" | tail -1)
cc=($(echo "$caches" | perl -ne 'my ($m) = /device caches: (\d+) made;/;
print "$m $1 $2 $3 $4\n" if defined $m && /; (\d+) deferred \((\d+) carrying pages\), (\d+) refused, (\d+) refused as they might lie in place/'))
+10 -5
View File
@@ -33,9 +33,10 @@
# webgl present final)
# --bench-phases the bench boot's (default: info webgl present idle bench decodefps final)
# --boot-tag TAG the correctness boot's tag on the lane host (default gate-RUNID-boot)
# --host-log FILTER the correctness boot's host log filter (REIMS_VGPU_LOG, default info), as
# --host-log FILTER the correctness boot's host log filter (REIMS_VGPU_LOG, default info with
# the per-event lines the boot counts at debug: HOST_LOG_DEFAULT below), as
# info,reims_vgpu_graphics::room=debug to count a path's debug records
# --bench-host-log FILTER the bench boot's host log filter (default info), as
# --bench-host-log FILTER the bench boot's host log filter (default HOST_LOG_DEFAULT), as
# info,reims_vgpu::work=debug for the runtime's work counts each second, which
# report.py rates the drags and WebGL by; their logger costs the numbers it rates
# (car 9: draws.10k 2.54M a second without it, 0.80M with it), so another filter
@@ -688,9 +689,13 @@ LOCK_WAIT_S=${LOCK_WAIT_S:-3600}
PHASES="$ph"
PRESENT_S=$pres
LOAD=$([[ $mode == bench ]] && echo "$load")
# The bench's host log is info: the work counts' logger (reims_vgpu::work at debug) slows what it
# rates, and runs only where --bench-host-log asks for it.
HOST_LOG=$([[ $mode == boot ]] && echo "${host_log:-info}" || echo "${bench_host_log:-info}")
# The host log is info, with the per-event lines the boot counts at debug (docs/conventions.md:
# none at info): the display's flips (reims_vgpu::graphics::shown, which msi-drag.py times the
# composites by), the guest's library lookups (::library, msi-boot.sh's launch gaps) and its
# unshared queues (::queues). The bench's: the work counts' logger (reims_vgpu::work at debug)
# slows what it rates, and runs only where --bench-host-log asks for it.
HOST_LOG_DEFAULT=info,reims_vgpu::graphics::shown=debug,reims_vgpu::graphics::library=debug,reims_vgpu::graphics::queues=debug
HOST_LOG=$([[ $mode == boot ]] && echo "${host_log:-$HOST_LOG_DEFAULT}" || echo "${bench_host_log:-$HOST_LOG_DEFAULT}")
CAPTURE=$([[ $mode == boot ]] && echo "$capture" || echo 0)
APPLOAD=$([[ $mode == boot ]] && echo "$appload" || echo 0)
FINAL_CMD_B64=$([[ $mode == boot && -n ${final_cmd:-} ]] && printf '%s' "$final_cmd" | base64 | tr -d '\n')
+7 -5
View File
@@ -55,7 +55,8 @@
# EXCLUSIVE, HOLD_S, LOCK_WAIT_S (unused: potluck's lease is the lock), PHASES and
# PRESENT_S (guest-run.sh's phases and GATE_PRESENT_S), and LOAD (a duty, 0 to 1: a fixed GPU
# load, gpuload -d LOAD, from the guest's run to the drags' end; unset for none), and HOST_LOG
# (the host's REIMS_VGPU_LOG filter, default info), CAPTURE (1: the boot capture, below), and
# (the host's REIMS_VGPU_LOG filter, default info with the per-event lines this script counts at
# debug: lane-gate.sh's HOST_LOG_DEFAULT), CAPTURE (1: the boot capture, below), and
# APPLOAD (1: the app load after the measurements, msi-appload.sh, with the tools lane-gate.sh
# copies into this script's appload-tools/), and POST_PROBES and POST_PROBE_TIP (a gate boot's
# probes after everything else, msi-probes.sh's PROBES and PROBE_TIP, into post-probes/; at the
@@ -223,9 +224,10 @@ finish() {
rm -f "$R/watchdog.pid"
if [[ -f $B/launch.log ]]; then
kv fatal_lines "$(grep -c 'reims-vgpu: fatal' "$B/launch.log")"
# The host's records of paths a tip adds: queues made unshared (RGFX_QUEUE_UNSHARED),
# SUBMIT_ROOM records posted (reims_vgpu_graphics::room at debug, HOST_LOG), and ICB_SLOTS messages
# whose runs were not all carried out.
# The host's records of paths a tip adds: queues made unshared (RGFX_QUEUE_UNSHARED,
# reims_vgpu::graphics::queues at debug, HOST_LOG), SUBMIT_ROOM records posted
# (reims_vgpu_graphics::room at debug, HOST_LOG), and ICB_SLOTS messages whose runs were not
# all carried out (a warning, written once per kind: warned).
kv queues_unshared "$(grep -c 'made unshared' "$B/launch.log")"
kv submit_room_posted "$(grep -c 'SUBMIT_ROOM posted' "$B/launch.log")"
kv icb_slots_refused "$(warned 'ICB_SLOTS of' "$B/launch.log")"
@@ -412,7 +414,7 @@ fi
TIMES=$!
# msi-launch.sh picks the SSH port (PORT unset): "PORT n".
out=$(env -u PORT "${excl[@]}" RGK_RUN="$RGK_RUN" QEMU="$QEMU" ROM="$ROM" \
REIMS_VGPU_LOG="${HOST_LOG:-info}" bash "$(dirname "$0")/msi-launch.sh" "$TAG" "$OC" "$DISK" 2>&1)
REIMS_VGPU_LOG="${HOST_LOG:-info,reims_vgpu::graphics::shown=debug,reims_vgpu::graphics::library=debug,reims_vgpu::graphics::queues=debug}" bash "$(dirname "$0")/msi-launch.sh" "$TAG" "$OC" "$DISK" 2>&1)
T_SSH=$(date +%s.%N | cut -c1-14)
kill "$TIMES" 2> /dev/null
echo "$out" >> "$R/boot.log"
+1 -1
View File
@@ -41,7 +41,7 @@ GFX=${GFX:--device reims-graphics-pci,id=gfx,bus=pcie.0,addr=0x4,romfile=$ROM}
cat > "$B/run.sh" <<RUNEOF
#!/bin/bash
export WAYLAND_DISPLAY=wayland-1 DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/1000 XDG_SESSION_TYPE=wayland DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
export REIMS_VGPU_LOG=\${REIMS_VGPU_LOG:-info} REIMS_VGPU_WINDOW_BORDERLESS=1
export REIMS_VGPU_LOG=\${REIMS_VGPU_LOG:-info,reims_vgpu::graphics::shown=debug,reims_vgpu::graphics::library=debug,reims_vgpu::graphics::queues=debug} REIMS_VGPU_WINDOW_BORDERLESS=1
export VK_DRIVER_FILES=/usr/share/vulkan/icd.d/nvidia_icd.json
# Powers QEMU (this shell's pid, which execs it) off after \$1 s. It ends when QEMU does, and kills
# only the same process: the pid's start time (/proc stat field 22) must not have changed.
+3 -2
View File
@@ -133,8 +133,9 @@ WAIT_N=3 WAIT_S=2700
# The host's log filter in a probe boot: info, and the display's presents ("PRESENT_SURFACE of
# transaction", reims_vgpu_graphics at trace, about 23 lines a second at 120 Hz), so a probe's host.log
# counts composites. reims_vgpu_graphics has no other trace lines; at debug it logs SUBMIT_ROOM posts
# (reims_vgpu_graphics::room). Gate and bench boots log at info.
PROBE_HOST_LOG=${host_log:-info,reims_vgpu_graphics=trace}
# (reims_vgpu_graphics::room). Gate and bench boots log at info, with the per-event lines they count
# at debug (lane-gate.sh's HOST_LOG_DEFAULT), as here.
PROBE_HOST_LOG=${host_log:-info,reims_vgpu_graphics=trace,reims_vgpu::graphics::shown=debug,reims_vgpu::graphics::library=debug,reims_vgpu::graphics::queues=debug}
# The hold the probes get: the boot's own time to the desktop and the device check (about 90 s),
# the longest load settle (180 s) and a margin come first.
FIT_S=$(( HOLD_S - 90 - 180 - 60 ))