Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

tnfctl_close(3tnf) [sunos 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.10 4 Mar 1997 tnfctl_close(3TNF)

Check Out this Related Man Page

tnfctl_buffer_alloc(3TNF)				       TNF Library Functions					 tnfctl_buffer_alloc(3TNF)

NAME
tnfctl_buffer_alloc, tnfctl_buffer_dealloc - allocate or deallocate a buffer for trace data SYNOPSIS
cc [ flag ... ] file ... -ltnfctl [ library ... ] #include <tnf/tnfctl.h> tnfctl_errcode_t tnfctl_buffer_alloc(tnfctl_handle_t *hndl, const char *trace_file_name, size_t trace_buffer_size); tnfctl_buffer_dealloc(tnfctl_handle_t *hndl); DESCRIPTION
tnfctl_buffer_alloc() allocates a buffer to which trace events are logged. When tracing a process using a tnfctl handle returned by tnfctl_pid_open(3TNF), tnfctl_exec_open(3TNF), tnfctl_indirect_open(3TNF), and tnfctl_internal_open(3TNF)), trace_file_name is the name of the trace file to which trace events should be logged. It can be an absolute path specification or a relative path specification. If it is relative, the current working directory of the process that is calling tnfctl_buffer_alloc() is prefixed to trace_file_name. If the named trace file already exists, it is overwritten. For kernel tracing, that is, for a tnfctl handle returned by tnfctl_kernel_open(3TNF), trace events are logged to a trace buffer in memory; therefore, trace_file_name is ignored. Use tnfxtract(1) to extract a kernel buffer into a file. trace_buffer_size is the size in bytes of the trace buffer that should be allocated. An error is returned if an attempt is made to allocate a buffer when one already exists. tnfctl_buffer_alloc() affects the trace attributes; use tnfctl_trace_attrs_get(3TNF) to get the latest trace attributes after a buffer is allocated. tnfctl_buffer_dealloc() is used to deallocate a kernel trace buffer that is no longer needed. hndl must be a kernel handle, returned by tnfctl_kernel_open(3TNF). A process's trace file cannot be deallocated using tnfctl_buffer_dealloc(). Instead, once the trace file is no longer needed for analysis and after the process being traced exits, use rm(1) to remove the trace file. Do not remove the trace file while the process being traced is still alive. tnfctl_buffer_dealloc () affects the trace attributes; use tnfctl_trace_attrs_get(3TNF) to get the latest trace attributes after a buffer is deallocated. For a complete discussion of tnf tracing, see tracing(3TNF). RETURN VALUES
tnfctl_buffer_alloc() and tnfctl_buffer_dealloc() return TNFCTL_ERR_NONE upon success. ERRORS
The following error codes apply to tnfctl_buffer_alloc(): TNFCTL_ERR_BUFEXISTS A buffer already exists. TNFCTL_ERR_ACCES Permission denied; could not create a trace file. TNFCTL_ERR_SIZETOOSMALL The trace_buffer_size requested is smaller than the minimum trace buffer size needed. Use trace_min_size of trace attributes in tnfctl_trace_attrs_get(3TNF) to determine the minimum size of the buffer. TNFCTL_ERR_SIZETOOBIG The requested trace file size is too big. TNFCTL_ERR_BADARG trace_file_name is NULL or the absolute path name is longer than MAXPATHLEN. TNFCTL_ERR_ALLOCFAIL A memory allocation failure occurred. TNFCTL_ERR_INTERNAL An internal error occurred. The following error codes apply to tnfctl_buffer_dealloc(): TNFCTL_ERR_BADARG hndl is not a kernel handle. TNFCTL_ERR_NOBUF No buffer exists to deallocate. TNFCTL_ERR_BADDEALLOC Cannot deallocate a trace buffer unless tracing is stopped. Use tnfctl_trace_state_set(3TNF) to stop trac- ing. 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), rm(1), tnfxtract(1), TNF_PROBE(3TNF), libtnfctl(3TNF), tnfctl_exec_open(3TNF), tnfctl_indirect_open(3TNF), tnfctl_inter- nal_open(3TNF), tnfctl_kernel_open(3TNF), tnfctl_pid_open(3TNF), tnfctl_trace_attrs_get(3TNF), tracing(3TNF), attributes(5) SunOS 5.10 4 Mar 1997 tnfctl_buffer_alloc(3TNF)
Man Page