xref: /freebsd/sys/kern/kern_sdt.c (revision a776a1c1c5597a174fa95f7d6d2be2f8bb50d274)
15572901bSJohn Birrell /*-
25572901bSJohn Birrell  * Copyright 2006-2008 John Birrell <jb@FreeBSD.org>
35572901bSJohn Birrell  *
45572901bSJohn Birrell  * Redistribution and use in source and binary forms, with or without
55572901bSJohn Birrell  * modification, are permitted provided that the following conditions
65572901bSJohn Birrell  * are met:
75572901bSJohn Birrell  * 1. Redistributions of source code must retain the above copyright
85572901bSJohn Birrell  *    notice, this list of conditions and the following disclaimer.
95572901bSJohn Birrell  * 2. Redistributions in binary form must reproduce the above copyright
105572901bSJohn Birrell  *    notice, this list of conditions and the following disclaimer in the
115572901bSJohn Birrell  *    documentation and/or other materials provided with the distribution.
125572901bSJohn Birrell  *
135572901bSJohn Birrell  * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
145572901bSJohn Birrell  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
155572901bSJohn Birrell  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
165572901bSJohn Birrell  * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
175572901bSJohn Birrell  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
185572901bSJohn Birrell  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
195572901bSJohn Birrell  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
205572901bSJohn Birrell  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
215572901bSJohn Birrell  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
225572901bSJohn Birrell  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
235572901bSJohn Birrell  * SUCH DAMAGE.
245572901bSJohn Birrell  *
255572901bSJohn Birrell  * $FreeBSD$
265572901bSJohn Birrell  */
275572901bSJohn Birrell 
285572901bSJohn Birrell #include <sys/param.h>
295572901bSJohn Birrell #include <sys/systm.h>
305572901bSJohn Birrell #include <sys/sdt.h>
315572901bSJohn Birrell 
32*a776a1c1SAndriy Gapon SDT_PROVIDER_DEFINE(sdt);
33*a776a1c1SAndriy Gapon 
345572901bSJohn Birrell /*
358776669bSMark Johnston  * Hook for the DTrace probe function. The SDT provider will set this to
368776669bSMark Johnston  * dtrace_probe() when it loads.
375572901bSJohn Birrell  */
385572901bSJohn Birrell sdt_probe_func_t sdt_probe_func = sdt_probe_stub;
395572901bSJohn Birrell 
405572901bSJohn Birrell /*
415572901bSJohn Birrell  * This is a stub for probe calls in case kernel DTrace support isn't
428776669bSMark Johnston  * enabled. It should never get called because there is no DTrace support
438776669bSMark Johnston  * to enable it.
445572901bSJohn Birrell  */
455572901bSJohn Birrell void
4660ae52f7SEd Schouten sdt_probe_stub(uint32_t id, uintptr_t arg0, uintptr_t arg1,
475572901bSJohn Birrell     uintptr_t arg2, uintptr_t arg3, uintptr_t arg4)
485572901bSJohn Birrell {
498776669bSMark Johnston 
505572901bSJohn Birrell 	printf("sdt_probe_stub: Why did this get called?\n");
515572901bSJohn Birrell }
52