/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sys/systrace.h>
#endif
static void
{
int i;
}
for (i = 0; i < NSYSCALL; i++) {
systrace_sysent_t *s = &sysent[i];
if (LOADABLE_SYSCALL(a) && !LOADED_SYSCALL(a))
continue;
if (a->sy_callc == dtrace_systrace_syscall)
continue;
#ifdef _SYSCALL32_IMPL
if (a->sy_callc == dtrace_systrace_syscall32)
continue;
#endif
s->stsy_underlying = a->sy_callc;
}
}
/*ARGSUSED*/
static void
{
int i;
return;
#ifdef _SYSCALL32_IMPL
#endif
for (i = 0; i < NSYSCALL; i++) {
continue;
syscallnames[i], "entry") != 0)
continue;
"entry", SYSTRACE_ARTIFICIAL_FRAMES,
(void *)((uintptr_t)SYSTRACE_ENTRY(i)));
"return", SYSTRACE_ARTIFICIAL_FRAMES,
(void *)((uintptr_t)SYSTRACE_RETURN(i)));
#ifdef _SYSCALL32_IMPL
#endif
}
}
/*ARGSUSED*/
static void
{
/*
* There's nothing to do here but assert that we have actually been
* disabled.
*/
#ifdef _SYSCALL32_IMPL
#endif
} else {
#ifdef _SYSCALL32_IMPL
#endif
}
}
/*ARGSUSED*/
static int
{
#ifdef _SYSCALL32_IMPL
#endif
} else {
#ifdef _SYSCALL32_IMPL
#endif
}
if (enabled) {
return (0);
}
(void *)dtrace_systrace_syscall);
#ifdef _SYSCALL32_IMPL
(void *)dtrace_systrace_syscall32);
#endif
return (0);
}
/*ARGSUSED*/
static void
{
if (disable) {
(void *)dtrace_systrace_syscall,
#ifdef _SYSCALL32_IMPL
(void *)dtrace_systrace_syscall32,
#endif
}
#ifdef _SYSCALL32_IMPL
#endif
} else {
#ifdef _SYSCALL32_IMPL
#endif
}
}
};
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
};
static int
{
switch (cmd) {
case DDI_ATTACH:
break;
case DDI_RESUME:
return (DDI_SUCCESS);
default:
return (DDI_FAILURE);
}
systrace_probe = (void (*)())dtrace_probe;
membar_enter();
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
static int
{
switch (cmd) {
case DDI_DETACH:
break;
case DDI_SUSPEND:
return (DDI_SUCCESS);
default:
return (DDI_FAILURE);
}
if (dtrace_unregister(systrace_id) != 0)
return (DDI_FAILURE);
return (DDI_SUCCESS);
}
/*ARGSUSED*/
static int
{
int error;
switch (infocmd) {
case DDI_INFO_DEVT2DEVINFO:
*result = (void *)systrace_devi;
error = DDI_SUCCESS;
break;
case DDI_INFO_DEVT2INSTANCE:
*result = (void *)0;
error = DDI_SUCCESS;
break;
default:
error = DDI_FAILURE;
}
return (error);
}
/*ARGSUSED*/
static int
{
return (0);
}
systrace_open, /* open */
nodev, /* close */
nulldev, /* strategy */
nulldev, /* print */
nodev, /* dump */
nodev, /* read */
nodev, /* write */
nodev, /* ioctl */
nodev, /* devmap */
nodev, /* mmap */
nodev, /* segmap */
nochpoll, /* poll */
ddi_prop_op, /* cb_prop_op */
0, /* streamtab */
};
DEVO_REV, /* devo_rev, */
0, /* refcnt */
systrace_info, /* get_dev_info */
nulldev, /* identify */
nulldev, /* probe */
systrace_attach, /* attach */
systrace_detach, /* detach */
nodev, /* reset */
&systrace_cb_ops, /* driver operations */
NULL, /* bus operations */
nodev, /* dev power */
ddi_quiesce_not_needed, /* quiesce */
};
/*
* Module linkage information for the kernel.
*/
&mod_driverops, /* module type (this is a pseudo driver) */
"System Call Tracing", /* name of module */
&systrace_ops, /* driver ops */
};
(void *)&modldrv,
};
int
_init(void)
{
return (mod_install(&modlinkage));
}
int
{
}
int
_fini(void)
{
return (mod_remove(&modlinkage));
}