Skip to content

Commit

Permalink
add thread_id label in case of ZTS
Browse files Browse the repository at this point in the history
  • Loading branch information
realFlowControl committed Jan 17, 2024
1 parent ffeeba8 commit 87a33e6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion profiling/src/profiling/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ impl Profiler {
fn prepare_sample_message(
frames: Vec<ZendFrame>,
samples: SampleValues,
#[cfg(php_has_fibers)] mut labels: Vec<Label>,
#[cfg(any(php_has_fibers, php_zts))] mut labels: Vec<Label>,
#[cfg(not(php_has_fibers))] labels: Vec<Label>,
locals: &RequestLocals,
timestamp: i64,
Expand Down Expand Up @@ -1081,6 +1081,12 @@ impl Profiler {
}
}

#[cfg(php_zts)]
labels.push(Label {
key: "thread id",
value: LabelValue::Num(unsafe { libc::pthread_self() as i64 }, "id".into()),
});

let tags = TAGS.with(|cell| Arc::clone(&cell.borrow()));

SampleMessage {
Expand Down

0 comments on commit 87a33e6

Please sign in to comment.