Skip to content

Commit e9c2a9b

Browse files
Merge branch 'master' into florian/foobar
2 parents 7343cde + 41b371e commit e9c2a9b

12 files changed

Lines changed: 744 additions & 42 deletions

File tree

.github/workflows/prof_correctness.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,16 @@ jobs:
4747

4848
- name: Build profiler
4949
run: |
50-
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main" | sudo tee -a /etc/apt/sources.list
51-
echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main" | sudo tee -a /etc/apt/sources.list
52-
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
53-
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
54-
sudo apt remove -y clang-*
50+
codename="$(lsb_release -cs)"
51+
curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/llvm-archive-keyring.gpg
52+
echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-19 main" | sudo tee /etc/apt/sources.list.d/llvm.list
5553
sudo apt-get update
56-
sudo apt install -y clang-17
54+
sudo apt-get install -y clang-19 lld-19
55+
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-19 100
56+
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-19 100
57+
sudo update-alternatives --install /usr/bin/ld.lld ld.lld /usr/bin/ld.lld-19 100
58+
clang --version
59+
ld.lld --version
5760
cd profiling
5861
version_number=$(awk -F' = ' '$1 == "channel" { gsub(/"/, "", $2); print $2 }' rust-toolchain.toml)
5962
curl https://sh.rustup.rs -sSf | sh -s -- --profile minimal -y --default-toolchain "$version_number"
@@ -77,7 +80,7 @@ jobs:
7780
export DD_PROFILING_EXCEPTION_MESSAGE_ENABLED=1
7881
php -v
7982
php -d extension=target/profiler-release/libdatadog_php_profiling.so --ri datadog-profiling
80-
for test_case in "allocations" "time" "strange_frames" "timeline" "exceptions" "allocation_time_combined"; do
83+
for test_case in "allocations" "time" "strange_frames" "timeline" "exceptions" "io" "allocation_time_combined"; do
8184
mkdir -p profiling/tests/correctness/"$test_case"/
8285
export DD_PROFILING_OUTPUT_PPROF=$PWD/profiling/tests/correctness/"$test_case"/test.pprof
8386
php -d extension="${PWD}/target/profiler-release/libdatadog_php_profiling.so" "profiling/tests/correctness/${test_case}.php"
@@ -95,7 +98,7 @@ jobs:
9598
export DD_PROFILING_EXCEPTION_MESSAGE_ENABLED=1
9699
php -v
97100
php -d extension=target/profiler-release/libdatadog_php_profiling.so --ri datadog-profiling
98-
for test_case in "allocations" "time" "strange_frames" "timeline" "exceptions" "allocation_time_combined"; do
101+
for test_case in "allocations" "time" "strange_frames" "timeline" "exceptions" "io" "allocation_time_combined"; do
99102
mkdir -p profiling/tests/correctness/"$test_case"/
100103
export DD_PROFILING_OUTPUT_PPROF=$PWD/profiling/tests/correctness/"$test_case"/test.pprof
101104
php -d extension=$PWD/target/profiler-release/libdatadog_php_profiling.so profiling/tests/correctness/"$test_case".php
@@ -167,6 +170,12 @@ jobs:
167170
expected_json: profiling/tests/correctness/allocation_time_combined.json
168171
pprof_path: profiling/tests/correctness/allocation_time_combined/
169172

173+
- name: Check profiler correctness for IO
174+
uses: Datadog/prof-correctness/analyze@main
175+
with:
176+
expected_json: profiling/tests/correctness/io.json
177+
pprof_path: profiling/tests/correctness/io/
178+
170179
- name: Check profiler correctness for exceptions ZTS
171180
if: matrix.phpts == 'zts'
172181
uses: Datadog/prof-correctness/analyze@main

Cargo.lock

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

profiling/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ thiserror = "2"
4040
tracing = { version = "0.1", optional = true }
4141
uuid = { version = "1.0", features = ["v4"] }
4242

43+
[target.'cfg(target_vendor = "apple")'.dependencies]
44+
mach2 = "0.5" # version 0.6 requires edition="2024"
45+
4346
[dependencies.tracing-subscriber]
4447
version = "0.3"
4548
optional = true

profiling/build.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ fn build_zend_php_ffis(
170170
.chain([Path::new("../zend_abstract_interface")])
171171
.chain([Path::new("../")]),
172172
)
173-
.flag_if_supported("-fuse-ld=lld")
174173
.flag_if_supported("-std=c11")
175174
.flag_if_supported("-std=c17");
176175
#[cfg(feature = "test")]
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use super::GotSymbolOverwrite;
12
use crate::bindings::{
23
Elf64_Dyn, Elf64_Rela, Elf64_Sym, Elf64_Xword, DT_JMPREL, DT_NULL, DT_PLTRELSZ, DT_STRTAB,
34
DT_SYMTAB, PT_DYNAMIC, R_AARCH64_JUMP_SLOT, R_X86_64_JUMP_SLOT,
@@ -15,12 +16,6 @@ fn elf64_r_sym(info: Elf64_Xword) -> u32 {
1516
(info >> 32) as u32
1617
}
1718

18-
pub struct GotSymbolOverwrite {
19-
pub symbol_name: &'static str,
20-
pub new_func: *mut (),
21-
pub orig_func: *mut *mut (),
22-
}
23-
2419
/// Override the GOT entry for symbols specified in `overwrites`.
2520
///
2621
/// See: https://cs4401.walls.ninja/notes/lecture/basics_global_offset_table.html

0 commit comments

Comments
 (0)