A timeline of a few frames, with the chain each present came out of (VICTORY_TIMELINE)
Diagnostics only. VICTORY_TIMELINE=<file> records three frames (or VICTORY_TIMELINE_FRAMES) after VICTORY_TIMELINE_AT seconds and writes a Chrome trace and a text summary: spans of our work, the waits and wake-ups of the title's threads (its imports) and of ours (our import table), long kernel calls on the address space, and when each submission ran on the card. The summary walks back from each present through who waited on whom. Nothing is wrapped without the variable. Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 008de5f9ffcef132079b1af8b7f4f1c22235cee9)
This commit is contained in:
1 parent
faf5687af9
commit
7c62f5b707
25 files changed
+2506
-7
No files matched your search
@@ -85,6 +85,13 @@ extern "system" fn release(this: This) -> u32 {
|
||||
pub(crate) extern "system" fn completed(this: This) -> u64 {
|
||||
fence(this).value.load(Ordering::Acquire)
|
||||
}
|
||||
/// The title's `GetCompletedValue`.
|
||||
extern "system" fn completed_called(this: This) -> u64 {
|
||||
let value = completed(this);
|
||||
#[cfg(all(windows, feature = "diagnostics"))]
|
||||
crate::timeline::polled(this as usize, value);
|
||||
value
|
||||
}
|
||||
extern "system" fn set_event_on_completion(this: This, value: u64, event: *mut c_void) -> HRESULT {
|
||||
let fence = fence(this);
|
||||
let mut waiters = fence.waiters.lock().unwrap_or_else(|e| e.into_inner());
|
||||
@@ -94,6 +101,8 @@ extern "system" fn set_event_on_completion(this: This, value: u64, event: *mut c
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
#[cfg(all(windows, feature = "diagnostics"))]
|
||||
crate::timeline::told("an event asked for", this as usize, value);
|
||||
if event.is_null() {
|
||||
// With submissions sent to the card and not waited for
|
||||
// (`crate::host::late`) the signal may be behind them: they are
|
||||
@@ -120,6 +129,8 @@ extern "system" fn set_event_on_completion(this: This, value: u64, event: *mut c
|
||||
/// Moves the fence to `value` and sets the events that waited for it.
|
||||
pub(crate) fn set(this: This, value: u64) {
|
||||
let fence = fence(this);
|
||||
#[cfg(all(windows, feature = "diagnostics"))]
|
||||
crate::timeline::told("a fence set", this as usize, value);
|
||||
let mut waiters = fence.waiters.lock().unwrap_or_else(|e| e.into_inner());
|
||||
fence.value.store(value, Ordering::Release);
|
||||
waiters.retain(|&(wanted, event)| {
|
||||
@@ -131,6 +142,7 @@ pub(crate) fn set(this: This, value: u64) {
|
||||
});
|
||||
}
|
||||
pub(crate) extern "system" fn signal(this: This, value: u64) -> HRESULT {
|
||||
let _called = crate::timeline::span("a fence set");
|
||||
set(this, value);
|
||||
// A queue may have waited for it: what it held runs now.
|
||||
#[cfg(windows)]
|
||||
@@ -153,7 +165,7 @@ static FUNCTIONS: Table<24> = {
|
||||
f[0] = query as *const ();
|
||||
f[2] = release as *const ();
|
||||
f[7] = object::parent_device as *const (); // 0x38
|
||||
f[8] = completed as *const (); // 0x40
|
||||
f[8] = completed_called as *const (); // 0x40
|
||||
f[9] = set_event_on_completion as *const (); // 0x48
|
||||
f[10] = signal as *const (); // 0x50
|
||||
f[11] = creation_flags as *const (); // 0x58
|
||||
|
||||
Reference in new issue
Block a user