From owner-p4-projects@FreeBSD.ORG Wed Apr 19 20:14:43 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5513A16A409; Wed, 19 Apr 2006 20:14:43 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F015A16A405 for ; Wed, 19 Apr 2006 20:14:42 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AFE8E43D62 for ; Wed, 19 Apr 2006 20:14:42 +0000 (GMT) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k3JKEgpD006196 for ; Wed, 19 Apr 2006 20:14:42 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k3JKEgQO006184 for perforce@freebsd.org; Wed, 19 Apr 2006 20:14:42 GMT (envelope-from jb@freebsd.org) Date: Wed, 19 Apr 2006 20:14:42 GMT Message-Id: <200604192014.k3JKEgQO006184@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 95622 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Apr 2006 20:14:43 -0000 http://perforce.freebsd.org/chv.cgi?CH=95622 Change 95622 by jb@jb_freebsd2 on 2006/04/19 20:14:39 Enable _dtrace_init() as a constructor. This is the most convenient way to turn on debug in dtrace(1). Another way is via the '-x debug' command like argument, but quite a lot of initialisation takes place before options like that are processed. Affected files ... .. //depot/projects/dtrace/src/contrib/opensolaris/lib/libdtrace/common/dt_open.c#6 edit Differences ... ==== //depot/projects/dtrace/src/contrib/opensolaris/lib/libdtrace/common/dt_open.c#6 (text) ==== @@ -640,17 +640,21 @@ #if defined(sun) #pragma init(_dtrace_init) +#else +void _dtrace_init(void) __attribute__ ((constructor)); +#endif void _dtrace_init(void) { _dtrace_debug = getenv("DTRACE_DEBUG") != NULL; +#if defined(sun) for (; _dtrace_rdvers > 0; _dtrace_rdvers--) { if (rd_init(_dtrace_rdvers) == RD_OK) break; } +#endif } -#endif static dtrace_hdl_t * set_open_errno(dtrace_hdl_t *dtp, int *errp, int err)