dt_handle.c revision b8fac8e162eda7e98db13dfa3e439e43f90f41d9
/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stddef.h>
#include <stdlib.h>
#include <strings.h>
#include <errno.h>
#include <unistd.h>
#include <assert.h>
#include <alloca.h>
#include <dt_impl.h>
#include <dt_program.h>
static const char _dt_errprog[] =
"dtrace:::ERROR"
"{"
" trace(arg1);"
" trace(arg2);"
" trace(arg3);"
" trace(arg4);"
" trace(arg5);"
"}";
int
{
/*
* We don't currently support multiple error handlers.
*/
/*
* If the DTRACEOPT_GRABANON is enabled, the anonymous enabling will
* already have a dtrace:::ERROR probe enabled; save 'hdlr' and 'arg'
* but do not bother compiling and enabling _dt_errprog.
*/
goto out;
out:
return (0);
}
int
{
return (0);
}
int
{
return (0);
}
int
void *arg)
{
return (0);
}
int
void *arg)
{
return (0);
}
static int
{
char where[30];
char details[30];
char offinfo[30];
const int slop = 80;
const char *faultstr;
char *str;
int len;
/*
* This is an error. We have the following items here: EPID,
* faulting action, DIF offset, fault code and faulting address.
*/
slop;
if (err.dteda_action == 0) {
} else {
}
} else {
offinfo[0] = 0;
}
switch (err.dteda_fault) {
case DTRACEFLT_BADADDR:
case DTRACEFLT_BADALIGN:
case DTRACEFLT_BADSTACK:
break;
default:
details[0] = 0;
}
"(ID %u: %s:%s:%s:%s): %s%s in %s%s\n",
return (0);
}
int
const char *faultstr)
{
const int slop = 80;
char *str;
int len;
slop;
"(ID %u: %s:%s:%s:%s): %s\n",
return (0);
}
#define DROPTAG(x) x, #x
static const struct {
char *dtdrg_tag;
} _dt_droptags[] = {
{ DROPTAG(DTRACEDROP_PRINCIPAL) },
{ DROPTAG(DTRACEDROP_DYNAMIC) },
{ DROPTAG(DTRACEDROP_DYNRINSE) },
{ DROPTAG(DTRACEDROP_DYNDIRTY) },
{ DROPTAG(DTRACEDROP_SPEC) },
{ DROPTAG(DTRACEDROP_SPECBUSY) },
{ DROPTAG(DTRACEDROP_DBLERROR) },
{ 0, NULL }
};
static const char *
{
int i;
return (_dt_droptags[i].dtdrg_tag);
}
return ("DTRACEDROP_UNKNOWN");
}
int
{
char str[80], *s;
int size;
if (dtp->dt_droptags) {
} else {
s = str;
}
return (0);
}
static const struct {
const char *dtdrt_str;
const char *dtdrt_msg;
} _dt_droptab[] = {
"dynamic variable drop" },
"dynamic variable drop", " with non-empty rinsing list" },
"dynamic variable drop", " with non-empty dirty list" },
"speculative drop" },
"failed speculation", " (available buffer(s) still busy)" },
"failed speculation", " (no speculative buffer available)" },
"jstack()/ustack() string table overflow" },
"error", " in ERROR probe enabling" },
{ 0, 0, NULL }
};
int
{
char str[80], *s;
int i, size;
/*
* First, check to see if we've been killed -- in which case we abort.
*/
continue;
if (dtp->dt_droptags) {
} else {
s = str;
}
}
return (0);
}
int
{
return (0);
return (0);
}
int
{
int rval;
switch (epd->dtepd_uarg) {
case DT_ECB_ERROR:
break;
default:
return (DTRACE_CONSUME_THIS);
}
if (rval == 0)
return (DTRACE_CONSUME_NEXT);
return (DTRACE_CONSUME_ERROR);
}