1179089Sjb/*-
2179089Sjb * Copyright 2006-2008 John Birrell <jb@FreeBSD.org>
3179089Sjb *
4179089Sjb * Redistribution and use in source and binary forms, with or without
5179089Sjb * modification, are permitted provided that the following conditions
6179089Sjb * are met:
7179089Sjb * 1. Redistributions of source code must retain the above copyright
8179089Sjb *    notice, this list of conditions and the following disclaimer.
9179089Sjb * 2. Redistributions in binary form must reproduce the above copyright
10179089Sjb *    notice, this list of conditions and the following disclaimer in the
11179089Sjb *    documentation and/or other materials provided with the distribution.
12179089Sjb *
13179089Sjb * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14179089Sjb * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15179089Sjb * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16179089Sjb * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
17179089Sjb * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18179089Sjb * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19179089Sjb * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20179089Sjb * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21179089Sjb * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22179089Sjb * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23179089Sjb * SUCH DAMAGE.
24179089Sjb *
25179089Sjb * $FreeBSD$
26179089Sjb */
27179089Sjb
28179089Sjb#include "opt_kdtrace.h"
29179089Sjb
30179089Sjb#include <sys/param.h>
31179089Sjb#include <sys/systm.h>
32263283Smarkj#include <sys/kdb.h>
33179089Sjb#include <sys/sdt.h>
34179089Sjb
35262058SavgSDT_PROVIDER_DEFINE(sdt);
36262058Savg
37179089Sjb/*
38254268Smarkj * Hook for the DTrace probe function. The SDT provider will set this to
39254268Smarkj * dtrace_probe() when it loads.
40179089Sjb */
41179089Sjbsdt_probe_func_t sdt_probe_func = sdt_probe_stub;
42179089Sjb
43179089Sjb/*
44179089Sjb * This is a stub for probe calls in case kernel DTrace support isn't
45254268Smarkj * enabled. It should never get called because there is no DTrace support
46254268Smarkj * to enable it.
47179089Sjb */
48179089Sjbvoid
49209390Sedsdt_probe_stub(uint32_t id, uintptr_t arg0, uintptr_t arg1,
50179089Sjb    uintptr_t arg2, uintptr_t arg3, uintptr_t arg4)
51179089Sjb{
52254268Smarkj
53263283Smarkj	printf("sdt_probe_stub: unexpectedly called\n");
54263283Smarkj	kdb_backtrace();
55179089Sjb}
56