From owner-p4-projects@FreeBSD.ORG Mon Jun 26 06:29: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 5443E16A5A5; Mon, 26 Jun 2006 06:29:42 +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 2846F16A533 for ; Mon, 26 Jun 2006 06:29:41 +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 5587A4453A for ; Mon, 26 Jun 2006 06:06:04 +0000 (GMT) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k5Q664US022828 for ; Mon, 26 Jun 2006 06:06:04 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5Q664Z4022825 for perforce@freebsd.org; Mon, 26 Jun 2006 06:06:04 GMT (envelope-from jb@freebsd.org) Date: Mon, 26 Jun 2006 06:06:04 GMT Message-Id: <200606260606.k5Q664Z4022825@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 100032 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: Mon, 26 Jun 2006 06:29:43 -0000 http://perforce.freebsd.org/chv.cgi?CH=100032 Change 100032 by jb@jb_freebsd2 on 2006/06/26 06:05:41 Change the dtrace_load function to run off a system initialisation level so that it is ready for service as early in the boot as possible. Affected files ... .. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_load.c#14 edit Differences ... ==== //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_load.c#14 (text+ko) ==== @@ -22,18 +22,10 @@ * */ -/* - * This function implements similar code to the Solaris dtrace_attach() - * function. - */ - -static int -dtrace_load() +static void +dtrace_load(void *dummy) { dtrace_provider_id_t id; - dtrace_state_t *state = NULL; - dtrace_enabling_t *enab; - int error = 0; /* Hang our hook for DTrace traps during probes. */ dtrace_instr_size_func = dtrace_instr_size; @@ -166,9 +158,6 @@ dtrace_probeid_error = dtrace_probe_create((dtrace_provider_id_t) dtrace_provider, NULL, NULL, "ERROR", 1, NULL); -dtrace_err_verbose = 1; - - dtrace_anon_property(); mutex_exit(&cpu_lock); /* @@ -182,48 +171,8 @@ dtrace_helptrace_next = 0; } - /* - * If there are already providers, we must ask them to provide their - * probes, and then match any anonymous enabling against them. Note - * that there should be no other retained enablings at this time: - * the only retained enablings at this time should be the anonymous - * enabling. - */ - if (dtrace_anon.dta_enabling != NULL) { - ASSERT(dtrace_retained == dtrace_anon.dta_enabling); - - dtrace_enabling_provide(NULL); - state = dtrace_anon.dta_state; - - /* - * We couldn't hold cpu_lock across the above call to - * dtrace_enabling_provide(), but we must hold it to actually - * enable the probes. We have to drop all of our locks, pick - * up cpu_lock, and regain our locks before matching the - * retained anonymous enabling. - */ - mutex_exit(&dtrace_lock); - mutex_exit(&dtrace_provider_lock); - - mutex_enter(&cpu_lock); - mutex_enter(&dtrace_provider_lock); - mutex_enter(&dtrace_lock); - - if ((enab = dtrace_anon.dta_enabling) != NULL) - (void) dtrace_enabling_match(enab, NULL); - - mutex_exit(&cpu_lock); - } - mutex_exit(&dtrace_lock); mutex_exit(&dtrace_provider_lock); - if (state != NULL) { - /* - * If we created any anonymous state, set it going now. - */ - (void) dtrace_state_go(state, &dtrace_anon.dta_beganon); - } - - return (error); + return; }