Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Landing basic framework for dtrace support (bug 388564). Patch by joh…

…n.rice@sun.com and padraig.obriain@sun.com. r+a=ted.mielczarek@gmail.com, sr=sayrer@gmail.com
  • Loading branch information...
commit d49aba142ab3249806ed566c45b6573195dd93d0 1 parent 929d3ee
jst@mozilla.org authored
1  Makefile.in
@@ -58,6 +58,7 @@ TIERS += base
58 58 tier_base_dirs = \
59 59 config \
60 60 build \
  61 + probes \
61 62 $(NULL)
62 63
63 64 include $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk
1  allmakefiles.sh
@@ -63,6 +63,7 @@ config/Makefile
63 63 config/autoconf.mk
64 64 config/mkdepend/Makefile
65 65 config/doxygen.cfg
  66 +probes/Makefile
66 67 extensions/Makefile
67 68 "
68 69
1  config/autoconf.mk.in
@@ -589,6 +589,7 @@ GCC_VERSION = @GCC_VERSION@
589 589 XCODEBUILD_VERSION= @XCODEBUILD_VERSION@
590 590 HAS_XCODE_2_1 = @HAS_XCODE_2_1@
591 591 UNIVERSAL_BINARY= @UNIVERSAL_BINARY@
  592 +HAVE_DTRACE= @HAVE_DTRACE@
592 593
593 594 VISIBILITY_FLAGS = @VISIBILITY_FLAGS@
594 595 WRAP_SYSTEM_INCLUDES = @WRAP_SYSTEM_INCLUDES@
27 config/rules.mk
@@ -981,6 +981,12 @@ endif
981 981 SUB_LOBJS = $(shell for lib in $(SHARED_LIBRARY_LIBS); do $(AR_LIST) $${lib} $(CLEANUP1); done;)
982 982 endif
983 983 endif
  984 +ifdef MOZILLA_PROBE_LIBS
  985 +PROBE_LOBJS = $(shell for lib in $(MOZILLA_PROBE_LIBS); do $(AR_LIST) $${lib} $(CLEANUP1); done;)
  986 +endif
  987 +ifdef DTRACE_PROBE_OBJ
  988 +EXTRA_DEPS += $(DTRACE_PROBE_OBJ)
  989 +endif
