Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/flux-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ pub use arrayvec::{ArrayStr, ArrayVec};
pub use dcache::{DCache, DCacheError, DCachePtr, DCacheRef};
pub use namespace::{ShortTypename, short_typename};
pub use shared_vector::SharedVector;
pub use thread::{ThreadPriority, thread_boot};
pub use thread::{ThreadPriority, get_tid, thread_boot};
pub use vsync::vsync;
10 changes: 10 additions & 0 deletions crates/flux-utils/src/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ fn set_thread_affinity(core: usize) {
}
}

#[cfg(target_os = "linux")]
pub fn get_tid() -> i64 {
unsafe { libc::gettid() as i64 }
}

#[cfg(not(target_os = "linux"))]
pub fn get_tid() -> i64 {
0
}

pub fn thread_boot(core: Option<usize>, prio: ThreadPriority) {
if let Some(core) = core {
set_thread_affinity(core);
Expand Down
4 changes: 2 additions & 2 deletions crates/flux/src/tile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pub mod metrics;
use core::sync::atomic::Ordering;

use flux_timing::{Duration, IngestionTime};
use flux_utils::{ShortTypename, ThreadPriority, short_typename, thread_boot, vsync};
use flux_utils::{ShortTypename, ThreadPriority, get_tid, short_typename, thread_boot, vsync};
use tracing::{Level, info, span};

use crate::{
Expand Down Expand Up @@ -94,7 +94,7 @@ where
}
std::hint::spin_loop();
}
info!("Tile init complete");
info!(tid = get_tid(), "Tile init complete");

loop {
let ingestion_t = IngestionTime::now();
Expand Down
Loading