Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

tnfctl_internal_open(3tnf) [opensolaris man page]

tnfctl_internal_open(3TNF)				       TNF Library Functions					tnfctl_internal_open(3TNF)

NAME
tnfctl_internal_open - create handle for internal process probe control SYNOPSIS
cc [ flag ... ] file ... -ltnfctl [ library ... ] #include <tnf/tnfctl.h> tnfctl_errcode_t tnfctl_internal_open(tnfctl_handle_t **ret_val); DESCRIPTION
tnfctl_internal_open() returns in ret_val a pointer to an opaque handle that can be used to control probes in the same process as the call- er (internal process probe control). The process must have libtnfprobe.so.1 loaded. Probes in libraries that are brought in by dlopen(3C) will be visible after the library has been opened. Probes in libraries closed by a dlclose(3C) will not be visible after the library has been disassociated. See the NOTES section for more details. RETURN VALUES
tnfctl_internal_open() returns TNFCTL_ERR_NONE upon success. ERRORS
TNFCTL_ERR_ALLOCFAIL A memory allocation failure occurred. TNFCTL_ERR_BUSY Another client is already tracing this program (internally or externally). TNFCTL_ERR_NOLIBTNFPROBE libtnfprobe.so.1 is not linked in the target process. TNFCTL_ERR_INTERNAL An internal error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWtnfc | +-----------------------------+-----------------------------+ |MT Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
ld(1), prex(1), TNF_PROBE(3TNF), dlopen(3C), dlclose(3C), libtnfctl(3TNF), tracing(3TNF), attributes(5) Linker and Libraries Guide NOTES
libtnfctl interposes on dlopen(3C) and dlclose(3C) in order to be notified of libraries being dynamically opened and closed. This interpo- sition is necessary for internal process probe control to update its list of probes. In these interposition functions, a lock is acquired to synchronize on traversal of the library list maintained by the runtime linker. To avoid deadlocking on this lock, tnfctl_inter- nal_open() should not be called from within the init section of a library that can be opened by dlopen(3C). Since interposition does not work as expected when a library is opened dynamically, tnfctl_internal_open() should not be used if the client opened libtnfctl through dlopen(3C). In this case, the client program should be built with a static dependency on libtnfctl. Also, if the client program is explicitly linking in -ldl, it should link -ltnfctl before -ldl. Probes in filtered libraries (see ld(1)) will not be seen because the filtee (backing library) is loaded lazily on the first symbol refer- ence and not at process startup or dlopen(3C) time. A workaround is to call tnfctl_check_libs(3TNF) once the caller is sure that the filtee has been loaded. SunOS 5.11 1 Mar 2004 tnfctl_internal_open(3TNF)

Check Out this Related Man Page

tnfctl_close(3TNF)					       TNF Library Functions						tnfctl_close(3TNF)

NAME
tnfctl_close - close a tnfctl handle SYNOPSIS
cc [ flag ... ] file ... -ltnfctl [ library ... ] #include <tnf/tnfctl.h> tnfctl_errcode_t tnfctl_close(tnfctl_handle_t *hndl, tnfctl_targ_op_t action); DESCRIPTION
tnfctl_close() is used to close a tnfctl handle and to free up the memory associated with the handle. When the handle is closed, the trac- ing state and the states of the probes are not changed. tnfctl_close() can be used to close handles in any mode, that is, whether they were created by tnfctl_internal_open(3TNF), tnfctl_pid_open(3TNF), tnfctl_exec_open(3TNF), tnfctl_indirect_open(3TNF), or tnfctl_ker- nel_open(3TNF). The action argument is only used in direct mode, that is, if hndl was created by tnfctl_exec_open(3TNF) or tnfctl_pid_open(3TNF). In direct mode, action specifies whether the process will proceed, be killed, or remain suspended. action may have the following values: TNFCTL_TARG_DEFAULT Kills the target process if hndl was created with tnfctl_exec_open(3TNF), but lets it continue if it was created with tnfctl_pid_open(3TNF). TNFCTL_TARG_KILL Kills the target process. TNFCTL_TARG_RESUME Allows the target process to continue. TNFCTL_TARG_SUSPEND Leaves the target process suspended. This is not a job control suspend. It is possible to attach to the process again with a debugger or with the tnfctl_pid_open(3TNF) interface. The target process can also be continued with prun(1). RETURN VALUES
tnfctl_close() returns TNFCTL_ERR_NONE upon success. ERRORS
The following error codes apply to tnfctl_close(): TNFCTL_ERR_BADARG A bad argument was sent in action. TNFCTL_ERR_INTERNAL An internal error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWtnfc | +-----------------------------+-----------------------------+ |MT Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
prex(1), prun(1), TNF_PROBE(3TNF), libtnfctl(3TNF), tnfctl_exec_open(3TNF), tnfctl_indirect_open(3TNF), tnfctl_kernel_open(3TNF), tnfctl_pid_open(3TNF), tracing(3TNF), attributes(5) SunOS 5.11 4 Mar 1997 tnfctl_close(3TNF)
Man Page