dt_program.c revision 2b6e762c557496a41438c0b105d604f60c593682
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <unistd.h>
#include <strings.h>
#include <stdlib.h>
#include <errno.h>
#include <assert.h>
#include <ctype.h>
#include <alloca.h>
#include <dt_impl.h>
#include <dt_program.h>
#include <dt_printf.h>
#include <dt_provider.h>
{
else
/*
* By default, programs start with DOF version 1 so that output files
* containing DOF are backward compatible. If a program requires new
* DOF features, the version is increased as needed.
*/
return (pgp);
}
void
{
uint_t i;
}
for (i = 0; i < pgp->dp_xrefslen; i++)
}
/*ARGSUSED*/
void
{
return;
} else {
}
continue;
pip->dpi_descattr =
pip->dpi_stmtattr =
/*
* If there aren't any actions, account for the fact that
* recording the epid will generate a record.
*/
pip->dpi_recgens++;
pip->dpi_speculations++;
continue;
}
pip->dpi_aggregates++;
continue;
}
continue;
DIF_TYPE_CTF &&
continue;
pip->dpi_recgens++;
}
}
}
int
{
void *dof;
int n, err;
return (-1);
if (n == -1) {
switch (errno) {
case EINVAL:
err = EDT_DIFINVAL;
break;
case EFAULT:
err = EDT_DIFFAULT;
break;
case E2BIG:
err = EDT_DIFSIZE;
break;
default:
}
}
pip->dpi_matches += n;
return (0);
}
static void
{
edp->dted_refcnt++;
}
void
{
if (--edp->dted_refcnt > 0)
return;
}
{
return (NULL);
}
return (edp);
}
{
return (NULL);
return (sdp);
}
{
return (NULL);
} else {
else
}
return (new);
}
int
{
return (-1); /* errno is set for us */
return (0);
}
int
{
int status = 0;
break;
}
return (status);
}
void
{
/*
* We need to remove any actions that we have on this ECB, and
* remove our hold on the ECB itself.
*/
break;
break;
}
else
/*
* We have now removed our action list from its ECB; we can
* safely destroy the list.
*/
}
}
}
typedef struct dt_header_info {
char *dthi_pmname; /* provider macro name */
char *dthi_pfname; /* provider function name */
int dthi_empty; /* should we generate empty macros */
static void
{
for (;;) {
} else if (*str == '-') {
*buf++ = '_';
str++;
} else if (*str == '.') {
*buf++ = '_';
str++;
break;
}
}
}
static void
{
for (;;) {
if (*str == '-') {
*buf++ = '_';
*buf++ = '_';
str++;
break;
}
}
}
/*ARGSUSED*/
static int
{
char buf[DT_TYPE_NAMELEN];
char *fname;
const char *p;
int i;
p++;
}
return (0);
}
/*ARGSUSED*/
static int
{
const char *p;
int i;
p++;
}
if (!infop->dthi_empty) {
}
}
if (!infop->dthi_empty) {
} else {
}
return (0);
}
static int
{
const char *p;
int i;
return (0);
/*
* Count the instances of the '-' character since we'll need to double
* those up.
*/
p++;
info.dthi_empty = 0;
return (-1); /* dt_errno is set for us */
return (-1); /* dt_errno is set for us */
return (-1); /* dt_errno is set for us */
return (0);
}
int
{
char *mfname, *p;
fname = p + 1;
}
return (-1);
return (-1);
return (-1); /* dt_errno is set for us */
}
return (0);
}