Bug 55793 - DTrace/SystemTap support
Summary: DTrace/SystemTap support
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Core (show other bugs)
Version: 2.4.6
Hardware: PC Linux
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Depends on:
Reported: 2013-11-18 14:41 UTC by Sergey Klyaus
Modified: 2015-06-17 21:30 UTC (History)
1 user (show)

Patch to support DTrace/SystemTap for Apache 2.4.6 (34.84 KB, patch)
2013-11-18 14:41 UTC, Sergey Klyaus
Details | Diff
Modified version for 2.4.9 (33.38 KB, text/x-c)
2014-05-27 13:14 UTC, Petr Sumbera

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Klyaus 2013-11-18 14:41:44 UTC
Created attachment 31051 [details]
Patch to support DTrace/SystemTap for Apache 2.4.6


DTrace support were implemented in Apache 2.3.0, but it never been buildable.
There is a patch to fix that: http://people.apache.org/~trawick/httpd-trunk-dtrace.html but it is a bit out-of-date

I've upgraded patch to stable apache version (2.4.6) + added SystemTap (Linux) support and tested build with and without --enable-dtrace on Solaris 11 and CentOS Linux 6.4. 

However, I have some concerns about original patch:
1. It's a bit tricky: needs to create a lot of intermediate files if building with DTrace/SystemTap support
2. Hook probes are actually useless because they do not provide hook function arguments to DTrace/SystemTap

BR, Sergey.
Comment 1 Petr Sumbera 2014-05-27 13:14:36 UTC
Created attachment 31665 [details]
Modified version for 2.4.9

Modified for version 2.4.9 and for building outside of source directory.
Comment 2 Sergey Klyaus 2015-06-17 21:30:06 UTC
It seems that original patch is a bit incorrect, it didn't exclude apache_noprobes.h from export files. And in some cases (observed at CentOS 7, which is probably has newer GCC), apache_noprobes.h redefined probes and ruined SystemTap USDT probes. 

This small command fixes this:

   $ sed -i 's/apache_probes.h/"apache_.*probes.h"/' server/Makefile.in

Sorry that I'm too lazy to create a new patch.