tnfctl_probe_state_get, tnfctl_probe_enable, tnfctl_probe_disable, tnfctl_probe_trace, tnfctl_probe_untrace, tnfctl_probe_connect, tnfctl_probe_disconnect_all - interfaces to query and to change the state of a probe
cc [ flag ... ] file ... -ltnfctl [ library ... ] #include <tnf/tnfctl.h> tnfctl_errcode_t tnfctl_probe_state_get(tnfctl_handle_t *hndl, tnfctl_probe_t *probe_hndl, tnfctl_probe_state_t *state);
tnfctl_errcode_t tnfctl_probe_enable(tnfctl_handle_t *hndl, tnfctl_probe_t *probe_hndl, void *ignored);
tnfctl_errcode_t tnfctl_probe_disable(tnfctl_handle_t *hndl, tnfctl_probe_t *probe_hndl, void *ignored);
tnfctl_errcode_t tnfctl_probe_trace(tnfctl_handle_t *hndl, tnfctl_probe_t *probe_hndl, void *ignored);
tnfctl_errcode_t tnfctl_probe_untrace(tnfctl_handle_t *hndl, tnfctl_probe_t *probe_hndl, void *ignored);
tnfctl_errcode_t tnfctl_probe_disconnect_all(tnfctl_handle_t *hndl, tnfctl_probe_t *probe_hndl, void *ignored);
tnfctl_errcode_t tnfctl_probe_connect(tnfctl_handle_t *hndl, tnfctl_probe_t *probe_hndl, const char *lib_base_name, const char *func_name);
tnfctl_probe_state_get() returns the state of the probe specified by probe_hndl in the process or kernel specified by hndl. The user will pass these in to an apply iterator. The caller must also allocate state and pass in a pointer to it. The semantics of the individual members of state are:
id
attr_string
"name pageout;slots vnode pages_pageout ; keys vm pageio io;file vm.c;line 25;"
enabled
traced
new_probe
obj_name
func_names
func_addrs
client_registered_data
tnfctl_probe_enable(), tnfctl_probe_disable(), tnfctl_probe_trace(), tnfctl_probe_untrace(), and tnfctl_probe_disconnect_all() ignore the last argument. This convenient feature permits these functions to be used in the probe_op field of tnfctl_probe_apply(3TNF) and tnfctl_probe_apply_ids(3TNF). tnfctl_probe_enable() enables the probe specified by probe_hndl. This is the master switch on a probe. A probe does not perform any action until it is enabled.
tnfctl_probe_disable() disables the probe specified by probe_hndl.
tnfctl_probe_trace() turns on tracing for the probe specified by probe_hndl. Probes emit a trace record only if the probe is traced.
tnfctl_probe_untrace() turns off tracing for the probe specified by probe_hndl. This is useful if you want to connect probe functions to a probe without tracing it.
tnfctl_probe_connect() connects the function func_name which exists in the library lib_base_name, to the probe specified by probe_hndl. tnfctl_probe_connect() returns an error code if used on a kernel tnfctl handle. lib_base_name is the base name (not a path) of the library. If it is NULL, and multiple functions in the target process match func_name, one of the matching functions is chosen arbitrarily. A probe function is a function that is in the target's address space and is written to a certain specification. The specification is not currently published.
tnf_probe_debug() is one function exported by libtnfprobe.so.1 and is the debug function that prex(1) uses. When the debug function is executed, it prints out the probe arguments and the value of the sunw%debug attribute of the probe to stderr.
tnfctl_probe_disconnect_all() disconnects all probe functions from the probe specified by probe_hndl.
Note that no libtnfctl call returns a probe handle (tnfctl_probe_t), yet each of the routines described here takes a probe_hndl as an argument. These routines may be used by passing them to one of the tnfctl_probe_apply(3TNF) iterators as the "op" argument. Alternatively, probe handles may be obtained and saved by a user's "op" function, and they can be passed later as the probe_hndl argument when using any of the functions described here.
tnfctl_probe_state_get(), tnfctl_probe_enable(), tnfctl_probe_disable(), tnfctl_probe_trace(), tnfctl_probe_untrace(), tnfctl_probe_disconnect_all() and tnfctl_probe_connect() return TNFCTL_ERR_NONE upon success.
The following error codes apply to tnfctl_probe_state_get():
TNFCTL_ERR_INVALIDPROBE
The following error codes apply to tnfctl_probe_enable(), tnfctl_probe_disable(), tnfctl_probe_trace(), tnfctl_probe_untrace(), and tnfctl_probe_disconnect_all()
TNFCTL_ERR_INVALIDPROBE
TNFCTL_ERR_BUFBROKEN
TNFCTL_ERR_NOBUF
The following error codes apply to tnfctl_probe_connect():
TNFCTL_ERR_INVALIDPROBE
TNFCTL_ERR_BADARG
TNFCTL_ERR_BUFBROKEN
TNFCTL_ERR_NOBUF
See attributes(5) for description of the following attributes:
|
prex(1), TNF_PROBE(3TNF), libtnfctl(3TNF), tnfctl_check_libs(3TNF), tnfctl_continue(3TNF), tnfctl_probe_apply(3TNF), tnfctl_probe_apply_ids(3TNF), tracing(3TNF), tnf_kernel_probes(4), attributes(5)
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |