/*
* 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.
*/
/*
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
#include <vm/seg_kmem.h>
#include <sys/sdt_impl.h>
int sdt_verbose = 0;
#define SDT_REG_G0 0
0x3fffffff))
#define SDT_FMT3_RS2_SHIFT 0
static void
{
} else {
}
instr++;
*instr++ = SDT_RESTORE;
*trampoline = instr;
}
/*ARGSUSED*/
static void
{
int len;
/*
* One for all, and all for one: if we haven't yet registered all of
* our providers, we'll refuse to provide anything.
*/
return;
}
return;
/*
*/
sizeof (struct modctl)) == 0;
/*
* If there hasn't been an sdt table allocated, we'll do so now.
*/
nprobes++;
}
/*
* We could (should?) determine precisely the size of the
* table -- but a reasonable maximum will suffice.
*/
"for module %s", modname);
return;
}
}
int i, j;
break;
}
}
for (i = 0, j = 0; name[j] != '\0'; i++) {
nname[i] = '-';
j += 2;
} else {
}
}
nname[i] = '\0';
func = "<unknown>";
/*
* We have our provider. Now create the probe.
*/
} else {
mp->sdt_nprobes++;
}
sdpd->sdpd_offset);
}
}
/*ARGSUSED*/
static void
{
}
}
}
}
/*ARGSUSED*/
static int
{
ctl->mod_nenabled++;
/*
* If this module has disappeared since we discovered its probes,
* refuse to enable it.
*/
if (sdt_verbose) {
"(module %s unloaded)",
}
goto err;
}
/*
* Now check that our modctl has the expected load count. If it
* doesn't, this module must have been unloaded and reloaded -- and
* we're not going to touch it.
*/
if (sdt_verbose) {
"(module %s reloaded)",
}
goto err;
}
}
err:
return (0);
}
/*ARGSUSED*/
static void
{
ctl->mod_nenabled--;
goto err;
}
err:
;
}
NULL,
NULL,
NULL,
NULL,
NULL,
};
static int
{
switch (cmd) {
case DDI_ATTACH:
break;
case DDI_RESUME:
return (DDI_SUCCESS);
default:
return (DDI_FAILURE);
}
return (DDI_FAILURE);
}
} else {
}
}
}
return (DDI_SUCCESS);
}
static int
{
switch (cmd) {
case DDI_DETACH:
break;
case DDI_SUSPEND:
return (DDI_SUCCESS);
default:
return (DDI_FAILURE);
}
return (DDI_FAILURE);
}
}
return (DDI_SUCCESS);
}
/*ARGSUSED*/
static int
{
int error;
switch (infocmd) {
case DDI_INFO_DEVT2DEVINFO:
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);
}
sdt_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 */
sdt_info, /* get_dev_info */
nulldev, /* identify */
nulldev, /* probe */
sdt_attach, /* attach */
sdt_detach, /* detach */
nodev, /* reset */
&sdt_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) */
"Statically Defined Tracing", /* name of module */
&sdt_ops, /* driver ops */
};
(void *)&modldrv,
};
int
_init(void)
{
return (mod_install(&modlinkage));
}
int
{
}
int
_fini(void)
{
return (mod_remove(&modlinkage));
}