/*
* 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.
*/
#ifndef _TNFCTL_H
#define _TNFCTL_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <gelf.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* data model dependent defs
*/
#if defined(_LP64)
#else
#endif
/*
* Opaque tnfctl handle
*/
/*
* Opaque probe handle
*/
/*
* Trace attributes and probe state
*/
typedef enum {
typedef struct tnfctl_trace_attrs {
long pad;
typedef struct tnfctl_probe_state {
const char *attr_string;
void *client_registered_data;
long pad;
/*
* error codes
*/
typedef enum {
/*
* event codes
*/
typedef enum {
/*
* action to perform on target process
*/
typedef enum {
/* tnfctl_exec_open() */
/*
* data structures needed when using tnfctl_indirect_open() interface i.e. for
* clients that will supply callback functions for inspecting target image.
*/
typedef struct tnfctl_ind_obj_info {
typedef int tnfctl_ind_obj_f(
void *, /* opaque prochandle */
const struct tnfctl_ind_obj_info *, /* info about this object */
void *); /* client supplied data */
typedef struct tnfctl_ind_config {
/*
* maps an errcode to a string
*/
const char *tnfctl_strerror(tnfctl_errcode_t);
/*
* interfaces to open a tnfctl handle
*/
pid_t, /* pid */
tnfctl_handle_t **); /* return value */
void *, /* prochandle */
tnfctl_ind_config_t *, /* config */
tnfctl_handle_t **); /* return value */
const char *, /* pgm name */
char * const *, /* argv */
char * const *, /* envp */
const char *, /* ld_preload */
const char *, /* libtnfprobe_path */
tnfctl_handle_t **); /* return value */
/*
* direct mode - to continue process
*/
tnfctl_event_t *, /* return value - why did process stop ? */
tnfctl_handle_t **); /* return value - if fork, handle on child */
/*
* informs libtnfctl that libraries may have changed
*/
/*
*
*/
const char *, /* filename - ignored if kernel handle */
uint_t); /* buffer size */
/*
* kernel tracing only
*/
/*
* probe operation interface
*/
tnfctl_probe_t *, /* opaque probe handle */
void *); /* client supplied data */
tnfctl_probe_op_t, /* func to apply to each of the probes */
void *); /* client data - arg to pass to func */
ulong_t, /* # of probe id's in array */
ulong_t *, /* array of probe id's */
tnfctl_probe_op_t, /* func to apply to each those probes */
void *); /* client data - arg to pass to func */
void (*)(void *)); /* destroy_func */
/*
* supplied probe functions that can be used with tnfctl_probe_apply()
* and tnfctl_probe_apply_ids(). last argument is ignored when it is "void *"
*/
void *);
void *);
void *);
void *);
tnfctl_probe_t *, void *);
const char *, /* library base name */
const char *); /* function name */
#ifdef __cplusplus
}
#endif
#endif /* _TNFCTL_H */