probes_ext.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 (c) 1994, by Sun Microsytems, Inc.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Published interfaces for probe control.
*/
#ifndef DEBUG
#define NDEBUG 1
#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <assert.h>
#include <stddef.h>
#include "tnfctl_int.h"
#include "kernel_int.h"
#include "dbg.h"
struct pr_func_args {
void *calldata;
};
prbctlref_t *, void *);
prbctlref_t *, void *);
void (*destroy_func)(void *))
{
if (hndl->destroy_func) {
/*
* not the first time the register_funcs() is being called
* First call currently registered destroy_func on all
* probes
*/
if (prexstat)
return (prexstat);
}
/* set up new creator and destructor functions */
/* call new creator function for all current probes */
if (create_func) {
if (prexstat)
return (prexstat);
}
return (TNFCTL_ERR_NONE);
}
{
return (TNFCTL_ERR_NONE);
}
{
return (TNFCTL_ERR_NONE);
}
void *calldata)
{
struct pr_func_args pr_args;
return (prexstat);
}
void *calldata)
{
/*LINTED statement has no consequent: else*/
/* select probes based on numbers */
for (i = 0; i < probe_count; i++, id_p++) {
while (obj_p) {
break;
}
}
goto end_of_func;
}
if (prexstat)
goto end_of_func;
}
/*LINTED statement has no consequent: else*/
return (prexstat);
}
{
char **func_names;
if (prexstat)
return (prexstat);
}
/*LINTED statement has no consequent: else*/
goto end_of_func;
}
/* skip code upto label */
goto end_of_func;
}
/* process mode - get the probe functions */
&func_names, &func_addrs);
if (prexstat)
goto end_of_func;
/* if there are any probe functions */
if (func_names[0] != NULL) {
} else {
}
/*LINTED statement has no consequent: else*/
return (prexstat);
}
static tnfctl_errcode_t
{
if (prexstat)
return (prexstat);
/* process tracing */
return (TNFCTL_ERR_NOBUF);
}
return (TNFCTL_ERR_BUFBROKEN);
return (TNFCTL_ERR_INVALIDPROBE);
}
return (TNFCTL_ERR_NONE);
}
{
/*LINTED statement has no consequent: else*/
if (prexstat)
goto end_of_func;
sizeof (tnf_probe_test_func_t));
/*LINTED statement has no consequent: else*/
return (prexstat);
}
void *cd)
{
/*LINTED statement has no consequent: else*/
if (prexstat)
goto end_of_func;
sizeof (tnf_probe_test_func_t));
/*LINTED statement has no consequent: else*/
return (prexstat);
}
{
/*LINTED statement has no consequent: else*/
if (prexstat)
goto end_of_func;
sizeof (tnf_probe_func_t));
/*LINTED statement has no consequent: else*/
return (prexstat);
}
void *cd)
{
/*LINTED statement has no consequent: else*/
if (prexstat)
goto end_of_func;
sizeof (tnf_probe_func_t));
/*LINTED statement has no consequent: else*/
return (prexstat);
}
const char *lib_base_name, const char *func)
{
return (TNFCTL_ERR_BADARG);
/*LINTED statement has no consequent: else*/
if (prexstat)
goto end_of_func;
goto end_of_func;
}
if (lib_base_name) {
&func_addr);
} else {
}
/* check if function address was found */
if (prexstat)
goto end_of_func;
&comb);
if (prexstat)
goto end_of_func;
sizeof (tnf_probe_func_t));
/*LINTED statement has no consequent: else*/
return (prexstat);
}
void *cd)
{
return (TNFCTL_ERR_BADARG);
/*LINTED statement has no consequent: else*/
if (prexstat)
goto end_of_func;
sizeof (tnf_probe_func_t));
/*LINTED statement has no consequent: else*/
return (prexstat);
}
/*
* Important that this function be tail recursive to minimize depth
* of call chain that is called for every probe
*/
static tnfctl_errcode_t
{
/* Call function only if match_func returns true */
return (prexstat);
}