984 990
985 991 $(LIBRARY): $(OBJS) $(LOBJS) $(SHARED_LIBRARY_LIBS) $(EXTRA_DEPS) Makefile Makefile.in
986 992 rm -f $@
@@ -1070,7 +1076,26 @@ ifdef SHARED_LIBRARY_LIBS
1070 1076 @for lib in $(SHARED_LIBRARY_LIBS); do $(AR_EXTRACT) $${lib}; $(CLEANUP2); done
1071 1077 endif # SHARED_LIBRARY_LIBS
1072 1078 endif # NO_LD_ARCHIVE_FLAGS
1073   - $(MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(LOBJS) $(SUB_SHLOBJS) $(RESFILE) $(LDFLAGS) $(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE) $(SHLIB_LDENDFILE)
  1079 +ifdef NEED_DTRACE_PROBE_OBJ
  1080 + @rm -f $(PROBE_LOBJS)
  1081 + @for lib in $(MOZILLA_PROBE_LIBS); do $(AR_EXTRACT) $${lib}; $(CLEANUP2); done
  1082 + dtrace -G -C -32 -s $(MOZILLA_DTRACE_SRC) -o $(NEED_DTRACE_PROBE_OBJ) $(PROBE_LOBJS)
  1083 + @for lib in $(MOZILLA_PROBE_LIBS); do \
  1084 + ofiles=`$(AR_LIST) $${lib}`; \
  1085 + $(AR_DELETE) $${lib} $$ofiles; \
  1086 + done
  1087 + $(MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(LOBJS) $(SUB_SHLOBJS) $(NEED_DTRACE_PROBE_OBJ) $(PROBE_LOBJS) $(RESFILE) $(LDFLAGS) $(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE) $(SHLIB_LDENDFILE)
  1088 + @rm -f $(PROBE_LOBJS)
  1089 + @rm -f $(NEED_DTRACE_PROBE_OBJ)
  1090 + @for lib in $(MOZILLA_PROBE_LIBS); do \
  1091 + if [ -L $${lib} ]; then rm -f `readlink $${lib}`; fi; \
  1092 + done
  1093 + @rm -f $(MOZILLA_PROBE_LIBS)
  1094 +
  1095 +else
  1096 + $(MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(DTRACE_PROBE_OBJ) $(LOBJS) $(SUB_SHLOBJS) $(RESFILE) $(LDFLAGS) $(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE) $(SHLIB_LDENDFILE)
  1097 +endif # NEED_DTRACE_PROBE_OBJ
  1098 +
1074 1099 ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
1075 1100 ifdef MSMANIFEST_TOOL
1076 1101 ifdef EMBED_MANIFEST_AT
13 configure.in
@@ -2807,6 +2807,19 @@ AC_CHECK_HEADER(new, [NEW_H=new])
2807 2807 AC_DEFINE_UNQUOTED(NEW_H, <$NEW_H>)
2808 2808 AC_LANG_C
2809 2809
  2810 +AC_ARG_ENABLE(dtrace,
  2811 + build with dtrace support if available (default=no),
  2812 + [enable_dtrace="yes"],)
  2813 +if test "x$enable_dtrace" = "xyes"; then
  2814 + AC_CHECK_HEADER(sys/sdt.h, HAVE_DTRACE=1)
  2815 + if test -n "$HAVE_DTRACE"; then
  2816 + AC_DEFINE(INCLUDE_MOZILLA_DTRACE)
  2817 + else
  2818 + AC_MSG_ERROR([dtrace enabled but sys/std.h not found]);
  2819 + fi
  2820 +fi
  2821 +AC_SUBST(HAVE_DTRACE)
  2822 +
2810 2823 case $target in
2811 2824 *-aix4.3*|*-aix5*)
2812 2825 ;;
55 probes/Makefile.in
... ... @@ -0,0 +1,55 @@
  1 +# ***** BEGIN LICENSE BLOCK *****
  2 +# Version: MPL 1.1/GPL 2.0/LGPL 2.1
  3 +#
  4 +# The contents of this file are subject to the Mozilla Public License Version
  5 +# 1.1 (the "License"); you may not use this file except in compliance with
  6 +# the License. You may obtain a copy of the License at
  7 +# http://www.mozilla.org/MPL/
  8 +#
  9 +# Software distributed under the License is distributed on an "AS IS" basis,
  10 +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11 +# for the specific language governing rights and limitations under the
  12 +# License.
  13 +#
  14 +# The Original Code is mozilla.org code.
  15 +#
  16 +# The Initial Developer of the Original Code is
  17 +# Mozilla Corporation.
  18 +# Portions created by the Initial Developer are Copyright (C) 2007
  19 +# the Initial Developer. All Rights Reserved.
  20 +#
  21 +# Contributor(s):
  22 +#
  23 +# Alternatively, the contents of this file may be used under the terms of
  24 +# either the GNU General Public License Version 2 or later (the "GPL"), or
  25 +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  26 +# in which case the provisions of the GPL or the LGPL are applicable instead
  27 +# of those above. If you wish to allow use of your version of this file only
  28 +# under the terms of either the GPL or the LGPL, and not to allow others to
  29 +# use your version of this file under the terms of the MPL, indicate your
  30 +# decision by deleting the provisions above and replace them with the notice
  31 +# and other provisions required by the GPL or the LGPL. If you do not delete
  32 +# the provisions above, a recipient may use your version of this file under
  33 +# the terms of any one of the MPL, the GPL or the LGPL.
  34 +#
  35 +# ***** END LICENSE BLOCK *****
  36 +
  37 +DEPTH = ..
  38 +topsrcdir = @top_srcdir@
  39 +srcdir = @srcdir@
  40 +VPATH = @srcdir@
  41 +
  42 +include $(DEPTH)/config/autoconf.mk
  43 +
  44 +ifdef HAVE_DTRACE
  45 +export:: $(DIST)/include/mozilla-trace.h
  46 +
  47 +# Replace _DTRACE_VERSION with INCLUDE_MOZILLA_DTRACE
  48 +$(DIST)/include/mozilla-trace.h: mozilla-trace.d Makefile
  49 + dtrace -h -s $(srcdir)/mozilla-trace.d -o mozilla-trace.h.tmp
  50 + sed -e 's/if _DTRACE_VERSION/ifdef INCLUDE_MOZILLA_DTRACE/' \
  51 + mozilla-trace.h.tmp > $(DIST)/include/mozilla-trace.h
  52 + rm mozilla-trace.h.tmp
  53 +endif
  54 +
  55 +include $(topsrcdir)/config/rules.mk
48 probes/mozilla-trace.d
... ... @@ -0,0 +1,48 @@
  1 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2 +/* ***** BEGIN LICENSE BLOCK *****
  3 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4 + *
  5 + * The contents of this file are subject to the Mozilla Public License Version
  6 + * 1.1 (the "License"); you may not use this file except in compliance with
  7 + * the License. You may obtain a copy of the License at
  8 + * http://www.mozilla.org/MPL/
  9 + *
  10 + * Software distributed under the License is distributed on an "AS IS" basis,
  11 + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12 + * for the specific language governing rights and limitations under the
  13 + * License.
  14 + *
  15 + * Copyright (C) 2007 Sun Microsystems, Inc. All Rights Reserved.
  16 + *
  17 + * Alternatively, the contents of this file may be used under the terms of
  18 + * either the GNU General Public License Version 2 or later (the "GPL"), or
  19 + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  20 + * in which case the provisions of the GPL or the LGPL are applicable instead
  21 + * of those above. If you wish to allow use of your version of this file only
  22 + * under the terms of either the GPL or the LGPL, and not to allow others to
  23 + * use your version of this file under the terms of the MPL, indicate your
  24 + * decision by deleting the provisions above and replace them with the notice
  25 + * and other provisions required by the GPL or the LGPL. If you do not delete
  26 + * the provisions above, a recipient may use your version of this file under
  27 + * the terms of any one of the MPL, the GPL or the LGPL.
  28 + *
  29 + * ***** END LICENSE BLOCK ***** */
  30 +/*
  31 + * mozilla provider probes:
  32 + * Data types defined in the generated file mozilla-trace.h
  33 + *
  34 + * TBD
  35 + */
  36 +
  37 +provider mozilla {
  38 + /* Probe definitions go here */
  39 +};
  40 +
  41 +/*
  42 +#pragma D attributes Unstable/Unstable/Common provider mozilla provider
  43 +#pragma D attributes Private/Private/Unknown provider mozilla module
  44 +#pragma D attributes Private/Private/Unknown provider mozilla function
  45 +#pragma D attributes Unstable/Unstable/Common provider mozilla name
  46 +#pragma D attributes Unstable/Unstable/Common provider mozilla args
  47 +*/
  48 +

0 comments on commit d49aba1

Please sign in to comment.
Something went wrong with that request. Please try again.