is dtrace usable?

Alexander Leidinger Alexander at Leidinger.net
Wed Mar 10 10:34:34 UTC 2010


Quoting "Robert N. M. Watson" <rwatson at freebsd.org> (from Tue, 9 Mar  
2010 16:39:09 +0000):

>
> On Mar 9, 2010, at 2:16 PM, Alexander Leidinger wrote:
>
>>> From this you can see that sys.mk is included and parsed before 'Makefile',
>>> so the WITH_CTF=yes is not set until after sys.mk has been parsed.
>>
>> I think we need to find a different solution for this. The need to  
>> specify WITH_CTF at the command line is very error prone. :(
>
> You are neither the first person to have made this observation, nor  
> the first person to have failed to propose a solution in the form of  
> a patch :-).

It is not a problem to provide a patch, the problem is something else.

Is it correct that the result of the ctfmerge/cftconvert stuff is not  
covered by the CDDL?

If yes, why not use it by default if the programs are available (I've  
read the comment for the NO_CTF part, but IMO we have a chicken&egg  
situation here, dtrace will not become popular if it is not easy to  
use it)? This default can be made only for the kernel (by making a  
copy of the definition of CTFCONVERT into bsd.prog.mk and bsd.lib.mk,  
or by undefining it there), or for kernel+userland (removing the  
!WITH_CTF -> NO_CTF part from sys.mk).

Theoretically I have a patch for that, but somehow I stumple over  
something strange which I don't understand. I have the following  
(/usr/share/mk and /usr/src/share/mk are the same):
---snip---
--- bsd.lib.mk  (revision 204031)
+++ bsd.lib.mk  (working copy)
@@ -36,6 +36,18 @@
  .if defined(DEBUG_FLAGS)
  CFLAGS+= ${DEBUG_FLAGS}

+# Turn CTF conversion off by default for now. This default could be
+# changed later if DTrace becomes popular.
+NO_CTF= 1
+.if defined(WITH_CTF)
+.undef NO_CTF
+.endif
+
+.if defined(NO_CTF)
+.undef CTFCONVERT
+.undef CTFMERGE
+.endif
+
  .if !defined(NO_CTF) && (${DEBUG_FLAGS:M-g} != "")
  CTFFLAGS+= -g
  .endif
[some more stuff to make the CTFCONVERT/CTFMERGE stuff working]
--- sys.mk      (revision 204031)
+++ sys.mk      (working copy)
@@ -46,12 +46,6 @@
  .endif
  PO_CFLAGS      ?=      ${CFLAGS}

-# Turn CTF conversion off by default for now. This default could be
-# changed later if DTrace becomes popular.
-.if !defined(WITH_CTF)
-NO_CTF         =       1
-.endif
-
  # C Type Format data is required for DTrace
  CTFFLAGS       ?=      -L VERSION

[some more stuff to make the CTFCONVERT/CTFMERGE stuff working]
--- bsd.prog.mk (revision 204031)
+++ bsd.prog.mk (working copy)
@@ -19,6 +19,18 @@
  CFLAGS+=${DEBUG_FLAGS}
  CXXFLAGS+=${DEBUG_FLAGS}

+# Turn CTF conversion off by default for now. This default could be
+# changed later if DTrace becomes popular.
+NO_CTF= 1
+.if defined(WITH_CTF)
+.undef NO_CTF
+.endif
+
+.if defined(NO_CTF)
+.undef CTFCONVERT
+.undef CTFMERGE
+.endif
+
  .if !defined(NO_CTF) && (${DEBUG_FLAGS:M-g} != "")
  CTFFLAGS+= -g
  .endif
[some more stuff to make the CTFCONVERT/CTFMERGE stuff working]
---snip---

When I go to /usr/src/bin/mv and run "make -V NO_CTF -V WITH_CTF" I  
only get empty output. I would expect to see NO_CTF set to 1. And when  
grepping for NO_CTF in /usr/share/mk I only see the undef of NO_CTF  
which I added myself in the above patch.

Bye,
Alexander.

-- 
Life is just a bowl of cherries, but why do I always get the pits?

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137


More information about the freebsd-stable mailing list