From 654febbd8510d3bc712033495a45f51b5dab4b95 Mon Sep 17 00:00:00 2001 From: egmc Date: Mon, 20 Apr 2026 09:15:28 +0900 Subject: [PATCH 1/5] Add new bpftrace for DTrace document - add bpftrace example section like SystemTap as an easier sample --- features/dtrace.xml | 188 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 188 insertions(+) diff --git a/features/dtrace.xml b/features/dtrace.xml index 2b92e15b6ab2..82d01de61658 100644 --- a/features/dtrace.xml +++ b/features/dtrace.xml @@ -546,6 +546,194 @@ probe process("sapi/cli/php").provider("php").mark("request__startup") { + + + + + + + Using bpftrace with PHP DTrace Static Probes + + On Linux distributions with a kernel that supports eBPF, the + bpftrace utility can attach to PHP's DTrace USDT probes directly, + without requiring SystemTap. + + + Installing bpftrace + + Install bpftrace using the distribution's package manager. For + example, on Oracle Linux, RHEL, or Fedora: + + + + + + Or, on Debian or Ubuntu: + + + + + + + + The examples below assume the target PHP binary is installed at + /usr/bin/php. + + The same USDT probes are also + exposed by other SAPIs built from the same source tree, so the + probe target may instead be the Apache module + (libphp.so) or the FastCGI Process Manager + binary (php-fpm); substitute the appropriate + path or attach by PID with -p as needed. + + + Make sure target binary is built with DTrace and configured environment properly. + Configuring PHP for DTrace Static Probes for details. + + + The static probes in PHP can be listed using + bpftrace: + + + + + + + + + This outputs: + + + + + + + + + + <filename>all_probes.bt</filename> for tracing all PHP Static Probes with bpftrace + + + + + + + + The above script will trace all core PHP static probe points + throughout the duration of a running PHP script. bpftrace requires + root privileges: + + + + + + + + + To trace an already-running PHP process (for instance, a + php-fpm worker or an Apache process loading + libphp.so), attach by PID: + + + From 24b906868b7691f1cec5c668263470c3c5ce4838 Mon Sep 17 00:00:00 2001 From: sohei iwahori Date: Tue, 21 Apr 2026 21:26:18 +0900 Subject: [PATCH 2/5] Apply suggestions from code review Co-authored-by: Louis-Arnaud --- features/dtrace.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/features/dtrace.xml b/features/dtrace.xml index 82d01de61658..181c87e04f1c 100644 --- a/features/dtrace.xml +++ b/features/dtrace.xml @@ -554,11 +554,11 @@ probe process("sapi/cli/php").provider("php").mark("request__startup") { Using bpftrace with PHP DTrace Static Probes - + On Linux distributions with a kernel that supports eBPF, the bpftrace utility can attach to PHP's DTrace USDT probes directly, without requiring SystemTap. - + Installing bpftrace @@ -591,10 +591,10 @@ probe process("sapi/cli/php").provider("php").mark("request__startup") { binary (php-fpm); substitute the appropriate path or attach by PID with -p as needed. - - Make sure target binary is built with DTrace and configured environment properly. + + Make sure the target binary is built with DTrace and that the environment is configured properly. See Configuring PHP for DTrace Static Probes for details. - + The static probes in PHP can be listed using bpftrace: From d3feef233827437ebc48acbc94348abce2382095 Mon Sep 17 00:00:00 2001 From: egmc Date: Tue, 21 Apr 2026 21:37:50 +0900 Subject: [PATCH 3/5] fix indent level with 1 space to match other sections --- features/dtrace.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/features/dtrace.xml b/features/dtrace.xml index 181c87e04f1c..58d87f313edd 100644 --- a/features/dtrace.xml +++ b/features/dtrace.xml @@ -554,11 +554,11 @@ probe process("sapi/cli/php").provider("php").mark("request__startup") { Using bpftrace with PHP DTrace Static Probes - - On Linux distributions with a kernel that supports eBPF, the - bpftrace utility can attach to PHP's DTrace USDT probes directly, - without requiring SystemTap. - + + On Linux distributions with a kernel that supports eBPF, the + bpftrace utility can attach to PHP's DTrace USDT probes directly, + without requiring SystemTap. + Installing bpftrace From 199a53150cc0837f4198177421ae7317d4898e22 Mon Sep 17 00:00:00 2001 From: egmc Date: Tue, 21 Apr 2026 21:52:56 +0900 Subject: [PATCH 4/5] fix indent inside --- features/dtrace.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/features/dtrace.xml b/features/dtrace.xml index 58d87f313edd..28f600321199 100644 --- a/features/dtrace.xml +++ b/features/dtrace.xml @@ -584,16 +584,16 @@ probe process("sapi/cli/php").provider("php").mark("request__startup") { The examples below assume the target PHP binary is installed at /usr/bin/php. - The same USDT probes are also - exposed by other SAPIs built from the same source tree, so the + + The same USDT probes are also exposed by other SAPIs built from the same source tree, so the probe target may instead be the Apache module (libphp.so) or the FastCGI Process Manager binary (php-fpm); substitute the appropriate path or attach by PID with -p as needed. - Make sure the target binary is built with DTrace and that the environment is configured properly. See - Configuring PHP for DTrace Static Probes for details. + Make sure the target binary is built with DTrace and that the environment is configured properly. + See Configuring PHP for DTrace Static Probes for details. The static probes in PHP can be listed using From c10d08077917afd251c709b18868fe64ea4b8c02 Mon Sep 17 00:00:00 2001 From: sohei iwahori Date: Sun, 26 Apr 2026 22:23:05 +0900 Subject: [PATCH 5/5] Apply suggestions from code review Changes that should be changed to simpara Co-authored-by: Jordi Kroon --- features/dtrace.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/features/dtrace.xml b/features/dtrace.xml index 28f600321199..c221ac62248f 100644 --- a/features/dtrace.xml +++ b/features/dtrace.xml @@ -580,17 +580,17 @@ probe process("sapi/cli/php").provider("php").mark("request__startup") { - + The examples below assume the target PHP binary is installed at /usr/bin/php. - - + + The same USDT probes are also exposed by other SAPIs built from the same source tree, so the probe target may instead be the Apache module (libphp.so) or the FastCGI Process Manager binary (php-fpm); substitute the appropriate path or attach by PID with -p as needed. - + Make sure the target binary is built with DTrace and that the environment is configured properly. See Configuring PHP for DTrace Static Probes for details.