Bug #52790 Autconf Check for DTrace Assumes it is only available on Solaris
Submitted: 13 Apr 2010 16:03 Modified: 12 Aug 2010 10:41
Reporter: Padraig O'Sullivan (OCA) Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.5+ OS:Any (Linux, Mac OS X)
Assigned to: CPU Architecture:Any
Tags: DTrace, systemtap

[13 Apr 2010 16:03] Padraig O'Sullivan
Description:
The autoconf check for DTrace assumes that DTrace is only available on Solaris. 

This means that if I want to use MySQL with DTrace on OSX, the static probes will not be compiled.

Also, SystemTap on Linux now comes with a dtrace python script that allows the static DTrace probes to be used with SystemTap.

We can see in the dtrace.m4 file the issue:

AC_DEFINE([HAVE_DTRACE], [1], [Defined to 1 if DTrace support is enabled])
  case "$target_os" in
    *solaris*)
      HAVE_DTRACE_DASH_G="yes"
      ;;
    *)
      HAVE_DTRACE_DASH_G="no"
      ;;
  esac

How to repeat:
Go to either OSX or a Linux box with the latest version of SystemTap installed and pass the --enable-dtrace flag to the configure script.

DTrace will not be enabled on these platforms even if DTrace is in the user's path.

Suggested fix:
Update the dtrace autoconf file to take other platforms besides Solaris into account.

Drizzle has an example of how it is done to take other platforms into account in the pandora_enable_dtrace.m4 file in the m4 directory.
[13 Apr 2010 16:21] Valeriy Kravchuk
Thank you for the problem report. Verified (also with mysql-next-mr tree) by code review.
[21 Apr 2010 11:33] Vladislav Vaintroub
Works fine when built with CMake (on Solaris,  OSX and Linux with systemtap)
[12 Aug 2010 10:41] Alexey Kopytov
We do not assume that DTrace is only available on Solaris. The quoted snippet only assumes that the '-G' switch to the dtrace command is only available on Solaris (which is true as far as I know).

The actual availability of DTrace is tested by looking if the dtrace utility is available in either $PATH or /usr/sbin. That definitely works on OS X, and it should work with SystemTap as well.

Changing to "Not a Bug".